Skip to content

EAD-Group-Project-2025/gear-up-be

Repository files navigation

Gear Up Backend

Enterprise-grade vehicle service management system backend built with Spring Boot 3 and Java 21.

🚀 Tech Stack

  • Java 21 - Latest LTS version with modern language features
  • Spring Boot 3.x - Enterprise application framework
  • PostgreSQL - Production database (Neon.tech hosted)
  • Flyway - Database migration management
  • Spring Security - JWT-based authentication
  • Spring Data JPA - Database access layer
  • Docker - Containerization
  • Maven - Build and dependency management

📋 Features

  • User Management - Multi-role authentication (Admin, Employee, Customer)
  • Vehicle Management - Track customer vehicles and service history
  • Project Management - Organize service projects with task tracking
  • Appointment System - Schedule and manage service appointments
  • Time Logging - Track employee work hours against projects/appointments
  • Customer Portal - Self-service appointment booking and status tracking
  • Employee Dashboard - Task management and time tracking
  • Admin Console - Complete system oversight and reporting

🛠️ Prerequisites

  • Java 21 or higher
  • Maven 3.8+
  • PostgreSQL 14+ (or use provided Neon.tech connection)
  • Docker (optional, for containerized deployment)

⚙️ Environment Configuration

Create src/main/resources/application-dev.properties:

# Database
spring.datasource.url=jdbc:postgresql://your-db-host:5432/gearup
spring.datasource.username=your-username
spring.datasource.password=your-password

# JWT
jwt.secret=your-secret-key-min-256-bits

# Email (optional)
spring.mail.username[email protected]
spring.mail.password=your-app-password

# CORS
cors.allowed.origins=http://localhost:3000

# Chatbot Service (optional)
chatbot.python.service.url=http://localhost:5001

🏃 Running Locally

Option 1: Maven (Recommended for Development)

# Development mode with hot reload
./mvnw spring-boot:run -Dspring-boot.run.profiles=dev

# Or use the batch file (Windows)
./run-maven.bat

Option 2: Docker

# Build and run
docker build -t gearup-backend .
docker run -p 8080:8080 \
  -e SPRING_PROFILES_ACTIVE=dev \
  -e SPRING_DATASOURCE_URL=jdbc:postgresql://host.docker.internal:5432/gearup \
  -e SPRING_DATASOURCE_USERNAME=postgres \
  -e SPRING_DATASOURCE_PASSWORD=password \
  -e JWT_SECRET=your-secret-key \
  gearup-backend

Option 3: Docker Compose

# Start all services (backend + chatbot)
docker-compose up -d

# View logs
docker-compose logs -f backend

🧪 Testing

# Run all tests
./mvnw test

# Run with coverage
./mvnw clean test jacoco:report

# View coverage report
open target/site/jacoco/index.html

📦 Building for Production

# Create JAR
./mvnw clean package -DskipTests

# Run production JAR
java -jar target/gear-up-be-0.0.1-SNAPSHOT.jar \
  --spring.profiles.active=prod \
  --spring.datasource.url=jdbc:postgresql://prod-db:5432/gearup

🚢 Deployment

Google Kubernetes Engine (GKE)

The project includes CI/CD pipelines for automated deployment:

  1. Setup: Follow DEPLOYMENT_GUIDE.md for complete instructions
  2. Configure Secrets: Add required secrets to GitHub repository
  3. Deploy: Push to main or production branch
# Manual deployment
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/backend-configmap.yaml
kubectl apply -f k8s/backend-deployment.yaml

📚 API Documentation

Once running, access API documentation at:

  • Swagger UI: http://localhost:8080/swagger-ui.html
  • API Docs: http://localhost:8080/v3/api-docs

Key Endpoints

Authentication:
  POST /api/auth/login
  POST /api/auth/register

Projects:
  GET    /api/projects
  POST   /api/projects
  PUT    /api/projects/{id}
  DELETE /api/projects/{id}

Appointments:
  GET    /api/appointments
  POST   /api/appointments
  PUT    /api/appointments/{id}/status

Time Logs:
  GET    /api/time-logs
  POST   /api/time-logs
  DELETE /api/time-logs/{id}

🗄️ Database Migrations

Migrations are managed by Flyway in src/main/resources/db/migration/:

V1__initial_schema.sql
V2__add_appointments.sql
V3__add_time_logs.sql
...
V13__add_appointment_to_time_logs.sql

New migrations run automatically on startup.

🔒 Security

  • JWT tokens expire after 24 hours
  • Passwords hashed with BCrypt
  • Role-based access control (RBAC)
  • CORS configured for frontend origin
  • SQL injection prevention via JPA

📊 Health Checks

# Application health
curl http://localhost:8080/actuator/health

# Database connectivity
curl http://localhost:8080/actuator/health/db

🤝 Contributing

  1. Create feature branch from main
  2. Follow existing code patterns
  3. Add tests for new features
  4. Update documentation
  5. Submit pull request

📄 License

MIT License - see LICENSE file for details

👥 Team

EAD Group Project 2025


For deployment instructions, see DEPLOYMENT_GUIDE.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8

Languages