Skip to content

hoangnm/car-parking

Repository files navigation

Parking Lot Management System

This Spring Boot application manages a parking lot system, allowing users to track parked cars and their details.

Prerequisites

  • Java 17 or higher
  • Docker and Docker Compose
  • Gradle

Local Development Setup

  1. Start the PostgreSQL database using Docker Compose:

    docker-compose up -d
  2. Build the application:

    ./gradlew clean build
  3. Run the application:

    ./gradlew bootRun

The application will be available at http://localhost:8080

Database Configuration

The application uses PostgreSQL with the following default configuration:

  • Database: mydatabase
  • Username: myuser
  • Password: secret
  • Port: 5432

You can modify these settings in application.properties if needed.

Monitoring

The application includes Spring Boot Actuator endpoints for monitoring:

Entity Relationship Diagram

erDiagram
    Car {
        Long id PK
        String licensePlate
        String brand
        String model
        String color
    }
    Parking {
        Long id PK
        String location
        Integer capacity
    }
    ParkingSlot {
        Long id PK
        Long carId FK
        Long parkingId FK
        DateTime startTime
        DateTime endTime
    }
    Car ||--o{ ParkingSlot : "occupies"
    Parking ||--o{ ParkingSlot : "contains"
Loading

API Documentation

The API documentation is available through Swagger UI at:

Features

The system supports the following operations:

Parking Management

  • Register a car for parking (assigns an available parking slot)
  • Register a car's departure (records when a car leaves the parking lot)
  • Check if a specific car is currently in the parking lot

Car Information

  • Store car details (license plate, brand, model, color)
  • Look up car information by license plate

Capacity Management

  • Track parking lot capacity
  • Prevent parking when lot is full
  • Monitor occupied and available parking slots

Monitoring and Reporting

  • Track parking duration for each car
  • View parking lot occupancy status
  • Access historical parking records

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages