How wizardgeeky/ai-mock-interview-platform works
Main Components
a. User Interface (Frontend)
• Represented by the pages and components in the "app" directory (e.g., interview, portal, profile, reset pages).
b. API / Backend Services
• Directory "app/api" includes versioned endpoints for authentication (login, reset links, password changes, user details, and mock test endpoints).
c. Data Models & Configuration
• Models (Interview, ResetLink, UserModel) and configuration files (database-config, ai-config, email-config) reside under "app/models" and "app/config".
d. External Services & Integrations
• Judge0 Compiler: For real-time code execution.
• Gemini AI: For AI-powered code review and interview simulation.
e. Database & Security
• MongoDB plays the primary storage role for users, interview history, and other persistent data.
• Security aspects (JWT tokens, AES encryption) can be annotated as part of the data flow within the Authentication & Session Management module.
Detail the Relationships & Data Flow
• How the Frontend interacts with the Backend:
• From the UI, users submit code through interactive pages (Interview, Portal, etc.), which trigger API calls.
• Flow from Backend to External Services:
• API endpoints for coding challenges send requests to Gemini AI and Judge0 to generate problems, execute code, and fetch AI feedback.
• API endpoints with the Database:
• Internal utility flows:
• Modules like token generation (app/utils/token.ts) and encryption logic (app/utils/cipher.ts) as supporting functions within the Backend layer.
Architectural Patterns & Design Principles
• Separation of Concerns: Clearly separate UI (React pages/components) from API logic (Next.js API routes and controllers).
• Versioning in APIs: Note how the API routes are versioned (v.0.0 under "app/api/auth"), which allows for future scalability.
• Security: Emphasize JWT-based authentication and the AES encryption strategy (with cipher utilities and config files).
• Integration Points: Mark external service integration points for Judge0 and Gemini AI, as these are key to the project’s AI capabilities.
Summary of Essential Elements
• Components:
• Frontend (Next.js pages, Tailwind CSS)
• Backend/API Endpoints (Authentication, Mock Interview modules)
• Data Models & Configurations (UserModel, Interview, ResetLink, AI/Email/Database Config)
• External Services (Judge0, Gemini AI)
• Database (MongoDB)
• Connections:
• API calls between Frontend and API
• API communication with External Services and Database
• Security flows through authentication modules
• Design Focus:
• Detailed representation of data flow and interactions.
• Emphasis on security, modular API design, and external integrations for AI and code execution.
Happy diagramming!