This is a Java Spring Boot application that serves as an authentication API, providing secure user authentication and authorization for your applications.
- User registration with email and password
- User login and token-based authentication
- Role-based authorization
- JWT (JSON Web Token) authentication
- Password hashing and salting
- Run tests with
mvn test
- Build JAR with
mvn package
- Build Docker image and push to Docker Hub with the following params:
DATABASE_URL
: URL of the PostgreSQL databaseDATABASE_USERNAME
: Username of the PostgreSQL databaseDATABASE_PASSWORD
: Password of the PostgreSQL databaseJWT_SECRET_KEY
: Cryptographic key used to sign and verify JWTs
- Publish release with the version written in
pom.xml
Make sure you have the following installed:
- Java 17
- Apache Maven
- PostgreSQL
- Spring Data JPA
- Spring Security
- Lombok
- Java JWT (jjwt)
-
Clone the repository to your local machine.
-
Open the project in your IDE.
-
Configure the application settings that are read by
src/main/resources/application.yml
. Create a.env
file in the root of the application with:DATABASE_URL=value DATABASE_USER=value DATABASE_PASSWORD=value JWT_SECRET_KEY=value
Modify the URL, username, and password to match your database configuration.
-
Build and run the application:
mvn spring-boot:run
The API will be accessible at http://localhost:8080
.