Web portal for the MCA department at NIT Warangal -- alumni networking, student profiles, study materials, placement cell coordination, and academic resources.
Live demo: mca-nitw.github.io/mca_nitw -- runs in demo mode: sign in with any email and an 8+ character password, then open Alumni.
| Alumni directory (desktop) | Dark mode with search |
|---|---|
![]() |
![]() |
| Sign in (desktop) | Alumni (phone) | Sign in (phone) |
|---|---|---|
![]() |
![]() |
![]() |
A MERN application meant to be the central web portal for MCA students at NIT Warangal. The goal is to connect current students with alumni, give one place for study material and placement updates, and keep student and faculty information in one directory.
The alumni directory, sign-up and sign-in work end to end against the Express API. Most department pages are still placeholders:
- Accounts: Done. Sign-up and login hash passwords with bcrypt (12
rounds) and keep the session in a 7-day JWT inside an httpOnly cookie, so
page scripts never see the token.
GET /api/auth/merestores the session on reload - Alumni directory: Done. Members only; the route loader calls
GET /api/users?q=and the search box re-queries as you type (300 ms debounce,?q=stays in the URL) - Member routes: Signed out,
/alumni,/profileand the other member pages redirect to login and come back after sign-in - Demo mode: The GitHub Pages build has no API behind it, so it runs on the same bundled alumni data the seed script loads. Accounts live in the browser tab only
- Routing, navbar, side nav, light/dark mode: Done
- Responsive layout: Done. On phones the top nav wraps and the side nav becomes a bottom tab bar
- Contact page: Team cards are live; the form logs to the console, it does not send yet
- Full profile: Layout done with placeholder data
- Home, About, Students, others: Placeholder headings
The seeded alumni (except the maintainer) are fictional sample profiles.
flowchart LR
subgraph Browser
A[React 19 SPA<br/>Vite 8] --> R[react-router 8<br/>createBrowserRouter]
R --> P[Pages<br/>CSS Modules + Bootstrap]
R -- route loaders --> C[lib/api.js]
C -. demo mode .-> D[(Bundled alumni.json)]
end
subgraph Server [server/ - Express 5, ESM]
AU["/api/auth<br/>signup, login, logout, me"]
U["/api/users?q=<br/>requireAuth"]
AU --> M[(MongoDB<br/>Mongoose 9)]
U --> M
end
C -- "fetch, credentials: include<br/>httpOnly session cookie" --> AU
C --> U
S[npm run seed] --> M
D -. same file .- S
GH[GitHub Actions] -->|vite build, deploy| GP[GitHub Pages]
GP --> A
- Client (
client/): the router lives inclient/src/App.jsx. It is built once per sign-in or sign-out (not on every render) and only after the session check finishes, so a signed-in deep link to/alumnidoes not bounce to login. All network calls go throughclient/src/lib/api.js, which swaps inlib/demo.jswhen the build runs with--mode demo. - Server (
server/):app.jsbuilds the Express app andserver.jsconnects to MongoDB before it listens. Auth routes are inroutes/auth.js, the directory inroutes/users.js. - Security: CORS allowlist from
CLIENT_ORIGINwith credentials, JSON bodies capped at 100 kB, login and signup limited to 20 attempts per 15 minutes per IP, the directory to 60 requests per minute and/meto 120. Login returns the same error for an unknown email and a wrong password. Search input is regex-escaped before it reaches MongoDB, and the directory never returns emails or password hashes. - Deploy:
.github/workflows/pages.ymlbuilds the client withBASE_PATH=/mca_nitw/, copiesindex.htmlto404.htmlso deep links work on Pages, and deploys it.render.yamldescribes the API for Render.
- Alumni Network -- Search alumni by name, batch, company or city, with a link to the full profile view
- Accounts -- Sign up, log in and stay signed in across reloads
- Student Directory -- Current student page (placeholder)
- Study Materials -- Academic resources page (placeholder)
- Placement Cell -- Placement coordination page (placeholder)
- CR Cell -- Class Representative page (placeholder)
- Light/Dark Mode -- Theme toggle for comfortable viewing
- Contact -- Team cards with LinkedIn, GitHub and Instagram links, plus a contact form
- Responsive Design -- Works on desktop and mobile devices
- Frontend: React 19, react-router 8, Vite 8, CSS Modules, Bootstrap 5, react-icons
- Backend: Node.js 24, Express 5 (ESM), Mongoose 9, MongoDB, bcryptjs, jsonwebtoken, cookie-parser, express-rate-limit
- Tooling: Prettier, Playwright (screenshots and the Open Graph card), GitHub Actions (format check, security scan, client build, server syntax check)
- Deployment: GitHub Pages (client), Render blueprint (API)
MUI is installed but not used in the code yet.
The client moved from Create React App 5 to Vite 8 in 1.6.0. Measured on the
same machine (Node 26.10, npm 11.20) on 2026-10-18, main before the move
against this branch:
| Client | CRA 5 (before) | Vite 8 (after) |
|---|---|---|
Installed packages (npm ls --all) |
1,354 | 133 |
npm audit advisories |
53 | 0 |
Warm npm run build |
15.2 to 17.6 s | 1.7 to 1.8 s |
--legacy-peer-deps needed |
yes | no |
| Main JS bundle, gzip | 97.48 kB | 107.94 kB |
The bundle grew because 1.6.0 also adds the auth flow, the API client and the bundled demo data.
| Page | Route | Description |
|---|---|---|
| Home | / |
Landing page |
| About | /about |
Department information |
| Contact | /contact |
Team cards and contact form |
| Students | /students |
Current student information |
| Authentication | /auth?mode=... |
Login and signup forms |
| Full Profile | /profile |
Detailed user profile view (members) |
| CR Cell | /crcell |
Class representative panel (members) |
| Placement Cell | /placementcell |
Placement activities (members) |
| Alumni | /alumni?q= |
Searchable alumni directory (members) |
| Study Material | /studymaterial |
Study resources by subject (members) |
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/health |
none | Liveness check ({ "ok": true }) |
| POST | /api/auth/signup |
none | Body name, email, password, batch? |
| POST | /api/auth/login |
none | Body email, password, sets cookie |
| POST | /api/auth/logout |
none | Clears the cookie, 204 |
| GET | /api/auth/me |
cookie | Current user, 401 when signed out |
| GET | /api/users?q= |
cookie | Up to 100 profiles, by newest batch |
mca_nitw/
├── client/ # React frontend (Vite)
│ ├── index.html # Vite entry, meta and Open Graph tags
│ ├── vite.config.js # base path and /api dev proxy
│ ├── public/ # logo.svg, favicon.svg, og.png
│ ├── scripts/ # screenshots.js, og-image.js (Playwright)
│ └── src/
│ ├── App.jsx # Router, session restore, member routes
│ ├── lib/ # api.js (server) and demo.js (demo mode)
│ ├── data/alumni.json # Demo and seed alumni profiles
│ ├── pages/
│ │ ├── home/ # Landing page
│ │ ├── about/ # Department info
│ │ ├── Alumni/ # Alumni directory, search and loader
│ │ ├── Authentication/ # Login/Signup forms and submit hook
│ │ ├── Students/ # Student listing
│ │ ├── StudyMaterial/ # Resources
│ │ ├── contact/ # Contact cards and form
│ │ ├── PlacementCell/ # Placement info
│ │ ├── CRCell/ # CR coordination
│ │ ├── Fullprofile/ # User profiles
│ │ └── Error/ # Error page
│ ├── components/
│ │ ├── navbar/ # Top navigation
│ │ ├── footer/ # Page footer
│ │ ├── sidenavbar/ # Side navigation (bottom bar on phones)
│ │ └── mode/ # Dark/light toggle
│ └── Layout/ # Auth navigation, fallbacks
├── server/
│ ├── app.js # Express app: CORS, JSON, routes, errors
│ ├── auth.js # JWT cookie helpers and requireAuth
│ ├── routes/ # auth.js, users.js
│ ├── models/User.js # User Mongoose schema
│ ├── seed.js # Load alumni.json and a demo account
│ └── server.js # Connect to MongoDB, then listen
├── docs/screenshots/ # README screenshots (npm run screenshots)
├── render.yaml # Render blueprint for the API
├── .github/workflows/ # CI and Pages deploy
├── package.json # Root orchestration scripts
└── .prettierrc # Code formatting
- Node.js 24 with its bundled npm (the versions CI uses)
- MongoDB (local or Atlas) for the backend. Without it, run the client in demo mode
git clone https://github.com/MCA-NITW/mca_nitw.git
cd mca_nitw
# Install root, client and server dependencies
npm install
npm run set-envThe backend reads these variables from server/.env (never commit it):
# local MongoDB or an Atlas connection string
CONNECTION_URL=mongodb://127.0.0.1:27017/mca_nitw
PORT=5000
# any long random string; signs the session cookies
JWT_SECRET=replace-with-a-long-random-string
# optional: comma-separated origins allowed to call the API
CLIENT_ORIGIN=http://localhost:3000
# optional: "none" when the client is on another site (needs HTTPS)
COOKIE_SAMESITE=lax
# optional, local only: npm run seed also creates demo@example.com with
# this password; pick your own (8+ characters) or leave it empty
SEED_DEMO_PASSWORD=# Load 10 sample alumni, plus demo@example.com when SEED_DEMO_PASSWORD is set
npm run seed
# Start both frontend and backend
npm run dev
# Backend only (node --watch)
npm run backend-start
# Frontend only
npm run frontend-start
# Frontend without a backend, on the bundled demo data
cd client
npx vite --mode demo
# Format code
npm run format| Service | URL |
|---|---|
| Frontend | http://localhost:3000 |
| Backend | http://localhost:5000/api/health |
In development the Vite server proxies /api to http://localhost:5000, so
the session cookie stays same-origin. Point it elsewhere with API_PROXY.
cd client
npx playwright install chromium # first run only
npm run screenshots # docs/screenshots/*.webp from the demo build
npm run og-image # public/og.png from public/logo.svg- Create a MongoDB Atlas cluster and copy its connection string.
- Click Deploy to Render above. Render reads
render.yaml, generatesJWT_SECRET, and asks forCONNECTION_URL. - Skip
npm run seedfor a real deployment. It writes the 10 fictional alumni, and withSEED_DEMO_PASSWORDset, ademo@example.comaccount. Only run it against a throwaway database. Signup is open and does not verify email, so "members only" means anyone who registers. - In the GitHub repo, add a repository variable
VITE_API_URLwith the Render URL (for examplehttps://mca-nitw-api.onrender.com) and re-run the Pages workflow. With the variable set, the site builds against the API instead of demo mode.
The Pages site (github.io) and the API (onrender.com) are different sites,
so the session cookie is a third-party cookie there. Browsers that block those
(Safari does by default) will not keep the session; serving the API from a
subdomain of the site's own domain avoids that.
Contributions from MCA-NITW members and external collaborators are welcome.
Branch from main, keep npm run format clean, and open a pull request to
main. See CONTRIBUTING.md.
This project is maintained by MCA-NITW, the GitHub organization for the MCA department at the National Institute of Technology, Warangal.
This project is licensed under the GNU General Public License v3.0.




