A RESTful API for user management built with Spring Boot and MongoDB.
- Complete user CRUD operations
- MongoDB integration
- Password encryption with Argon2
- Input validation
- Pagination and sorting
- Profile-based configuration (dev/prod)
- Response wrapping
- Hot-reloading for development
- Java 23
- Spring Boot 3.4.2
- MongoDB
- Lombok
- Spring Security Crypto (Argon2)
- Maven
GET /api/v1/users
- List all users (paginated)GET /api/v1/users/{id}
- Get user by IDPOST /api/v1/users
- Create new userPUT /api/v1/users/{id}
- Update userDELETE /api/v1/users/{id}
- Delete user
-
Install dependencies:
- JDK 23
- MongoDB
- Maven
-
Configure MongoDB:
Copy example.env
to .env
and set the following environment variables:
MONGODB_HOST=localhost
MONGODB_PORT=27017
MONGODB_DATABASE=usermanagement
LOG_LEVEL=ERROR
- Build:
mvn clean install
- Run:
mvn spring-boot:run
Run with dev profile:
mvn spring-boot:run -Dspring.profiles.active=dev
Build for production:
mvn clean install -Pprod
MIT