This is API part of Online Directory Application. This Spring Boot application provides a secure API with JWT authentication, including user registration and login functionalities, role-based access control, and permissions management.
- User registration and login
- JWT authentication
- Role and permission based access control
Before you begin, ensure you have met the following requirements:
- JDK 11 or newer
- Gradle 6 (if building outside of IntelliJ IDEA)
- IntelliJ IDEA or your preferred IDE with Kotlin support
To install the project, follow these steps:
- Clone the repository:
git clone https://yourproject/repository.git
- Navigate to the project directory:
cd repository
Before running the application, generate a secure JWT key
- Run the custom Gradle task
./gradlew generateJwtKey
- Copy the generated key and set it as an environment variable JWT_SECRET_KEY or update
application.properties
security.jwt.token.secret-key=<YourSecureKeyHere>
To run the application, use:
./gradlew bootRun
Or, run the application directly from IntelliJ IDEA by executing the main class com.h5templates.directory.DirectoryApplication.
Registers a new user with the provided details.
- Endpoint:
/api/auth/signup
- Method:
POST
- Payload:
{ "name": "John Doe", "email": "[email protected]", "phone": "1234567890", "password": "yourPassword", "password_confirm": "yourPassword" }
Authenticates the user and returns a JWT token for accessing protected endpoints.
- Endpoint:
/api/auth/login
- Method:
POST
- Payload:
{ "email": "[email protected]", "password": "yourPassword" }
Contributions to this project are welcome. Please follow the standard pull request process for your contributions.
MIT