A robust Node.js + Express + MongoDB backend for managing student teams, faculty, and problem statements with JWT-based authentication and role-based access control.
- Backend Framework: Express.js
- Database: MongoDB (Mongoose ODM)
- Authentication: JWT (JSON Web Token)
- Documentation: Swagger (OpenAPI 3.0)
- Security: Bcrypt + CORS + Role-based middleware
SPMS/
├── config/
│ └── db.js
├── controllers/
│ ├── adminController.js
│ ├── authController.js
│ ├── facultyController.js
│ ├── studentController.js
│ ├── teamController.js
│ └── psController.js
├── middleware/
│ └── authMiddleware.js
├── models/
│ ├── Admin.js
│ ├── Faculty.js
│ ├── ProblemStatement.js
│ ├── Team.js
│ └── User.js
├── routes/
│ ├── adminRoutes.js
│ ├── authRoutes.js
│ ├── facultyRoutes.js
│ ├── studentRoutes.js
│ ├── teamRoutes.js
│ └── psRoutes.js
├── swagger.yaml
├── server.js
└── .env
git clone <GITURL>
cd spms-backendnpm installCreate a .env file:
PORT=5000
MONGO_URI=mongodb://127.0.0.1:27017/spms_db
JWT_SECRET=yourSecretKey
NODE_ENV=developmentnpm run devRuns on: http://localhost:5000
Base URL → http://localhost:5000/api/spms/v1
| Role | Route Prefix | Description |
|---|---|---|
| Auth | /auth |
Register & Login |
| Admin | /admin |
Manage faculty, teams, problem statements |
| Faculty | /faculty |
Create and manage PS |
| Student | /students |
View and choose PS |
| Teams | /teams |
Manage student teams |
| PS | /ps |
Problem statement endpoints |
POST /api/spms/v1/auth/register
{
"name": "Tharvesh",
"email": "tharvesh@college.edu",
"password": "123456",
"role": "student",
"batch": "A"
}POST /api/spms/v1/auth/login
{
"email": "tharvesh@college.edu",
"password": "123456"
}Response:
{
"token": "<JWT_TOKEN>",
"role": "student"
}POST /api/spms/v1/ps
{
"title": "IoT Smart Soil Monitor",
"description": "Sensor-based soil health analysis.",
"allowedBatches": ["A", "B"],
"academicYear": "2025-2026"
}Header: Authorization: Bearer <token>
Access detailed API documentation here: 👉 http://localhost:5000/api/docs
- Teams can have 1–4 members.
- Faculty can manage max 2 batches per Problem Statement.
- Students can select only one PS per academic year.
- Admin can create faculty accounts and manage all data.
Founder / Developer: Tharvesh Muhaideen A
Organization: TM Nexus
Tagline: "Dreams turn into ideas, ideas grow into projects, and projects evolve into solutions."
- Admin analytics dashboard
- PS–Team–Faculty linking report (PDF export)
- Cloud upload for documents (Google Drive / Cloudinary)
- Role-based frontend dashboard API