A comprehensive, production-ready web application for student enrollment management with integrated payment gateways, built using the MERN stack (MongoDB, Express.js, React.js, Node.js).
- π― Overview
- β¨ Features
- π οΈ Tech Stack
- π Quick Start
- π Documentation
- π§ Development
- π§ͺ Testing
- π’ Deployment
- π€ Contributing
- π License
The Students Online Enrollment System is a modern, scalable web application designed to streamline the student enrollment process for educational institutions. It provides a complete solution for course management, student registration, secure payment processing, and administrative oversight.
- Production-Ready: Fully configured CI/CD pipeline with automated testing and deployment
- Secure: JWT authentication, helmet security, rate limiting, and comprehensive input validation
- Scalable: Microservices-ready architecture with Docker containerization
- User-Friendly: Responsive design with Material-UI components
- Payment Integration: Multiple payment gateways (Stripe, SSLCommerz)
- Email System: Automated notifications with Gmail OAuth 2.0
- User Management: Registration, authentication, and profile management
- Course Discovery: Browse and search available courses with detailed information
- Enrollment Process: Simple, secure course enrollment with payment integration
- Dashboard: Personal dashboard with enrollment history and progress tracking
- Course Materials: Access to enrolled course materials and resources
- Payment History: Complete transaction history and receipt management
- Course Management: Complete CRUD operations for courses and materials
- Student Management: User management and enrollment oversight
- Payment Tracking: Comprehensive payment and transaction management
- Analytics Dashboard: Detailed insights and reporting
- Email Notifications: Automated email system for various events
- System Monitoring: Health checks and performance metrics
- Authentication: JWT-based authentication with refresh tokens
- Authorization: Role-based access control (Student, Admin)
- Security Headers: Helmet.js for security headers
- Rate Limiting: API rate limiting to prevent abuse
- Input Validation: Comprehensive validation using express-validator
- Data Encryption: Password hashing with bcryptjs
- React.js 18.2.0 - Modern UI library
- Material-UI (MUI) 5.14 - Component library
- React Router 6.17 - Client-side routing
- Axios - HTTP client
- React Testing Library - Testing framework
- Node.js 18.x - Runtime environment
- Express.js 4.18 - Web framework
- MongoDB 6.0 - NoSQL database
- Mongoose 7.5 - ODM for MongoDB
- JWT - Authentication
- Stripe & SSLCommerz - Payment gateways
- Docker - Containerization
- GitHub Actions - CI/CD pipeline
- Render - Backend hosting
- GitHub Pages - Frontend hosting
- MongoDB Atlas - Database hosting
- Jest - Testing framework
- ESLint & Prettier - Code quality
- Nodemon - Development server
- Concurrently - Run multiple commands
Ensure you have the following installed:
- Node.js (v18.0.0 or higher)
- Bun (v1.0.0 or higher) - Install Bun
- MongoDB (v6.0 or higher) or MongoDB Atlas account
- Git
-
Clone the repository
git clone https://github.com/your-username/students-enrolment.git cd students-enrolment -
Install dependencies
bun install
cd client && bun install && cd ..
3. **Environment setup**
```bash
# Copy environment template
cp env.example .env
# Edit .env file with your configuration
nano .env
-
Database setup
# Run migrations bun run migrate # Seed initial data (optional) node seed-simple.js
-
Create admin user
# Interactive admin creation node create-admin-interactive.js -
Start the application
# Development mode (both frontend and backend) bun run dev # Or run separately bun run server # Backend only (http://localhost:5001)
bun run client # Frontend only (http://localhost:3000)
7. **Verify installation**
- Backend health check: http://localhost:5001/api/health
- Frontend application: http://localhost:3000
## π Documentation
### π Core Documentation
- [**API Documentation**](docs/API.md) - Complete API reference
- [**Database Schema**](docs/DATABASE.md) - Database design and models
- [**Architecture Guide**](docs/ARCHITECTURE.md) - System architecture overview
### π§ Development Documentation
- [**Development Guide**](docs/DEVELOPMENT.md) - Local development setup
- [**Testing Guide**](docs/TESTING.md) - Testing strategies and guidelines
- [**Contributing Guide**](CONTRIBUTING.md) - How to contribute to the project
### π’ Deployment & Operations
- [**Deployment Guide**](docs/deployment/README.md) - Production deployment instructions
- [**GitHub Secrets Guide**](docs/GITHUB_SECRETS_GUIDE.md) - Required environment variables
### π§ Setup & Configuration
- [**Gmail OAuth Setup**](docs/GMAIL_OAUTH_SETUP.md) - Email configuration
- [**Payment Testing**](docs/PAYMENT_TESTING.md) - Payment gateway testing
- [**Migration Guide**](docs/MIGRATIONS.md) - Database migrations
## π§ Development
### Available Scripts
```bash
# Development
bun run dev # Start both frontend and backend
bun run server # Start backend only
bun run client # Start frontend only
# Testing
bun run test:backend # Run backend tests
bun run test:frontend # Run frontend tests
bun run test:all # Run all tests
bun run test:coverage # Generate coverage report
# Code Quality
bun run lint # Run ESLint
bun run lint:fix # Fix ESLint issues
bun run format # Format code with Prettier
bun run format:check # Check code formatting
# Database
bun run migrate # Run database migrations
bun run migrate:status # Check migration status
bun run migrate:rollback # Rollback last migration
# Build & Deployment
bun run build # Build frontend for production
bun run start # Start production server
students-enrolment/
βββ π client/ # React frontend
β βββ π public/ # Static assets
β β βββ π components/ # Reusable components
β β βββ π pages/ # Page components
β β βββ π context/ # React context
β β βββ π App.js # Main app component
β βββ π package.json
βββ π server/ # Node.js backend
β βββ π middleware/ # Custom middleware
β βββ π models/ # Mongoose models
β βββ π routes/ # API routes
β βββ π utils/ # Utility functions
βββ π tests/ # Test suites
βββ π docs/ # Documentation
βββ π migrations/ # Database migrations
βββ π .github/workflows/ # CI/CD workflows
βββ π server.js # Express server
βββ π docker-compose.yml # Docker configuration
βββ π package.json # Backend dependencies
- Backend: 120 tests (110 passed, 10 skipped)
- Test Suites: 7 comprehensive test suites
- Coverage: High coverage across all modules
# Quick testing
./quick-ci-test.sh all
# Local CI simulation with act
./test-ci-local.sh
# Manual testing
bun run test:backend
bun run test:frontend
bun run test:coverage- Unit Tests: Individual function and component testing
- Integration Tests: API endpoint testing
- Security Tests: Authentication and authorization testing
- Performance Tests: Load and stress testing
-
Docker Deployment
docker-compose up -d
-
Cloud Deployment
- Backend: Render, Heroku, Railway
- Frontend: GitHub Pages, Netlify, Vercel
- Database: MongoDB Atlas
-
CI/CD Pipeline
- Automatic deployment on branch push
- Branch-based environments (develop β staging, main β production)
Required environment variables for production:
NODE_ENV=production
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
STRIPE_SECRET_KEY=your_stripe_secret_key
EMAIL_USER=your_gmail_address
GMAIL_CLIENT_ID=your_gmail_client_id
# ... see .env.example for complete listWe welcome contributions! Please see our Contributing Guide for details.
This project follows a Git Flow strategy with branch protection rules:
main- Production-ready code, protected branchdevelop- Integration branch for features, staging environmentfeature/*- Feature development branchesfix/*- Bug fix brancheshotfix/*- Emergency fixes for production
- Direct pushes to
mainare prohibited - Only
developbranch can create PRs tomain - All PRs require at least 1 approving review
- Status checks must pass before merging
- Branch must be up-to-date before merging
- Feature Development: Create feature branches from
develop - Integration: Merge feature branches into
develop - Testing:
developbranch triggers staging deployment - Production: Create PR from
developtomainfor production deployment - Hotfixes: Create hotfix branches from
main, merge to bothmainanddevelop
- Fork the repository
- Create a feature branch from
develop(git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
bun run test:all) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request to
developbranch - After review and merge to
develop, create PR fromdeveloptomain
- Follow ESLint and Prettier configurations
- Write comprehensive tests for new features
- Maintain test coverage above 80%
- Follow conventional commit messages
- Use semantic versioning for releases
- Documentation: Check the docs folder
- Issues: GitHub Issues
- Discussions: GitHub Discussions
This project is licensed under the MIT License - see the LICENSE file for details.