This readme details a Spring Boot-based Event Management API utilizing MongoDB, Redis, Docker, Lombok and JWT.
- Backend: Spring Boot, Java
- Database: MongoDB
- Caching: Redis
- Authentication: JWT
- Containerization: Docker
- controller: REST controllers managing events and users.
- entity: Data models for events and users.
- service: Business logic for event and user management.
- config: Configuration files for JWT, Redis caching, and other services.
- docker: Dockerfile and docker-compose.yml for building and running the application.
- tests: Unit tests for controllers and services.
Endpoint | Description | Authentication | Role |
---|---|---|---|
GET /api/v1/events | Retrieve a list of all events. | Required | Admin |
GET /api/v1/events/{id} | Obtain an event by its ID. | Required | Admin |
POST /api/v1/events/create | Create a new event. | Required | Admin |
PUT /api/v1/events/update/{id} | Update an existing event. | Required | Admin |
DELETE /api/v1/events/delete/{id} | Delete an event. | Required | Admin |
Endpoint | Description | Authentication | Role |
---|---|---|---|
POST /api/v1/users/create | Register a new user. | Public | None |
GET /api/v1/users/{id} | Retrieve a user by their ID. | Required | User |
PUT /api/v1/users/{id} | Update a user's profile. | Required | User |
DELETE /api/v1/users/{id} | Delete a user. | Required | Admin |
Endpoint | Description | Authentication | Role |
---|---|---|---|
POST /api/v1/auth/authenticate | Authenticate a user and receive a JWT token. | Public | User |
Only users with the ADMIN role can create, update, and delete events.
Only authenticated users can access their own profile information.
- This is a basic example and may require adjustments for your specific needs.
- Configure your own MongoDB, Redis, and Docker environments.
- Implement your own security measures to protect data.
- Clone the repository.
- Build and run the application using Docker: "docker-compose up -d"
- Open http://localhost:8081 in your browser to see Mongo Express.
- Refer to specific endpoint descriptions for API usage.
- You can use Postman or Swagger to send requests and take responses from endpoints.
- This project utilizes Spring Security for authentication and authorization.
- Spring Data MongoDB facilitates interaction with the MongoDB database.
- Spring Cache enables caching frequently accessed data.
I hope this helps! Feel free to ask any further questions you may have.