Voll Med Clinic API is a RESTful service built with Spring Boot for managing clinic operations, including authentication, user management, and medical data handling. It uses JWT authentication for security and integrates with MySQL for persistent data storage.
- User authentication and JWT-based authorization
- Role-based access control with Spring Security
- MySQL database integration
- Data validation with Hibernate Validator
- Database migration with Flyway
- API development with Spring Boot
- RESTful architecture
- Java 21
- Spring Boot 3.4.1
- Spring Security
- JWT (JSON Web Token)
- Flyway (Database Migrations)
- MySQL (Database)
- Hibernate (JPA)
- Maven
Ensure you have the following installed on your system:
- Java 21
- Maven
- MySQL
git clone https://github.com/your-repository/voll-med-api.git
cd voll-med-api
Create a MySQL database and update your application.properties
:
spring.datasource.url=jdbc:mysql://localhost:3306/voll_med_db
spring.datasource.username=root
spring.datasource.password=yourpassword
spring.jpa.hibernate.ddl-auto=update
mvn spring-boot:run
POST /auth/login
{
"username": "user@example.com",
"password": "password"
}
Response:
{
"token": "eyJhbGciOiJI..."
}
GET /users/{id}
POST /users/register
{
"name": "John Doe",
"email": "johndoe@example.com",
"password": "securepassword"
}
JWT Token is required for accessing protected resources. Send token in Authorization header:
Authorization: Bearer <your_token>
- JWT-based Authentication: Secure endpoints using JSON Web Tokens.
- Password Encryption: Uses bcrypt hashing for password storage.
- Role-based Access Control: Restricts user access based on roles.
To run tests, execute:
mvn test