A comprehensive microservices-based college management system built with Spring Boot and Spring Cloud.
CAMS follows a microservices architecture pattern with the following services:
- Service Discovery - Eureka Server for service registration and discovery
- API Gateway - Central entry point with authentication and routing
- Auth Service - Authentication and authorization management
- User Service - User management and profiles
- Course Service - Course and enrollment management
- Grade Service - Assessment and grading system
- Resource Service - File and resource management
- Communication Service - Announcements, notifications, and tickets
- Java 21
- Maven 3.8+
- MariaDB 10.5+
- Node.js 18+ (for frontend)
Create the following databases in MariaDB:
CREATE DATABASE auth_db;
CREATE DATABASE user_db;
CREATE DATABASE course_db;
CREATE DATABASE grade_db;
CREATE DATABASE resource_db;
CREATE DATABASE communication_db;Set the following environment variables:
export JWT_SECRET=your-jwt-secret-key
export JWT_EXPIRATION=86400000- Start Service Discovery (Port: 8761)
cd service-discovery
mvn spring-boot:run- Start API Gateway (Port: 8760)
cd api-gateway
mvn spring-boot:run- Start Individual Services
# Auth Service (Port: 8762)
cd auth-service && mvn spring-boot:run
# User Service (Port: 8763)
cd user-service && mvn spring-boot:run
# Course Service (Port: 8764)
cd course-service && mvn spring-boot:run
# Communication Service (Port: 8765)
cd communication-service && mvn spring-boot:run
# Grade Service (Port: 8766)
cd grade-service && mvn spring-boot:run
# Resource Service (Port: 8767)
cd resource-service && mvn spring-boot:run| Service | Port | Purpose |
|---|---|---|
| Service Discovery | 8761 | Eureka Server |
| API Gateway | 8760 | Main entry point |
| Auth Service | 8762 | Authentication |
| User Service | 8763 | User management |
| Course Service | 8764 | Course management |
| Communication Service | 8765 | Communication features |
| Grade Service | 8766 | Grading system |
| Resource Service | 8767 | File management |
All API requests (except auth endpoints) require JWT authentication:
Authorization: Bearer <jwt-token>The API Gateway automatically validates tokens and forwards user information via headers:
X-User-Id: User IDX-User-Role: User role (STUDENT, LECTURER, ADMIN, SUPER_ADMIN)X-User-Department: Department code
Each service has its own README with detailed API documentation:
mvn clean installmvn testThe project follows standard Java conventions with:
- Lombok for reducing boilerplate
- Spring Boot best practices
- RESTful API design
- Comprehensive error handling
Each service uses MariaDB with the following pattern:
spring:
datasource:
url: jdbc:mariadb://localhost:3306/{service}_db
username: root
password: $904380
driver-class-name: org.mariadb.jdbc.DriverAll services register with Eureka:
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka/cams-backend/
├── api-gateway/ # API Gateway service
├── auth-service/ # Authentication service
├── communication-service/ # Communication features
├── course-service/ # Course management
├── grade-service/ # Grading system
├── resource-service/ # File management
├── service-discovery/ # Eureka server
├── user-service/ # User management
└── pom.xml # Parent POM
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License.