https://github.com/ulisses22/dockerized-spring-api
This API is built with Spring Boot, secured with JWT authentication, uses PostgreSQL as its database, and is fully containerized with Docker Compose. It includes Swagger UI for easy exploration.
https://github.com/ulisses22/dockerized-spring-api
docker-compose java jpa postgresql spring-boot swagger-ui
Last synced: 2 months ago
JSON representation
This API is built with Spring Boot, secured with JWT authentication, uses PostgreSQL as its database, and is fully containerized with Docker Compose. It includes Swagger UI for easy exploration.
- Host: GitHub
- URL: https://github.com/ulisses22/dockerized-spring-api
- Owner: Ulisses22
- Created: 2024-12-15T21:24:43.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-21T22:41:19.000Z (over 1 year ago)
- Last Synced: 2025-04-05T12:09:47.648Z (about 1 year ago)
- Topics: docker-compose, java, jpa, postgresql, spring-boot, swagger-ui
- Language: Java
- Homepage:
- Size: 61.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🌟 Spring Boot API with JWT Auth and Swagger UI
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.
## 🚀 How to Run the Project
## 1 Clone the Repository
```bash
git clone https://github.com/Ulisses22/dockerized-spring-api.git
cd spring-boot-api-jwt
```
## 2 Configure Environment Variables
**application.properties** (you can use .env file to Dynamic configuration)
```bash
spring.datasource.username=postgres
spring.datasource.password=root
```
**docker-compose.yml** (you can use .env file to Dynamic configuration)
```bash
POSTGRES_USER: postgres
POSTGRES_PASSWORD: root
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: root
```
## 3 Run
```
docker-compose up --build # Build and run containers
```
## Endpoints
| 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 | ❌ |
## Swagger Documentation
URL: http://localhost:8080/swagger-ui.html
## ⚙️ Tech Stack
- Backend: Spring Boot, Spring Security, JWT
- Database: PostgreSQL
- Containerization: Docker, Docker Compose
- Documentation: Swagger UI
- Validation: Hibernate Validator
## Preview

### Enjoy coding! 💻✨