How rajeshmore369/alumni-website-main works
Purpose and Runtime
This is a full-stack alumni portal: a Next.js client provides public and authenticated alumni workflows, while an Express/Node API manages users, content, and file-backed resumes. The frontend runs on Next.js (port 3000); the backend runs independently on Node/Express (default port 5000).
Core entry points:
• client/src/app/layout.js
• client/src/app/page.js
• server/server.js
Client Application Shell
The client uses the Next.js App Router. The root layout establishes global UI and likely wraps state providers; ClientLayout.js supports client-side behavior around application content. Shared navigation and chatbot functionality are centralized components.
Paths:
• client/src/app/layout.js
• client/src/app/ClientLayout.js
• client/src/components/Navbar.js
• client/src/components/Chatbot.js
Frontend Routes and User Workflows
Route pages map directly to portal capabilities: login/registration, profile management, alumni browsing, jobs, events, notes, resume management, and administration. Dynamic event detail is served through the [id] route.
Paths:
• client/src/app/login/page.js
• client/src/app/profile/page.js
• client/src/app/events/[id]/page.js
• client/src/app/admin/page.js
Authentication Boundary
Client-side authentication state is managed through a React context, while API authentication is enforced by server middleware using JWT configuration. Authentication routes establish credentials; protected resource routes rely on the middleware boundary rather than trusting client state.
Paths:
• client/src/context/AuthContext.js
• client/src/lib/api.js
• server/routes/auth.js
• server/middleware/auth.js
API and Domain Modules
The Express server composes route modules around primary domain resources: users/alumni, events, jobs, notes, resumes, and administrator operations. Routes mediate HTTP requests and persistence operations against corresponding Mongoose-style model modules.
Paths:
• server/server.js
• server/routes/users.js
• server/routes/events.js
• server/routes/jobs.js
• server/routes/admin.js
Persistence and File Uploads
MongoDB Atlas is the system of record, configured through MONGODB_URI. Domain records are separated into user, event, job, note, and resume collections/models. Resume upload handling is isolated in middleware and integrates with Cloudinary, whose credentials are supplied through server environment variables.
Paths:
• server/models/User.js
• server/models/Resume.js
• server/models/Event.js
• server/middleware/upload.js
• server/routes/resumes.js
Primary Flow and External Dependencies
Browser pages call the backend through the shared API client. The server authenticates requests, invokes resource routes, persists/retrieves MongoDB documents, and uploads resume assets to Cloudinary where applicable. Environment-dependent infrastructure consists of MongoDB Atlas, Cloudinary, JWT secrets, and the separately deployed/running client and API processes.
Main entry points: server.js Express server · resumes.js Resume routes · api.js API client · auth.js JWT middleware
Components 17
Next.js Client
App Router frontend running on port 3000.
- Root layout · Establishes global UI and provider boundary.
client/src/app/layout.js - Client layout · Supports client-side application behavior.
client/src/app/ClientLayout.js - Navbar & chatbot
client/src/components/Navbar.js - Portal pages · Login, profile, alumni, jobs, events, notes, and resume workflows.
client/src/app/profile/page.js - Event detail
client/src/app/events/[id]/page.js - Admin page
client/src/app/admin/page.js - Auth context · Maintains client authentication state.
client/src/context/AuthContext.js - API client · Shared browser-to-API request boundary.
client/src/lib/api.js
Express API
Independent Node service running on port 5000.
- Express server · Composes middleware and domain route modules.
server/server.js - Auth routes · Establish credentials for client sessions.
server/routes/auth.js - JWT middleware · Protects API resources using JWT configuration.
server/middleware/auth.js - Resource routes · Users, events, jobs, notes, resumes, and admin operations.
server/routes/users.js - Resume routes · Handles resume metadata and upload requests.
server/routes/resumes.js - Upload middleware · Transfers resume assets to Cloudinary.
server/middleware/upload.js
Persistence & Assets
- Domain models · User, event, job, note, and resume documents.
server/models/User.js - MongoDB Atlas · System of record, configured by MONGODB_URI.
- Cloudinary · External resume asset storage.
Connections 19
- Root layout → Client layout: wraps
- Client layout → Navbar & chatbot: renders
- Root layout → Auth context: provides
- Portal pages → Auth context: reads session state
- Portal pages → API client: calls
- Event detail → API client: loads event
- Admin page → API client: calls
- API client → Express server: HTTP API
- Express server → Auth routes: mounts
- Express server → JWT middleware: applies to protected routes
- JWT middleware → Resource routes: authorizes
- JWT middleware → Resume routes: authorizes
- Express server → Resource routes: mounts
- Express server → Resume routes: mounts
- Resource routes → Domain models: reads and writes
- Resume routes → Domain models: stores metadata
- Domain models → MongoDB Atlas: persists documents
- Resume routes → Upload middleware: uses
- Upload middleware → Cloudinary: uploads assets