SitMe is a Spring Boot application for managing workspace reservations, built with modern Java technologies and containerized with Docker.
- π Features
- π οΈ Tech Stack
- π Prerequisites
- ποΈ Project Structure
- βοΈ Configuration
- π Getting Started
- π§ͺ Testing
- π API Documentation
- π§ Key Features
- π³ Docker Support
- π CI/CD Pipeline
- π API Usage Examples
- π€ Contributing
- π©βπ» Team
- π License
- π Support
- User Management: Registration, authentication, and profile management with JWT tokens
- Space Management: Create and manage different types of workspaces (rooms and tables)
- Reservation System: Book spaces for different time slots (morning, afternoon, full day)
- Image Upload: Profile and space images via Cloudinary integration
- Email Notifications: Automated registration confirmation emails
- Role-based Security: Admin and user roles with different permissions
- RESTful API: Comprehensive REST endpoints with Swagger documentation
- Database Integration: MySQL with JPA/Hibernate
- Health Checks: Actuator endpoints to monitor application status
- Containerization: Full Docker support with multi-stage builds
- Container Orchestration: Kubernetes for deploying and managing the application in a scalable way.
- Deployment Manifests: YAML files for Deployments, Services, ConfigMaps, and Kustomizations.
- Backend: Java 21, Spring Boot 3.5.5
- Database: MySQL 8.0
- Security: Spring Security with JWT authentication
- Image Storage: Cloudinary
- Email: Spring Mail (configured for MailHog in development)
- Testing: JUnit, Mockito
- API Documentation: Swagger/OpenAPI 3
- Containerization: Docker
- Build Tool: Maven
- CI: GitHub Actions
- CD: Kubernetes
- Java 21
- Maven 3.9+
- Docker
- MySQL 8.0 (if running locally without Docker)
src/
βββ main/java/com/femcoders/sitme/
β βββ cloudinary/ # Image upload service
β βββ config/ # CORS and Swagger configurations
β βββ email/ # Email notifications
β βββ reservation/ # Reservation management
β βββ security/ # JWT security configuration
β βββ shared/ # Common utilities and exceptions
β βββ space/ # Workspace management
β βββ user/ # User management and authentication
βββ main/resources/
βββ templates/ # Thymeleaf templates
βββ application.properties
βββ data.sql # Initial data setup
Create a .env
file in the project root:
# Database Configuration
DB_URL=jdbc:mysql://localhost:3306/sitme
DB_USERNAME=your_db_username
DB_PASSWORD=your_db_password
# JWT Configuration
JWT_SECRET_KEY=your_jwt_secret_key
JWT_EXPIRATION=1800000
# Server Configuration
SERVER_PORT=8080
# MailHog Configuration
spring.mail.host=localhost
spring.mail.port=1025
spring.mail.username=
spring.mail.password=
spring.mail.properties.mail.smtp.auth=false
spring.mail.properties.mail.smtp.starttls.enable=false
# Cloudinary Configuration (for image uploads)
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_KEY=your_cloudinary_api_key
CLOUDINARY_SECRET=your_cloudinary_secret
-
Clone the repository:
git clone https://github.com/femcoders-sitme/sitme.git cd sitme
-
Start the application:
docker-compose up -d
-
Access the application:
- API: http://localhost:8081
- Database: localhost:3307
- Swagger Documentation: http://localhost:8081/swagger-ui.html
-
Install dependencies:
mvn clean install
-
Run the application:
mvn spring-boot:run
-
Access the application:
- API: http://localhost:8080
- Swagger Documentation: http://localhost:8080/swagger-ui.html
mvn test
docker-compose -f docker-compose-test.yml up --abort-on-container-exit
The test suite includes:
- Unit tests for all service layers using Mockito
- Integration tests for REST endpoints
POST /api/auth/register
- User registrationPOST /api/auth/login
- User login (returns JWT token)
GET /api/users/me
- Get own user profile (USER/ADMIN)PUT /api/users/me
- Update own user profile (USER/ADMIN)GET /api/users
- Get all users (Admin only)GET /api/users/{id}
- Get user by ID (Admin only)PUT /api/users/{id}
- Update user profile (Admin only)DELETE /api/users/{id}
- Delete user (Admin only)POST /api/users/{id}/image
- Upload user profile imageDELETE /api/users/{id}/image
- Delete user profile image
GET /api/spaces
- Get all spacesGET /api/spaces/{id}
- Get space by IDGET /api/spaces/filter/type?type={TYPE}
- Filter spaces by type (ROOM/TABLE)GET /api/spaces/filter/available
- Get available spaces onlyPOST /api/spaces
- Create new space (Admin only)PUT /api/spaces/{id}
- Update space (Admin only)DELETE /api/spaces/{id}
- Delete space (Admin only)
GET /api/reservations/me
- Get own reservations (USER/ADMIN)POST /api/reservations
- Create new reservation (USER only)PUT /api/reservations/{id}
- Update reservation (USER/ADMIN)PATCH /api/reservations/{id}/cancel
- Cancel reservation (USER/ADMIN)GET /api/reservations
- Get all reservations (Admin only)GET /api/reservations/{id}
- Get reservation by ID (Admin only)DELETE /api/reservations/{id}
- Delete reservation (Admin only)
/swagger-ui.html
,/swagger-ui/**
,/v3/api-docs/**
- API documentation/actuator/**
- Application health and metrics
The application comes with preloaded test data:
- Admin: username:
admin
, password:Password123.
- Test Users: username:
debora
,roberto
,jenni
, etc. (password:Password123.
)
- JWT-based authentication
- Role-based authorization (USER/ADMIN roles)
- Password encryption with BCrypt
- CORS configuration for API access
- Spring Boot Actuator integration for health checks and monitoring endpoints
- Cloudinary integration for image storage
- File validation (size and format)
- Automatic cleanup when images are deleted
- Registration confirmation email
- Reservation notifications: email sent when a reservation is created, updated, or cancelled
- Configurable SMTP settings
- MailHog integration for development
- MySQL with JPA/Hibernate
- Automatic schema creation
- Pre-loaded test data
- Connection pooling
docker-compose up -d
docker-compose -f docker-compose-test.yml up --abort-on-container-exit
The application uses multi-stage Docker builds for optimized production images.
GitHub Actions workflows included:
- Test: Runs on pull requests
- Build: Builds and pushes Docker images on main branch pushes
- Release: Creates releases and pushes tagged images
- Deploy: Triggers Kubernetes deployment workflows
- Container Orchestration: Deploy the application using Kubernetes
- Manifests: Includes YAML files for Deployment, Service, and ConfigMap
- Kustomization: Manage overlays and environment-specific configurations
- Scalability: Horizontal Pod Autoscaler for dynamic scaling
- Persistent Storage: PersistentVolumeClaims for database and file storage
- Monitoring & Logging: Optional integration with Prometheus/Grafana
[Developer]
ββ pushes code
βΌ
[GitHub Repository]
ββ triggers workflow
βΌ
[GitHub Actions CI/CD]
ββ Run tests
ββ Build Docker image
ββ Push image to registry
ββ Deploy to Kubernetes
βΌ
[Kubernetes Cluster]
ββ Deployment: runs pods with your app
ββ Service: exposes app internally/externally
ββ ConfigMap & Secrets: app configuration
ββ HPA: auto-scaling pods
ββ PersistentVolumeClaims: database & file storage
curl -X POST http://localhost:8080/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"username": "maria",
"email": "maria@example.com",
"password": "SecurePass123!"
}'
curl -X POST http://localhost:8080/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"identifier": "maria",
"password": "SecurePass123!"
}'
curl -X GET http://localhost:8080/api/spaces
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
- DΓ©bora Rubio β Scrum Master and Developer
- Lara Pla β Product Owner and Developer
- Mariia Sycheva β Developer
- Mayleris Echezuria β Developer
- Vita Poperechna β Developer
- Saba Ur Rehman β Developer
This project is part of a learning bootcamp and is intended for educational purposes.
For questions or issues, please create an issue in the repository or contact the development team.
Built with π using Spring Boot and modern Java technologies