A comprehensive university course management system API built with NestJS, TypeScript, and PostgreSQL. This backend provides robust functionality for managing academic departments, courses, schedules, users, and administrative operations.
CourseFlow is designed to streamline university course management with features including user authentication, role-based access control, course scheduling, department management, and administrative oversight. The system supports both students and administrative staff with appropriate access levels and functionality.
- User Management: Registration, authentication, and role-based access control
- Department Management: CRUD operations for academic departments
- Course Management: Comprehensive course administration with level-based organization
- Schedule Management: Class scheduling with conflict detection and venue management
- Complaint System: Administrative complaint handling and resolution
- Bulk Operations: CSV import/export functionality for efficient data management
- Health Monitoring: Comprehensive health checks for production deployment
- API Documentation: Auto-generated Swagger documentation
The application follows clean architecture principles with:
- Modular Design: Feature-based modules with clear separation of concerns
- Repository Pattern: Database abstraction layer for maintainable data access
- Decorator Pattern: Reusable API decorators for consistent documentation
- Guard System: JWT authentication and role-based authorization
- Validation Layer: Input validation with custom DTOs and pipes
- Error Handling: Centralized error handling with appropriate HTTP responses
For detailed information about specific modules and their endpoints:
- Authentication Module - User authentication and authorization
- Users Module - User management and profiles
- Departments Module - Department administration
- Courses Module - Course management and operations
- Schedules Module - Class scheduling and timetables
- Complaints Module - Administrative complaint system
- Health Module - Application health monitoring
- Node.js 18+
- PostgreSQL 12+
- npm or yarn
# Clone the repository
git clone <repository-url>
cd courseflow-backend
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your database credentials and JWT secret
# Run database migrations
npx prisma migrate dev
npx prisma db seed# Start in development mode
npm run start:dev
# Build for production
npm run build
# Start production server
npm run start:prod# Run unit tests
npm run test
# Run e2e tests
npm run test:e2e
# Generate test coverage
npm run test:covOnce the application is running, comprehensive API documentation is available via Swagger UI:
- Local Development:
http://localhost:3000/api/v1/docs - Production:
https://your-domain.com/api/v1/docs
The documentation includes:
- Interactive endpoint testing
- Request/response schemas
- Authentication requirements
- Example payloads
The application includes comprehensive health check endpoints:
GET /api/v1/health- Full system health checkGET /api/v1/health/simple- Basic application statusGET /api/v1/health/database- Database connectivity checkGET /api/v1/health/readiness- Kubernetes readiness probeGET /api/v1/health/liveness- Kubernetes liveness probe
For production deployment instructions, see DEPLOYMENT.md. The application supports deployment on:
- Railway (recommended for students)
- Render
- Vercel + PlanetScale
- Docker containers
- Kubernetes clusters
Key environment variables:
DATABASE_URL=postgresql://username:password@localhost:5432/courseflow
JWT_SECRET=your-secure-jwt-secret
NODE_ENV=production
PORT=3000
RATE_LIMIT_TTL=60
RATE_LIMIT_MAX=100See .env.example for complete configuration options.
- Framework: NestJS with TypeScript
- Database: PostgreSQL with Prisma ORM
- Authentication: JWT with Passport
- Validation: class-validator and class-transformer
- Documentation: Swagger/OpenAPI
- Security: Rate limiting, CORS, input validation
- Testing: Jest for unit and integration tests
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License.