A fully developed backend repository for a School Management Information System (MIS) with database integration.
MIS Demo is a comprehensive RESTful API built with Express.js and MongoDB for managing educational institutions. The system provides complete CRUD operations for schools, levels, classes, students, teachers, and courses, with JWT authentication, request validation, and API documentation via Swagger UI.
The application follows the MVC (Model-View-Controller) pattern with a modular structure:
config/: Database and application configuration
// MongoDB connection, Swagger setup, environment configscontrollers/: Business logic for each entity
// Handles requests and responses for schools, students, teachers, etc.models/: MongoDB schemas with Mongoose
// Defines data structure for User, School, Level, Class, Student, Teacher, Courseroutes/: API endpoint definitions
// Maps HTTP methods to controller functionsmiddleware/: Authentication and validation
// JWT authentication, error handling, request validationvalidations/: Joi schemas for input validation
// Validates request data before processingfrontend/: Client interface for the API
<!-- User interface to interact with the backend -->- Authentication: JWT-based user authentication and authorization
- School Management: Create and manage educational institutions
- Academic Structure: Organize levels (Senior 4, 5, 6) and classes
- Student Management: Track student enrollment and information
- Teacher Management: Manage teaching staff and assignments
- Course Management: Define and organize curriculum courses
- API Documentation: Interactive Swagger UI for testing endpoints
When a client makes an API request:
- Request hits the appropriate route in the routes layer
- Middleware validates authentication (JWT token)
- Validation middleware checks request data with Joi schemas
- Controller processes the request and interacts with models
- Model performs database operations via Mongoose
- Response is formatted and sent back to the client
- Error handler catches any issues and returns appropriate error messages
- RESTful API Design: Clean, resource-based endpoints
- MVC Architecture: Separation of concerns across layers
- JWT Authentication: Secure token-based authentication
- Request Validation: Input sanitization with Joi
- Mongoose ODM: Schema-based MongoDB modeling
- Error Handling: Centralized error management
- API Documentation: Auto-generated Swagger docs
- Logging: Request logging with Morgan
- Clone the repository:
git clone https://github.com/achille010/mis-demo.git
cd mis-demo- Install dependencies:
npm install- Configure MongoDB:
# Make sure MongoDB is running on mongodb://localhost:27017
# Or update the connection string in config/default.json- Seed the database (optional):
npm run seed
# Creates default admin user:
# Username: admin
# Password: admin123
# Email: admin@school.com- Start the server:
# Development mode with nodemon
npm run dev
# Production mode
npm start- Access the application:
API: http://localhost:3000
Swagger UI: http://localhost:3000/api-docs
POST /api/v1/auth/login # User login
POST /api/v1/auth/logout # User logoutGET /api/v1/schools # Get all schools
GET /api/v1/schools/:id # Get school by ID
POST /api/v1/schools # Create school
PUT /api/v1/schools/:id # Update school
DELETE /api/v1/schools/:id # Delete schoolGET /api/v1/levels # Get all levels
GET /api/v1/levels/:id # Get level by ID
POST /api/v1/levels # Create level
PUT /api/v1/levels/:id # Update level
DELETE /api/v1/levels/:id # Delete levelSimilar CRUD endpoints available for each entity at /api/v1/{entity}
curl -X POST http://localhost:3000/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "admin123"}'curl -X POST http://localhost:3000/api/v1/schools \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token>" \
-d '{
"name": "Example High School",
"address": "123 Main St",
"email": "info@example.com",
"principalName": "John Doe"
}'curl http://localhost:3000/api/v1/students \
-H "Authorization: Bearer <your-token>"mis-demo/
├── config/ # Configuration files
├── controllers/ # Business logic
├── frontend/ # Client interface
├── middleware/ # Auth & validation
├── models/ # MongoDB schemas
├── routes/ # API endpoints
├── scripts/ # Utility scripts
├── validations/ # Joi schemas
├── server.js # Entry point
└── package.json # Dependencies
Most endpoints require JWT authentication. Include the token in your requests:
# Using Authorization header
Authorization: Bearer <your-token>
# Or using x-auth-token header
x-auth-token: <your-token>- Frontend is basic HTML/JS (could be upgraded to React)
- No email verification system
- Basic role management (admin only)
- No file upload functionality
- Limited reporting features
This is a demonstration project showcasing full-stack MIS architecture.
- Node.js 14 or higher
- MongoDB (local or remote)
- npm or yarn
- Upgrade frontend to React
- Add role-based access control (RBAC)
- Implement attendance tracking
- Add grade management system
- File upload for documents
- Email notifications
- Advanced reporting and analytics
Contributions are welcome! Feel free to fork this repository and submit pull requests for improvements.
ISC License - Read details from the LICENSE file
Built as a comprehensive School Management Information System demonstrating full-stack backend development