Welcome to SpringBootAPI – a robust, production-ready RESTful service built with Spring Boot and PostgreSQL.
branches:
-master
-testing
This project demonstrates a complete CRUD API for managing Run entities. Designed for easy local development and real-world integration, it showcases best practices for connectivity, containerization, and code quality.
- CRUD Operations: Create, Read, Update, and Delete
Rundata. - PostgreSQL Database: Seamless data persistence using PostgreSQL.
- Docker Compose: Effortless local setup via
docker-compose.yml. - External REST Client: Integrates with jsonplaceholder.typicode.com to demonstrate outbound HTTP requests.
- Unit Testing: Includes unit tests (see the
testingbranch) powered by Spring's testing stack.
-
Clone the Repository
git clone https://github.com/oleksy-piotr-angular/SpringBootAPI.git cd SpringBootAPI -
Start PostgreSQL via Docker
docker-compose up -d
-
Configure Database Connection
By default, database settings are pre-configured for local Docker. You may adjust them in
src/main/resources/application.propertiesif needed. -
Run the Application
./mvnw spring-boot:run
or
mvn spring-boot:run
-
Access the API
The service runs on http://localhost:8080. Explore the endpoints using Postman or curl.
GET /runs— List all runsPOST /runs— Create a new runPUT /runs/{id}— Update a runDELETE /runs/{id}— Delete a runGET /external/posts— Fetch posts from jsonplaceholder (example of REST client integration)
Unit tests are available in the testing branch, leveraging Spring Boot's built-in testing tools:
git checkout testing
mvn testThe repository contains a docker-compose.yml for easy PostgreSQL setup. This streamlines development, eliminating manual DB configuration.
Pull requests and suggestions are welcome! For major changes, please open an issue first to discuss what you’d like to modify.
This project is licensed under the MIT License.
Happy Coding!