A robust, production-ready Spring Boot REST API for managing classified advertisements, listings, user interactions, and categories.
- Spring Boot Backend: High-performance, enterprise-ready API leveraging the Spring ecosystem.
- PostgreSQL Database: Relational database storage managing user details, categories, and active ad listings.
- Dockerized Ecosystem: Complete multi-container setup with
Dockerfileanddocker-compose.ymlfor single-command database and app provisioning. - Data Persistence: Built with Spring Data JPA / Hibernate for seamless database object-relational mapping.
- Language: Java
- Framework: Spring Boot
- Database: PostgreSQL
- Build Tool: Apache Maven
- Containerization: Docker & Docker Compose
classifiedsapi/
├── .mvn/ # Maven Wrapper configuration files
├── src/ # Main application source code
│ ├── main/ # Application codebase and properties
│ └── test/ # Unit and integration test configurations
├── Dockerfile # Multi-stage Docker build configuration
├── docker-compose.yml # Multi-container orchestration (App + Postgres)
├── mvnw # Maven wrapper script for Linux/macOS
├── mvnw.cmd # Maven wrapper script for Windows
├── pom.xml # Maven project dependency management
└── README.md # Project documentation
- Java Development Kit (JDK): 17 or higher
- Docker & Docker Compose (Highly Recommended)
- Alternatively, a local PostgreSQL database instance running on port
5432
The easiest way to run the application is to let Docker handle both the Spring Boot app and the PostgreSQL database container automatically.
-
Clone the repository:
git clone https://github.com cd classifiedsapi -
Spin up the whole ecosystem:
docker-compose up --build
Docker will create an internal network, provision the PostgreSQL database instance, execute your Maven build schema, and bring the API online.
If you prefer to run the Spring Boot application locally while targeting your own local or containerised database.
-
Configure Environment Variables / Properties: Ensure your local
src/main/resources/application.properties(orapplication.yml) matches your local database credentials:spring.datasource.url=jdbc:postgresql://localhost:5432/classifieds_db spring.datasource.username=your_user spring.datasource.password=your_password spring.jpa.hibernate.ddl-auto=update
-
Build and install dependencies:
./mvnw clean install
-
Boot up the application:
./mvnw spring-boot:run
The local application will start and listen on port
8080by default (http://localhost:8080).
This project is licensed under the MIT License - see the LICENSE file for details.