The Pubber REST API is part of the Pubber project, platform designed to help users discover and explore their favorite pubs in nearby locations. This repository is reposnible for the backend REST API, which handles pub management and data access. It provides:
- Secure Admin Endpoints: For managing pub data, including creation, updates, and deletion.
- Public Data Access: For users to retrieve pub information for their searches.
The REST API for sharing and managing pub informations shares data about:
- Pub details
- Drinks & drinks styles
- Opening hours of pubs
- Tags & photos Built with Spring Boot in Java using JPA for database connection and OpenAPI for documentation.
- IntelliJ IDEA
- Gradle build system
- Docker (for local MySQL instance)
- Production - Mysql (configure via environment variables)
- Testing - H2 in-memory database
- Local Development (dev profile)- use included docker-compose.yml file to run MySQL server locally
Documentation is automatically generated by OpenApi and is available at:
http://{YOUR_HOST}:{YOUR_PORT}/edit/swagger-ui/index.html
- Public Endpoints (/pubs/**): Read-only access to pub details, Available without authentication
- Admin Endpoints (All other routes): Basic authentication required
- DTO Separation
- clientdto - for public access
- editdto - for admin in order to make easier access and modification of data
- Validation
- Error Handling
- Controller-service-repository pattern
- Integration tests (for now not working)
Database is hosted in RDS server in AWS.

To run application in production profile, set up following environment variables:
DB_URL=jdbc:mysql://localhost:3306/Pubber
DB_USER=root
DB_PASSWORD=securepassword
APP_USERNAME=admin
APP_PASSWORD=secret
It is also possiblity to run in develepoment profile. For this .env file is not needed. Run Docker Compose file, then execute Spring Boot application using IntelliJ IDEA.