A modern vehicle inspection and documentation system built with Spring Boot. This application provides a robust backend for managing vehicle inspection workflows, including:
- Vehicle Inspection Management: Track and document vehicle conditions with detailed reports
- Questionnaire System: Customizable inspection checklists with yes/no questions
- Photo Documentation: Attach multiple photos to each inspection item
- RESTful API: Well-documented endpoints for seamless integration
- Observability: Built-in OpenTelemetry support for monitoring and tracing
Built with Spring Boot 3, PostgreSQL, and Docker for easy deployment.
- Java 17
- Docker and Docker Compose
- Maven
-
Clone the repository
git clone <your-repo-url> cd tiktak-backend
-
Start PostgreSQL with Docker
docker-compose up -d postgres
-
Run the application
./mvnw spring-boot:run
- dev: Development profile with PostgreSQL database and auto-created schema
- test: Uses H2 in-memory database (automatically configured via test scope dependencies)
- prod: Production profile with PostgreSQL and Flyway migrations
- Start PostgreSQL:
docker-compose up -d postgres - Stop PostgreSQL:
docker-compose stop postgres - View logs:
docker-compose logs postgres - Access PostgreSQL shell:
docker-compose exec postgres psql -U tiktak_user -d tiktak_db
The application uses PostgreSQL with the following default configuration:
- Host: localhost:5432
- Database: tiktak_db
- User: tiktak_user
- Password: tiktak_password (default)
- Health Check:
GET http://localhost:8080/actuator/health - Application Info:
GET http://localhost:8080/actuator/info
- Health Check:
GET http://localhost:8080/actuator/health - Metrics:
GET http://localhost:8080/actuator/metrics - Tracing: View traces in Jaeger UI at
http://localhost:16686
The application includes built-in monitoring capabilities:
- Jaeger: Distributed tracing
- Micrometer: Application metrics
- Actuator: Production-ready features
Base path: /api/expertises
-
GET
/api/expertises- Description: Get the latest expertise records for a car.
- Query parameters:
carId(string, required)
- Response:
200 OKwith a JSON array ofExpertiseResponse - cURL example:
curl -X GET "http://localhost:8080/api/expertises?carId=45DEF67"
-
POST
/api/expertises- Description: Create a new expertise for a car.
- Request body:
CreateExpertiseRequest(application/json) - Response:
201 Createdwith empty body - cURL example:
curl -X POST 'http://localhost:8080/api/inspections' \ -H 'Content-Type: application/json' \ -d '{ "carId": "45DEF67", "answers": [ { "questionId": 1, "yesNo": true, "description": "Headlight cracked", "photos": [ "http://headlight1.jpg" ] }, { "questionId": 2, "yesNo": false, "description": "", "photos": [] }, { "questionId": 3, "yesNo": true, "description": "Bald tires, immediate replacement needed", "photos": [ "http://tire1.jpg", "http://tire2.jpg" ] } ] }'
-
CreateExpertiseRequest
{ "carId": "string", "answers": [ { "questionId": 0, "yesNo": true, "description": "string", "photos": ["string"] } ] } -
ExpertiseResponse
{ "id": 0, "carId": "string", "createdAt": "2025-01-01T12:34:56Z", "answers": [ { "questionId": 0, "yesNo": true, "description": "string", "photos": ["string"] } ] }
- Make sure PostgreSQL is running:
docker-compose up -d postgres - Run tests:
./mvnw test - Build application:
./mvnw clean package
You can override the default database configuration using environment variables:
POSTGRES_DB: Database name (default: tiktak_db)POSTGRES_USER: Database user (default: tiktak_user)POSTGRES_PASSWORD: Database password (default: tiktak_password)DB_USERNAME: Spring Boot database username (default: tiktak_user)DB_PASSWORD: Spring Boot database password (default: tiktak_password)