How vighnesh2304/prepwise works
Main Components
• Frontend (User Interface):
• Inside this, show separate segments for:
◦ Auth Pages – located under app/(auth) with sign-in and sign-up pages (using Firebase for auth).
◦ Main Interview Pages – found in app/(root), including the interview dashboard, individual interview routes (dynamic [id] pages), and feedback display.
◦ Shared Layout – global and layout files (app/layout.tsx, etc.) that provide consistent navigation and styling.
• API Layer:
• “API Endpoints” that the Next.js server exposes. Notably:
◦ The /app/api route with subroutes like /vapi/generate that calls a server-side function to generate interview questions.
• Business Logic & Service Layer:
◦ Actions (auth.action.ts, general.action.ts) that encapsulate core functionalities like authentication and interview feedback generation.
◦ Utility functions (lib/utils.ts) that support various tasks like fetching tech logos or interview covers.
• External Integrations:
• Distinct components for:
• Styling & UI Libraries:
Relationships and Data Flow
◦ User interactions on the frontend trigger API calls (for interview generation, submission, and feedback retrieval).
◦ API endpoints in the Next.js server then communicate with external AI services (Vapi, Gemini) to generate questions or to process interview transcripts.
◦ Business logic interacts with the Firebase backend for authentication and storage of interview sessions and feedback results.
◦ Utility functions (like getTechLogos) are called by UI components and server actions to enhance UI presentation.
• That the project’s routing is modular – with a clear separation between authentication flows (/app/(auth)) and main application areas (/app/(root)).
Architectural Patterns and Design Principles
• The separation of concerns is visible: UI components, API routes, business logic, and external integration are clearly delineated.
• The use of Next.js’ file-based routing (with dynamic paths and route segments) suggests an MVC-like separation where pages serve as controllers, components as views, and business logic in the lib folder as the model layer, even if not traditional MVC.
• That the project uses modern server-side functions (e.g., in app/api/vapi/generate/route.ts) to process requests, aligning with serverless/Microservice patterns.
Final Composition Elements
• Clear, legible labels for each component and subcomponent.
• And annotate how authentication, interview generation, and feedback are handled in the application’s flow.