Security is an important part of the VUKA platform.
The system incorporates security mechanisms throughout the application to protect user accounts, authentication credentials, API access, personal information, and other sensitive system data.
One of the key security mechanisms implemented by VUKA is Multi-Factor Authentication (MFA), which provides an additional layer of protection beyond the user's password.
Security is considered across:
User identities are protected through authentication mechanisms including JWT-based access tokens and Multi-Factor Authentication.
Authenticated users must only be able to access information and resources for which they are authorized.
Passwords, API keys, database credentials, and other secrets must not be exposed or committed to the repository.
User input and API requests should be validated before being processed by the application.
Authentication activity, login attempts, audit information, and security events are tracked by the system.
Authentication is responsible for establishing and protecting the identity of VUKA users.
The authentication system supports:
- User registration
- User login
- JWT access tokens
- Refresh tokens
- Logout
- Password reset
- Multi-Factor Authentication
- Account lockout
- Login-attempt tracking
- User profile management
The authentication flow provides multiple layers of protection around user accounts.
USER
│
▼
┌───────────────┐
│ LOGIN │
└───────┬───────┘
│
▼
┌───────────────┐
│ PASSWORD │
│ VERIFICATION │
└───────┬───────┘
│
▼
┌───────────────┐
│ MFA │
│ VERIFICATION │
└───────┬───────┘
│
▼
┌───────────────┐
│ JWT ACCESS │
│ TOKEN │
└───────┬───────┘
│
▼
┌───────────────┐
│ PROTECTED │
│ API ACCESS │
└───────────────┘
VUKA uses Multi-Factor Authentication (MFA) to provide an additional layer of account protection.
MFA reduces reliance on passwords alone by requiring an additional authentication factor during the authentication process.
The system performs an additional verification step through the MFA mechanism.
Password Alone
│
▼
NOT ENOUGH
│
▼
Additional Verification
│
▼
Authenticated User
│
▼
Protected Resources
MFA therefore provides an additional security boundary around user accounts.
Authenticated API endpoints must be protected against unauthorized access.
The backend uses authentication and authorization mechanisms to ensure that protected resources are not freely accessible.
Security controls should be applied to API endpoints that handle:
-
User information
-
Onboarding information
-
Learning progress
-
Assessments
-
Opportunities
-
Verification information
-
Account settings
-
Administrative operations
API REQUEST │ ▼ ┌───────────────┐ │ Authentication│ │ Check │ └───────┬───────┘ │ ┌──────┴──────┐ │ │ Valid Invalid │ │ ▼ ▼ Authorization Reject Check Request │ ┌──────┴──────┐ │ │ Allowed Denied │ │ ▼ ▼Process API Reject Request Access
Authentication determines who the user is.
Authorization determines what the user is allowed to access.
VUKA should ensure that users can only access information associated with their authorized account and permissions.
This is particularly important for resources containing:
- Personal information
- Learning progress
- Assessment results
- Verification information
- Account information
- Administrative resources
The backend must verify that the authenticated user has permission to perform the requested operation.
Sensitive credentials must never be exposed through the repository or frontend application.
The following information must remain protected:
Database usernames, passwords, connection strings, and related secrets must not be exposed.
The repository must not contain:
- Passwords
- Private API keys
- Database passwords
- JWT secrets
- SMTP passwords
- Private tokens
- Production credentials
- Encryption secrets
Sensitive configuration should instead be provided through environment variables or an appropriate secure configuration mechanism.
For example:
GEMINI_API_KEY=********
YOUTUBE_API_KEY=********
SERPER_API_KEY=********
DATABASE_URL=********
JWT_SECRET=********
SMTP_PASSWORD=********
User input must be validated before it is processed by the backend.
Input validation helps ensure that the application receives data in the expected format.
Validation should be applied to:
- Registration information
- Login information
- Onboarding information
- Assessment responses
- Opportunity information
- Verification submissions
- API parameters
- Request bodies
The VUKA backend uses Pydantic schemas to define and validate API request and response structures.
User Input
│
▼
Pydantic Schema
│
▼
Validation
│
┌──┴───────┐
│ │
Valid Invalid
│ │
▼ ▼
Service Reject
Layer Request
Authentication failures should be handled securely.
The application should avoid exposing unnecessary information that could help an attacker understand internal authentication mechanisms.
Examples of authentication failures include:
- Invalid credentials
- Expired tokens
- Invalid tokens
- Failed MFA verification
- Locked accounts
- Unauthorized API requests
- Invalid refresh tokens
The system should return appropriate responses while avoiding the exposure of sensitive internal information.
VUKA tracks authentication activity through login-attempt information.
This supports security mechanisms such as:
- Monitoring failed login attempts
- Detecting repeated authentication failures
- Supporting account lockout
- Providing security audit information
Login attempts form part of the broader security architecture.
Login Attempt
│
▼
Authentication
│
┌────┴─────┐
│ │
Success Failure
│ │
▼ ▼
Access Record Attempt
│
▼
Security Controls
│
┌─────┴─────┐
│ │
Continue Lockout
Account lockout provides an additional defense against repeated unsuccessful authentication attempts.
When authentication failures reach the applicable security threshold, the system can restrict further access to protect the account.
Account lockout works together with:
- Login-attempt tracking
- Authentication
- MFA
- Security event tracking
- Audit logging
Security-related activity should be recorded through the application's audit mechanisms.
The backend contains a dedicated security module:
security/
├── audit.py
├── crypto.py
└── password.py
Audit information can provide visibility into important system activities and support security monitoring and investigation.
Security is not implemented as a single isolated component.
Instead, it is distributed throughout the VUKA architecture.
VUKA APPLICATION
│
┌─────────────┴─────────────┐
│ │
▼ ▼
┌───────────────┐ ┌───────────────┐
│ Authentication│ │ Authorization │
└───────┬───────┘ └───────┬───────┘
│ │
└─────────────┬─────────────┘
│
▼
┌─────────────┐
│ MFA │
└──────┬──────┘
│
▼
┌─────────────┐
│ API Security│
└──────┬──────┘
│
┌─────────────┼─────────────┐
│ │ │
▼ ▼ ▼
Input Credential Access
Validation Protection Control
│ │ │
└─────────────┼─────────────┘
│
▼
Audit & Security
Events
The VUKA repository should follow the following security principles.
Never commit passwords, private API keys, database credentials, or production secrets.
Authenticated API endpoints must require appropriate authentication and authorization.
Users should only access information and operations they are authorized to use.
Avoid exposing sensitive information through browser logs, API responses, or error messages.
Sensitive information should not be exposed through frontend browser logs.
Developers should avoid logging:
- Passwords
- Authentication tokens
- Private API keys
- Database credentials
- MFA secrets
- Personal sensitive information
- Internal security details
Development logging should also be reviewed before production deployment.
Production credentials must be stored using secure environment configuration.
The source repository should contain configuration templates or documentation where necessary, but not the actual production secrets.
Example:
Development
│
▼
Environment Variables
│
▼
Application Configuration
│
▼
Backend Services
This allows the application to use different configuration values across development, testing, and production environments without exposing secrets in source control.
Although the VUKA website is completed and deployed, the repository should continue to be maintained.
Future development should follow the established architecture and preserve the existing security and application behavior.
When modifying the website or backend:
Understand the existing API contract before changing frontend or backend behavior.
Check whether reusable API functions and services already exist before creating new ones.
AI personalization behavior must continue to use onboarding information appropriately.
Before deploying a significant change, verify the following:
- Existing API contracts have been reviewed.
- Existing reusable API functions have been checked.
- Duplicate API logic has been avoided.
- Authentication continues to work.
- MFA continues to work.
- Authorization remains intact.
- AI personalization continues to work.
- Mission completion continues to occur automatically.
- Sensitive information is not exposed in browser logs.
- Production credentials remain protected.
- Affected user journeys have been tested.
- The production build has been tested.
- Documentation has been updated where necessary.
The following behaviors are fundamental to the operation of VUKA.
The user's interests and goals are collected during onboarding and used to personalize the user's experience.
Onboarding
│
├── Interests
├── Goals
└── Career Aspirations
│
▼
Personalization
│
┌─────┴─────┐
▼ ▼
Content Opportunities
VUKA retrieves potential educational content from external services rather than relying entirely on manually entered content.
External services can include:
- YouTube
- TikTok
- Web search
The backend processes relevant information before presenting it to the frontend.
Gemini Flash is used to support the content personalization process.
The system uses information collected during onboarding and content retrieved through external APIs to determine which learning resources are relevant to the user.
User Interests
│
▼
External Content
│
▼
Gemini Flash
│
▼
Content Relevance
│
▼
Personalized Learning
The backend records user activity and provides progress information to the frontend.
Progress can include:
- Assessment scores
- Average performance
- Learning streaks
- Weekly activity
- Category performance
- Completed assessments
The frontend uses this information to present the user's learning progress.
Multi-Factor Authentication provides an additional security mechanism beyond the user's primary authentication credentials.
MFA is therefore an important part of the VUKA account protection model.
The overall security model can be summarized as:
USER
│
▼
AUTHENTICATION
│
▼
MFA
│
▼
AUTHORIZED ACCESS
│
▼
PROTECTED API
│
┌──────────┼──────────┐
│ │ │
▼ ▼ ▼
Validation Business Database
Rules Access
│ │ │
└──────────┼──────────┘
│
▼
AUDIT / SECURITY
EVENTS
│
▼
USER RESPONSE
