The User Service is a core component of the Shopyfize application, responsible for user authentication and authorization. Built using Java and Spring Boot, this service utilizes modern technologies and practices to ensure a secure and efficient user experience.
- Java
- Spring Boot
- Maven
- Postgres
- Docker
- JUnit
- Mockito
- Spring Security
- JWT (JSON Web Tokens)
- Spring Data JPA
- Hibernate
- User Login: Users can log in to the application using their credentials.
- Token-Based Authentication: This service implements token-based authentication, ensuring secure user sessions.
- Spring Authorization Server: The service is configured to use Spring Authorization Server, enhancing the security and management of user permissions.
The user-service interacts with a separate product-service, which serves as a repository for products. To access product data, users must be authenticated and authorized by the user-service, ensuring that only valid users can retrieve information.
- Docker
- Maven
- Postgres
- Clone the repository:
git clone <repository-url> cd shopyfize-user-service
- Set the environmental variable for USER_SERVICE_SECRET: This variable is used to sign the JWT tokens generated by the service. You can set this variable to any string value of your choice.
In a Unix-based system, you can run:
In a Windows system, you can run:
export USER_SERVICE_SECRET=your_secret_string[System.Environment]::SetEnvironmentVariable('USER_SERVICE_SECRET', 'your_secret_string', [System.EnvironmentVariableTarget]::User)
- Build the application:
mvn clean install
- Running the application:
- After building, the JAR file can be found in
target/directory - You can run the jar with following command
java -jar target/shopyfize-user-service-<version>.jar
- After building, the JAR file can be found in
- Access the application at http://localhost:8080/auth/
Contributions are welcome! Please submit the pull request or open an issue to discuss changes
This project is licensed under the MIT License - see the LICENSE.md file for details.