This is a starter template for a Spring Boot application that integrates OpenAPI for API documentation and JWT (JSON Web Token) for authentication. The project is containerized using Docker Compose, which starts a PostgreSQL database instance for data persistence. Based it on Clinic Event signup idea.
- Spring Boot: Java-based framework for creating standalone, production-grade applications.
- OpenAPI: Integrated for API documentation, providing a clear understanding of the exposed endpoints.
- JWT Auth: Secure your endpoints using JSON Web Tokens for authentication and authorization.
- Docker Compose: Containerized PostgreSQL database for data storage, simplifying deployment and scaling.
Ensure you have the following installed on your local machine:
- Java 11 or higher
- Gradle
- Docker
- Docker Compose
Follow these steps to set up and run the project:
-
Clone the Repository
git clone https://github.com/yourusername/spring-boot-openapi-jwt-template.git
-
Navigate to Project Directory
cd spring-boot-openapi-jwt-template
-
Start Docker Compose
docker-compose up -d
This will start the PostgreSQL database container.
-
Run the Application
java -jar target/spring-boot-openapi-jwt-template-0.0.1-SNAPSHOT.jar
-
Access OpenAPI Documentation Open your web browser and navigate to:
http://localhost:8080/swagger-ui.html
Here, you can explore the API endpoints and test them using the interactive UI provided by Swagger.
Configuration Update the application.yml or application.properties files under src/main/resources to modify application-specific configurations, database settings, JWT secrets, etc. Usage The starter template provides a basic structure with user authentication using JWT. Extend this template by adding your business logic, entities, repositories, services, controllers, etc. Contributing Feel free to contribute to this starter template by submitting pull requests or opening issues for any improvements, bug fixes, or features you'd like to see.
License This project is licensed under the MIT License. See the LICENSE file for details.