This is a Spring Boot application for managing user data and authentication.
auth-service/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── auth_service/
│ │ │ ├── config/
│ │ │ ├── controller/
│ │ │ ├── exception/
│ │ │ ├── filter/
│ │ │ ├── model/
│ │ │ ├── repository/
│ │ │ ├── service/
│ │ │ └── util/
│ │ └── resources/
│ └── test/
├── pom.xml
└── README.md
POST /api/login: Authenticates a user and returns a JWT token.POST /api/refresh-token: Refreshes the JWT token using a refresh token.GET /users/{id}: Retrieve a user by ID.POST /users: Create a new user.DELETE /users/{id}: Delete a user by ID.GET /users: Retrieve all users.PUT /users/{id}/activate: Activate a user by ID.
- GEN_001: Internal server error.
- USR_001: User not found.
- USR_002: Person not found.
- USR_003: Email already exists.
- USR_004: Username already exists.
- USR_005: Username not found.
- AUTH_001: Access denied.
- AUTH_002: Invalid credentials.
- AUTH_003: Invalid signature.
- AUTH_005: Expired JWT.
- AUTH_006: Invalid JWT.
- Java 21
- Gradle 8.3+
- Docker
- Navigate to the project directory.
- Run the application:
gradle bootRun
- Build the Docker image:
docker build -t auth-service . - Run the Docker container:
docker run -p 3002:3002 auth-service
- Run the Docker Compose:
docker-compose up
To deploy the application on a local Kubernetes cluster using kind, you need to fill in the values in the helm/values-dev.yaml file.
Requirements:
- kind
- kubectl
- Helm
- AWS CLI
- Run the script to deploy the application on kind:
./deploy_local.sh