This API is built using Spring Boot, integrates JWT authentication, and uses PostgreSQL as the database. The API is fully containerized with Docker Compose and comes with pre-configured Swagger UI for easy API exploration.
git clone https://github.com/Ulisses22/dockerized-spring-api.git
cd spring-boot-api-jwt
application.properties (you can use .env file to Dynamic configuration)
spring.datasource.username=postgres
spring.datasource.password=rootdocker-compose.yml (you can use .env file to Dynamic configuration)
POSTGRES_USER: postgres
POSTGRES_PASSWORD: root
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: rootdocker-compose up --build # Build and run containers
| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/api/auth/login |
POST | Log in and get JWT token | ❌ |
/api/auth/register |
POST | Register a new user | ❌ |
/api/auth/activate |
GET | Activate a new user | ❌ |
/api/private |
GET | Private content | ✅ |
/api/public |
GET | Public content | ❌ |
URL: http://localhost:8080/swagger-ui.html
- Backend: Spring Boot, Spring Security, JWT
- Database: PostgreSQL
- Containerization: Docker, Docker Compose
- Documentation: Swagger UI
- Validation: Hibernate Validator
