Skip to content

SitMe is a smart backend system for managing table and meeting room reservations within companies. Built with Java 21, Spring Boot, and MySQL, it provides secure JWT authentication, role-based access, concurrency management, and admin tools for efficient reservation policies.

Notifications You must be signed in to change notification settings

femcoders-sitme/sitme

Repository files navigation

SitMe - Workspace Reservation System

Java Spring Boot MySQL Docker GitHub Actions License

SitMe is a Spring Boot application for managing workspace reservations, built with modern Java technologies and containerized with Docker.


πŸ“‘ Table of Contents


πŸš€ Features

  • 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

πŸ› οΈ Tech Stack

  • 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

πŸ“‹ Prerequisites

  • Java 21
  • Maven 3.9+
  • Docker and Docker Compose
  • MySQL 8.0 (if running locally without Docker)

πŸ—οΈ Project Structure

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

βš™οΈ Configuration

Environment Variables

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

πŸš€ Getting Started

Option 1: Using Docker Compose (Recommended)

  1. Clone the repository:

    git clone <repository-url>
    cd sitme
  2. Start the application:

    docker-compose up -d
  3. Access the application:

Option 2: Local Development

  1. Install dependencies:

    mvn clean install
  2. Run the application:

    mvn spring-boot:run
  3. Access the application:


πŸ§ͺ Testing

Run Unit Tests

mvn test

Run Integration Tests with Docker

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

πŸ“š API Documentation

Authentication Endpoints

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login (returns JWT token)

User Management

  • 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 image
  • DELETE /api/users/{id}/image - Delete user profile image

Space Management

  • GET /api/spaces - Get all spaces
  • GET /api/spaces/filter/type?type={TYPE} - Filter spaces by type (ROOM/TABLE)
  • GET /api/spaces/filter/available - Get available spaces only
  • POST /api/spaces - Create new space (Admin only)
  • PUT /api/spaces/{id} - Update space (Admin only)
  • DELETE /api/spaces/{id} - Delete space (Admin only)

Reservation Management

  • GET /api/reservations - Get all reservations (Admin only)
  • GET /api/reservations/{id} - Get reservation by ID (Admin only)

Default Users

The application comes with preloaded test data:

  • Admin: username: admin, password: Password123.
  • Test Users: username: debora, roberto, jenni, etc. (password: Password123.)

πŸ”§ Key Features

Security

  • JWT-based authentication
  • Role-based authorization (USER/ADMIN roles)
  • Password encryption with BCrypt
  • CORS configuration for API access

Observability

  • Spring Boot Actuator integration for health checks and monitoring endpoints

Image Management

  • Cloudinary integration for image storage
  • File validation (size and format)
  • Automatic cleanup when images are deleted

Email System

  • Registration confirmation emails
  • Configurable SMTP settings
  • MailHog integration for development

Database

  • MySQL with JPA/Hibernate
  • Automatic schema creation
  • Pre-loaded test data
  • Connection pooling

🐳 Docker Support

Development

docker-compose up -d

Testing

docker-compose -f docker-compose-test.yml up --abort-on-container-exit

Production Build

The application uses multi-stage Docker builds for optimized production images.


πŸ”„ CI/CD Pipeline

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

πŸ“ API Usage Examples

Register a new user

curl -X POST http://localhost:8080/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "username": "maria",
    "email": "[email protected]",
    "password": "SecurePass123!"
  }'

Login

curl -X POST http://localhost:8080/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "identifier": "maria",
    "password": "SecurePass123!"
  }'

Get all spaces

curl -X GET http://localhost:8080/api/spaces

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

πŸ‘©β€πŸ’» Team

  • 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

πŸ“„ License

This project is part of a learning bootcamp and is intended for educational purposes.


πŸ†˜ Support

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

About

SitMe is a smart backend system for managing table and meeting room reservations within companies. Built with Java 21, Spring Boot, and MySQL, it provides secure JWT authentication, role-based access, concurrency management, and admin tools for efficient reservation policies.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 8