How devnexessam/uni-portal works
Project type and purpose
• This is a full-stack university student portal built with Next.js (frontend + backend combined).
• Purpose: Allow students and admins to register/login, upload and manage academic files, track schedules and assignments, and use an AI assistant to query PDF materials.
File structure
• Top-level “app” directory: Next.js 13+ App Router containing all page routes (both public and authenticated).
• Under “app/(pages)/admin” and “app/(pages)/student”: separate dashboards for each role, with nested layouts and pages for assignments, courses, files, schedules, settings, etc.
• “app/api”: Next.js API routes for admin operations (CRUD on assignments, courses, files, schedules, students), student operations (profile, courses, assignments, files, schedule, AI questions), and authentication via next-auth.
• “components”: UI components organized by domain (admin, student, forms, layout, generic UI widgets).
• “lib”: configuration for database (mongodb.ts), authentication options (adminAuthOptions.ts, studentAuthOptions.ts), and external services (cloudinary.ts).
• “models”: Mongoose schemas for each domain entity (Admin, Student, Course, Assignment, File, Schedule).
• Config files: next.config.ts, tsconfig.json, nginx/.envs implicit, tailwind/postcss configs.
README for additional insights
• Confirms tech stack: Next.js + Tailwind CSS, MongoDB via Mongoose.
• Features: secure auth, file upload, dashboard, role-based access, AI assistant (probably via OpenAI).
Detailed capture of essential elements
• Don’t over-segment: group related API routes under one “API Layer” block, but call out Next-auth within it.
• Nested dashboards (admin vs. student) as sub-blocks within the Frontend layer.
• Data flows for critical use cases: e.g., “Upload Assignment → Cloudinary → store metadata in MongoDB → update dashboard.”
• AI flow: “Student clicks Q&A → sends PDF content + question to Next.js AI endpoint → calls OpenAI → returns answer.”