How iamaniket10/session-tracker-portal works
Main Components
• Frontend Component:
• Built using Next.js 13+ with TypeScript, TailwindCSS, and shadcn/ui.
• Key directories: “frontend/src/app” (pages for login, signup, sessions, homework, admin session creation) and “frontend/src/components” (UI elements, layout components, forms, etc.).
• Handles user login/signup, session and homework views, and interactive components such as accordions and forms.
• Backend Component:
• Built on Node.js with Express.js, using MongoDB Atlas.
• Key directories: “backend/controllers” (for session, homework, user, and notification operations), “backend/models” (Mongoose models for Homework, Notification, Session, SessionDetail, and User), “backend/routes” (mapping HTTP routes to controllers), and “backend/middleware” (for authentication and error handling).
• Database:
• MongoDB Atlas serves as the storage for user data, session details, homework tasks, and notifications.
• External Services:
• JWT and bcrypt for authentication and security.
• Axios (on the frontend) for making API requests.
• External deployment services: Frontend on Vercel, backend on Render.
Relationships and Interactions
• User Interface → Frontend:
• Users interact via web browsers with pages built using Next.js.
• Visual components (e.g., login forms, session accordions, homework task views) form part of the client-side.
• Frontend ↔ Backend:
• The frontend uses Axios to communicate with the backend’s REST API endpoints for sessions, homework, notifications, and user management.
• Backend Internal Flow:
• Routes: Map incoming HTTP requests to controllers.
• Controllers: Contain the business logic (e.g., session management, homework creation, notifications processing).
• Middleware: Enforces authentication and error handling on relevant routes.
• Models: Represent and persist data in MongoDB.
• Security & Data Handling:
• Security layers (JWT for authentication, bcrypt for password hashing) within the backend.
• Error middleware as part of the request pipeline.
Architectural Patterns and Design Principles
• Separation of Concerns:
• Frontend and backend are clearly segregated into distinct directories and services.
• MVC-like patterns on the backend: Models for data, Controllers for business logic, and Routes for HTTP endpoints.
• Role-Based Access Control:
• Differentiate admin-only functionalities (creating sessions, editing tasks) versus client functionalities (viewing sessions/homework).
• API-First Design:
• The backend acts as a RESTful API service interfacing with the database and frontend.
• Detail key sub-components:
• Within the frontend, mark out directories/pages such as “admin creation session,” “homework management,” and “session details.”
• External dependencies like Axios on the frontend and external deployment services (Vercel, Render).