https://github.com/edsonwade/university-system
Student Management System
https://github.com/edsonwade/university-system
azure cucumber-java docker-compose hibernate-jpa maven mockito-junit postgresql spring springboot swagger-ui
Last synced: about 2 months ago
JSON representation
Student Management System
- Host: GitHub
- URL: https://github.com/edsonwade/university-system
- Owner: edsonwade
- License: mit
- Created: 2024-07-04T15:40:08.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-02-07T19:11:47.000Z (4 months ago)
- Last Synced: 2026-02-08T01:44:01.639Z (4 months ago)
- Topics: azure, cucumber-java, docker-compose, hibernate-jpa, maven, mockito-junit, postgresql, spring, springboot, swagger-ui
- Language: Java
- Homepage:
- Size: 3.42 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# University SaaS Blueprint
A comprehensive, production-ready microservices-based University Management System built with Spring Boot, Spring Cloud, and Domain-Driven Design (DDD) principles.
## ๐๏ธ Architecture Overview
This project implements a complete microservices architecture with:
- **9 Microservices** (User, Course, Grades, Billing, Library, Notification + Infrastructure)
- **Service Discovery** (Eureka)
- **API Gateway** (Spring Cloud Gateway)
- **Event-Driven Architecture** (Kafka)
- **Caching** (Redis)
- **Database Per Service** (PostgreSQL)
## ๐ Table of Contents
- [Features](#features)
- [Technology Stack](#technology-stack)
- [Architecture](#architecture)
- [Getting Started](#getting-started)
- [API Documentation](#api-documentation)
- [Deployment](#deployment)
- [Monitoring](#monitoring)
## Features โจ
### Core Services
#### 1. **User Management Service** (Port 8081)
- User registration and authentication
- JWT-based security
- Role-based access control
- Password encryption (BCrypt)
#### 2. **Course & Enrollment Service** (Port 8082)
- Course management (CRUD)
- Student enrollment
- Department-based filtering
- Instructor assignment
#### 3. **Grades Service** (Port 8083)
- Grade management for enrolled courses
- Multiple grade types (Assignment, Quiz, Midterm, Final, Project)
- Average grade calculation
- Grade history tracking
#### 4. **Billing & Payments Service** (Port 8084)
- Invoice generation
- Payment processing
- Multiple payment methods
- Payment history
- Invoice status tracking
#### 5. **Library Service** (Port 8085)
- Book catalog management
- Book borrowing and returns
- Search by title, author, category
- Availability tracking
#### 6. **Notification Service** (Port 8086)
- Email notifications
- SMS notifications (framework ready)
- Event-driven notifications via Kafka
- Notification history
### Infrastructure Services
#### 7. **Service Discovery** (Port 8761)
- Eureka Server for service registration
- Dynamic service discovery
- Health monitoring
#### 8. **API Gateway** (Port 8080)
- Single entry point for all services
- Request routing
- Load balancing
## ๐ ๏ธ Technology Stack
### Core Technologies
- **Java**: 17+
- **Spring Boot**: 3.2.3
- **Spring Cloud**: 2023.0.0
- **Maven**: 3.8+
### Frameworks & Libraries
- **Spring Data JPA**: Database access
- **Spring Security**: Authentication & Authorization
- **Spring Cloud Gateway**: API Gateway
- **Spring Cloud Netflix Eureka**: Service Discovery
- **Spring Kafka**: Event-driven messaging
- **Spring Mail**: Email notifications
- **JWT (jjwt)**: Token-based authentication
- **Lombok**: Reduce boilerplate code
- **PostgreSQL**: Relational database
- **Redis**: Caching layer
### Infrastructure
- **Docker**: Containerization
- **Docker Compose**: Multi-container orchestration
- **Kafka + Zookeeper**: Message broker
- **Redis**: In-memory cache
## ๐๏ธ Architecture
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ API Gateway (8080) โ
โ Single Entry Point for All Clients โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโ
โ โ
โโโโโโโโโผโโโโโโโโโ โโโโโโโโโผโโโโโโโโโ
โ Service โ โ Microservices โ
โ Discovery โโโโโโโโโค Register & โ
โ (Eureka:8761) โ โ Discover โ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโผโโโโโโโโโ โโโโโโโโโโโโผโโโโโโโโโโ โโโโโโโโโโโผโโโโโโโโโ
โ User Service โ โ Course Service โ โ Grades Service โ
โ (8081) โ โ (8082) โ โ (8083) โ
โ + user_db โ โ + course_db โ โ + grades_db โ
โโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโ
โ โ โ
โ โโโโโโโโโโโผโโโโโโโโโโโ โ
โ โ Kafka Broker โ โ
โโโโโโโโโโบโ Event Bus โโโโโโโโโโโโโโโโ
โโโโโโโโโโโฌโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโผโโโโโโโโ โโโโโโโโโโผโโโโโโโโโโโ โโโโโโโโโโผโโโโโโโโโ
โ Billing Svc โ โ Library Service โ โ Notification โ
โ (8084) โ โ (8085) โ โ Service (8086) โ
โ + billing_db โ โ + library_db โ โ + notif_db โ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโผโโโโโโโโโโโ
โ Redis Cache โ
โ (6379) โ
โโโโโโโโโโโโโโโโโโโโโโ
```
## ๐ Getting Started
### Prerequisites
- **Java 17+** installed
- **Maven 3.8+** installed
- **Docker** and **Docker Compose** installed
- **Git** installed
### Clone the Repository
```bash
git clone
cd university-saas
```
### Build the Project
```bash
mvn clean install -DskipTests
```
### Run with Docker Compose
```bash
docker-compose up --build
```
This will start:
- All 9 microservices
- 6 PostgreSQL databases
- Kafka + Zookeeper
- Redis
- Eureka Server
- API Gateway
### Access the Services
| Service | URL | Description |
| -------------------- | --------------------- | ---------------- |
| Eureka Dashboard | http://localhost:8761 | Service registry |
| API Gateway | http://localhost:8080 | Main entry point |
| User Service | http://localhost:8081 | Direct access |
| Course Service | http://localhost:8082 | Direct access |
| Grades Service | http://localhost:8083 | Direct access |
| Billing Service | http://localhost:8084 | Direct access |
| Library Service | http://localhost:8085 | Direct access |
| Notification Service | http://localhost:8086 | Direct access |
## ๐ API Documentation
### User Service APIs
#### Register User
```http
POST /api/users
Content-Type: application/json
{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@university.edu",
"password": "SecurePass123"
}
```
#### Login
```http
POST /api/auth/login
Content-Type: application/json
{
"email": "john.doe@university.edu",
"password": "SecurePass123"
}
Response:
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": { ... }
}
}
```
### Course Service APIs
#### Create Course
```http
POST /api/courses
Authorization: Bearer
Content-Type: application/json
{
"title": "Introduction to Computer Science",
"description": "Fundamentals of programming",
"credits": 3,
"department": "Computer Science",
"instructorId": 1
}
```
#### Enroll Student
```http
POST /api/enrollments
Authorization: Bearer
Content-Type: application/json
{
"courseId": 1,
"studentId": 2
}
```
### Grades Service APIs
#### Submit Grade
```http
POST /api/grades
Authorization: Bearer
Content-Type: application/json
{
"enrollmentId": 1,
"studentId": 2,
"courseId": 1,
"score": 95.5,
"maxScore": 100,
"gradeType": "MIDTERM",
"comments": "Excellent work"
}
```
### Billing Service APIs
#### Create Invoice
```http
POST /api/invoices
Authorization: Bearer
Content-Type: application/json
{
"studentId": 2,
"dueDate": "2024-12-31",
"items": [
{
"description": "Tuition Fee - Fall 2024",
"quantity": 1,
"unitPrice": 5000.00
}
]
}
```
#### Process Payment
```http
POST /api/payments
Authorization: Bearer
Content-Type: application/json
{
"invoiceId": 1,
"studentId": 2,
"amount": 5000.00,
"paymentMethod": "CREDIT_CARD"
}
```
### Library Service APIs
#### Add Book
```http
POST /api/books
Authorization: Bearer
Content-Type: application/json
{
"isbn": "978-0-13-468599-1",
"title": "Clean Code",
"author": "Robert C. Martin",
"category": "Software Engineering",
"totalCopies": 5
}
```
#### Borrow Book
```http
POST /api/borrow-records
Authorization: Bearer
Content-Type: application/json
{
"bookId": 1,
"userId": 2,
"dueDate": "2024-12-31"
}
```
## ๐ณ Deployment
### Docker Compose Deployment
1. **Build all services:**
```bash
mvn clean package -DskipTests
```
2. **Start all services:**
```bash
docker-compose up -d
```
3. **View logs:**
```bash
docker-compose logs -f
```
4. **Stop all services:**
```bash
docker-compose down
```
### Production Deployment
For production deployment, consider:
1. **Use environment-specific profiles:**
- Create `application-prod.yml` for each service
- Set `SPRING_PROFILES_ACTIVE=prod`
2. **Externalize configuration:**
- Use Spring Cloud Config Server
- Store secrets in HashiCorp Vault or AWS Secrets Manager
3. **Use managed services:**
- AWS RDS for PostgreSQL
- AWS MSK for Kafka
- AWS ElastiCache for Redis
4. **Implement monitoring:**
- Add Prometheus metrics
- Set up Grafana dashboards
- Configure ELK stack for logging
## ๐ Monitoring
### Health Checks
Each service exposes health endpoints:
```http
GET /actuator/health
```
### Eureka Dashboard
Monitor all registered services at:
```
http://localhost:8761
```
## ๐ Security
- **JWT Authentication**: All protected endpoints require valid JWT tokens
- **Password Encryption**: BCrypt hashing for user passwords
- **HTTPS**: Configure SSL/TLS for production
- **API Rate Limiting**: Implement using Spring Cloud Gateway filters
## ๐งช Testing
### Run Unit Tests
```bash
mvn test
```
### Run Integration Tests
```bash
mvn verify
```
## ๐ Project Structure
```
university-saas/
โโโ shared-kernel/ # Common utilities and base classes
โโโ service-discovery/ # Eureka Server
โโโ api-gateway/ # Spring Cloud Gateway
โโโ user-service/ # User management
โโโ course-service/ # Course and enrollment
โโโ grades-service/ # Grades management
โโโ billing-service/ # Billing and payments
โโโ library-service/ # Library management
โโโ notification-service/ # Notifications (Email/SMS)
โโโ docker-compose.yml # Docker orchestration
โโโ pom.xml # Parent POM
```
## ๐ค Contributing
1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request
## ๐ฅ Authors
- **edsonwade** - Initial work
## ๐ Acknowledgments
- Spring Boot team for excellent documentation
- Domain-Driven Design community
- Microservices patterns community
---
**Built with โค๏ธ using Spring Boot and Microservices Architecture**
## License โ๏ธ
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).