Central Institute of Information Technology and Management (CIITM) Backend API - A comprehensive educational institute management system built with modern web technologies.
- Google OAuth2 Integration - Seamless login with Google accounts
- JWT Token Authentication - Secure token-based authentication
- Role-based Access Control - Admin, Teacher, and Student roles
- Password Reset & Recovery - Forgot password functionality
- Student Management - Complete student profile and academic records
- Teacher Management - Faculty profiles and course assignments
- Admin Dashboard - Administrative controls and system management
- Profile Management - User profile updates and customization
- Course Management - Create, update, and manage courses
- Student Admissions - Online admission process and tracking
- Fee Management - Student fee tracking and payment processing
- Notice Board - Announcements and important notifications
- Razorpay Integration - Secure online payment processing
- Fee Payment Tracking - Comprehensive payment history
- Order Management - Payment order creation and verification
- Socket.io Integration - Real-time notifications and updates
- Live Chat Support - Instant communication system
- Real-time Dashboard - Live data updates without refresh
- Cloudinary Integration - Cloud-based image and file storage
- Album Management - Photo galleries and media collections
- File Upload System - Secure file upload with validation
- Image Optimization - Automatic image compression and optimization
- Email System - Automated email notifications
- Contact Forms - Student and visitor inquiry management
- Newsletter System - Bulk email communication
- Social Media Integration - Social platform connections
- Rate Limiting - API request throttling
- CORS Protection - Cross-origin resource sharing security
- Input Validation - Joi schema validation
- Error Handling - Comprehensive error management
- Logging System - Request and error logging with Pino
- Node.js - JavaScript runtime environment
- Express.js - Web application framework
- ES6 Modules - Modern JavaScript module system
- MongoDB - NoSQL document database
- Mongoose - MongoDB object modeling
- JWT - JSON Web Tokens
- Google OAuth2 - Third-party authentication
- bcryptjs - Password hashing
- Socket.io - WebSocket implementation
- HTTP/HTTPS Server - Dual protocol support
- Razorpay - Indian payment gateway
- Stripe Ready - International payment support
- Cloudinary - Cloud media management
- Multer - File upload middleware
- Nodemailer - Email sending capability
- Gmail Integration - SMTP configuration
- ESLint - Code linting
- Prettier - Code formatting
- Jest - Testing framework
- Nodemon - Development auto-restart
- Babel - JavaScript compiler
- TailwindCSS - Utility-first CSS framework
- Swagger - API documentation
- CRON Jobs - Scheduled task execution
- Pino Logger - High-performance logging
src/
βββ api/v1/ # API version 1 endpoints
β βββ Admission/ # Student admission management
β βββ Album/ # Photo album functionality
β βββ Auth/ # Authentication endpoints
β βββ Contact/ # Contact form handling
β βββ Course/ # Course management
β βββ Dashboard/ # Dashboard data endpoints
β βββ Email/ # Email templates and sending
β βββ Fee/ # Fee management system
β βββ Image/ # Image upload and management
β βββ Notice/ # Notice board system
β βββ Role/ # User role management
β βββ Student/ # Student profile management
β βββ Teacher/ # Teacher management
β βββ frontend/ # Frontend data endpoints
βββ config/ # Configuration files
β βββ Db.config.mjs # Database configuration
β βββ Socket/ # Socket.io configuration
βββ constant/ # Application constants
βββ controllers/ # Business logic controllers
βββ middleware/ # Custom middleware functions
βββ models/ # Database models
βββ OAuth2Client/ # OAuth2 configuration
βββ routes/ # API route definitions
βββ script/ # Utility scripts
βββ Service/ # Business service layer
βββ template/ # Email templates
βββ utils/ # Utility functions
βββ validation/ # Input validation schemas
- Node.js (version 18.x or higher)
- npm or pnpm (package manager)
- MongoDB (version 6.x or higher)
- VS Code (recommended IDE)
git clone <repository-url>
cd Ciitm-Backend
Using npm:
npm install
Using pnpm (recommended):
pnpm install
Create a .env
file in the root directory:
# Server Configuration
PORT=8000
NODE_ENV=development
isDevelopment=true
FRONTEND_URL=http://localhost:5173
# Database
MONGO_URL=mongodb://localhost:27017/ciitm_db
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key
JWT_EXPIRES_IN=7d
JWT_COOKIE_EXPIRES_IN=7
# Email Configuration
GMAIL_User=[email protected]
GMAIL_Password=your_app_password
# Cloudinary Configuration
Cloudinary_Cloud_Name=your_cloud_name
Cloudinary_API_Key=your_api_key
Cloudinary_API_Secret=your_api_secret
# Payment Gateway
Razorpay_key=your_razorpay_key_id
Razorpay_secret=your_razorpay_secret
Windows:
net start MongoDB
Linux/macOS:
sudo service mongod start
# or
brew services start mongodb-community
npm run genKey
Development Mode:
npm run start:dev
Production Mode:
npm start
Script | Description |
---|---|
pnpm start |
Start the production server |
pnpm run start:dev |
Start development server with auto-reload |
pnpm run lint |
Run ESLint for code quality |
pnpm run format |
Format code with Prettier |
pnpm run format:check |
Check code formatting |
pnpm run genKey |
Generate SSL certificates |
pnpm run tailwind:build |
Build Tailwind CSS |
pnpm test |
Run Jest tests |
pnpm run test:watch |
Run tests in watch mode |
POST /api/v1/auth/login
- User loginPOST /api/v1/auth/Admin/SignUp
- Admin registrationGET /api/auth/google/failure
- Google OAuth failure handlerPOST /api/forgot/password
- Password reset requestPOST /api/reset/password
- Password reset confirmation
POST /api/v1/role/create
- Create admin role (Admin only)GET /api/v1/status/find
- Find student statusPUT /api/v1/status/update/:uniqueId
- Update student status (Admin only)
GET /api/find/StudentBy
- Find students by course and semesterPOST /api/v1/online/admission
- Online student admission (with avatar upload)
POST /api/v1/admin/course/create
- Create new course (Admin only)GET /api/v1/user/findAllCourse
- Get all coursesGET /api/v1/user/findCourseById/:id
- Get course by ID
POST /api/v1/admin/teacher/create
- Create new teacher (Admin only)GET /api/v1/user/findAllTeachers
- Get all teachers
POST /api/v1/notice/create
- Create notice (Admin only, with document upload)GET /api/v1/notice/find
- Get all notices
POST /api/v1/contact/create
- Submit contact formGET /api/v1/contact/admin/getContact
- Get contact submissions (Admin only)DELETE /api/v1/contact/admin/deleteContact/:id
- Delete contact submission (Admin only)
POST /api/v1/admin/create/album
- Create photo album (Admin only, with image upload)GET /api/v1/user/get/album
- Get all albumsDELETE /api/v1/admin/delete/album/:albumId
- Delete album (Admin only)
POST /api/v1/admin/create/image
- Upload image to album (Admin only)GET /api/v1/user/get/Album/Image/:Album__Name
- Get images by album nameGET /api/v1/user/get/All/Image
- Get all images
GET /api/v1/frontend
- Get frontend configuration data
GET /api/link
- Get social media linksPOST /api/create/testimonial
- Create testimonial (with image upload)GET /api/find/testimonial
- Get all testimonialsDELETE /api/delete/testimonial/:id
- Delete testimonial
- Base URL: All API endpoints are prefixed with
/api
- Version: Most endpoints use
/v1/
versioning - Authentication: Admin-only endpoints require JWT token authentication
- File Uploads: Many endpoints support file uploads using multipart/form-data
- CORS: Configured for specific frontend origins
- Admin Only: Endpoints marked with "(Admin only)" require admin authentication
- Public: Endpoints without authentication markers are publicly accessible
- Token: JWT tokens can be passed via cookies or Authorization header
Note: Some payment and fee management endpoints may be commented out in the current version. Check the codebase for the latest payment integration status.
Run the test suite:
pnpm test
Run tests in watch mode:
pnpm run test:watch
- CORS Protection - Configured for specific origins
- Rate Limiting - Prevents API abuse
- JWT Authentication - Secure token-based auth
- Input Validation - Joi schema validation
- Password Hashing - bcryptjs encryption
- HTTPS Ready - SSL certificate generation
- Pino Logger - High-performance logging
- Request Logging - All API requests logged
- Error Tracking - Comprehensive error logging
- Performance Monitoring - Response time tracking
- Set
NODE_ENV=production
- Configure production MongoDB URI
- Set up Cloudinary for file storage
- Configure email service
- Set up payment gateway credentials
- Environment variables configured
- Database connection established
- SSL certificates generated
- Payment gateway tested
- Email service configured
- Cloudinary storage setup
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you find this project helpful, please consider supporting it:
- β Star this repository
- π Report bugs and issues
- π‘ Suggest new features
- β Buy me a coffee
For any queries or support, please mail [email protected]
This project is maintained by abhishek-nexgen-dev
You can also:
- π§ Send direct email for technical support
- π Create an issue in this repository for bug reports
- π‘ Submit feature requests via GitHub issues
- π Reach out through the contact form on our website
Built with β€οΈ for the future of education technology in India