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
- 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, Docker Compose
- Build Tool: Maven
- CI/CD: GitHub Actions
- Java 21
- Maven 3.9+
- Docker and Docker Compose
- MySQL 8.0 (if running locally without Docker)
src/
βββ main/java/com/femcoders/sitme/
β βββ cloudinary/ # Image upload service
β βββ 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/
βββ 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
# Cloudinary Configuration (for image uploads)
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_KEY=your_cloudinary_api_key
CLOUDINARY_SECRET=your_cloudinary_secret
# Docker Hub (for CI/CD)
DOCKER_USERNAME=your_docker_username
DOCKER_PASSWORD=your_docker_password
-
Clone the repository:
git clone <repository-url> cd sitme
-
Start the application:
docker-compose up -d
-
Access the application:
- API: http://localhost:8081
- Database: localhost:3306
- 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/{id}
- Get user by ID (Admin only)PUT /api/users/{id}
- Update user profile (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/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
- Get all reservations (Admin only)GET /api/reservations/{id}
- Get reservation by ID (Admin only)
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 emails
- 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
curl -X POST http://localhost:8080/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"username": "maria",
"email": "[email protected]",
"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 β Team Leader, 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