How yash8202/miniproject-manager works
Project Type & Purpose
• This is a full-stack web application built with Next.js and React. It is designed to facilitate college mini project management by allowing students to create teams, invite peers, and get mentorship from teachers.
• The README clearly states the system’s aim of managing semester mini projects, and the file tree confirms a client-rendered application (with Next.js “app” folders) that also implements API routes, authentication (via NextAuth under “api/auth”), and database operations via Prisma.
File Structure for Architectural Components
• Frontend:
• Located primarily under “src/app” with dedicated subdirectories for authentication (sign-in) and dashboard (components for team creation, student and coordinator pages).
• Backend / API:
• API endpoints are created under “src/app/api” and “src/server/api” – including endpoints for authentication (handled with NextAuth), miniprojects, and sending mails.
• TRPC endpoints are defined in “src/app/api/trpc” and further organized under “src/trpc” for both server and client-side integration.
• Database:
• The “prisma” directory holds the database schema (schema.prisma) and migration scripts (with several migration folders), suggesting the use of a PostgreSQL database (as mentioned in the prerequisites).
• External integrations:
• Dependencies include NextAuth (for Google authentication), Prisma (for ORM), Tailwind CSS (for UI styling), and email sending via Resend.
• Docker Support:
• Presence of “docker-compose.yml” suggests containerized deployment, which may also include a container for database or the application itself.
Key Components
• Desktop/Web Client (Browser):
• Represents the user’s browser which loads the Next.js front-end UI.
• Next.js Frontend:
• Responsible for rendering pages (pages for auth, dashboard, teams, etc.), components, and UI interactions.
• Next.js API / Backend Server:
• Contains two layers:
º Standard API routes (e.g., “/api/auth”, “/api/miniproject”, “/api/send-mail”) for specific endpoints.
º TRPC router routes for data fetching and manipulation.
• Handles user authentication (including Google login using NextAuth) and server-side business logic.
• Database Service (PostgreSQL):
• Managed via Prisma. Show a connection from backend API modules to the database, and annotate “Prisma Client” usage.
• External Services:
• Google: For authentication/authorization.
• Resend: For sending emails (invite functionality, team notifications).
• Infrastructure/Deployment:
How Components Interact (Relationships and Data Flow)
• The Browser issues HTTP/HTTPS requests to the Next.js Frontend.
• The Frontend serves dynamic pages and interacts with the Next.js Backend via API endpoints and TRPC calls.
• The API layer processes requests:
• For authentication, it communicates with external services (Google, Resend) and relies on NextAuth.
• For data management, it uses Prisma to interact with the PostgreSQL database.
• Data flows from client to API routes,
• API routes to the database,
• And from API to external services for authentication (Google) and notifications (Resend).
Architectural Patterns and Design Principles
• Separation between UI and backend business logic (frontend “app” vs. API routes).
• Use of modular routing, with a clear distinction between the authentication module, team management, and mentor assignment.
• Use of TRPC providing type-safe API communication between client and server.
• Standard MVC-like separation found in Next.js applications with a clear routing (“app” folder structure).