This project is an API built using Java, Java Spring, H2 as the database.
The API was developed to demonstrate how to create and integrate microservices using Java Spring.
- Clone the repository:
git clone https://github.com/gabriel-afg/EventMicroservice-java.git
-
Install dependencies with Maven
-
Clone the Email Microservice repository and follow his installation process
git clone https://github.com/gabriel-afg/EmailMicroservice.git
- Adjust Email Microservice application.properties to run on port
8081
server.port=8081
- Run both Microservices
- Start the application with Maven
- The API will be accessible at http://localhost:8080
The API provides the following endpoints:
GET EVENTS
GET /events - Retrieve a list of all events.
[
{
"id": "ae413540-515d-4add-8cd1-1702c7d280d7",
"maxParticipants": 20,
"registeredParticipants": 0,
"date": "28/11/2023",
"title": "Frontin Floripa",
"description": "Evento Tech em Floripa!!"
}
]
GET UPCOMING EVENTS
GET /events/upcoming - List all upcoming events (which the date is greather then current date).
[
{
"id": "ae413540-515d-4add-8cd1-1702c7d280d7",
"maxParticipants": 20,
"registeredParticipants": 0,
"date": "28/11/2023",
"title": "Frontin Floripa",
"description": "Evento Tech em Floripa!!"
}
]
POST EVENT
POST /events - Register a new event into the App
{
"maxParticipants": 20,
"registeredParticipants": 0,
"date": "28/11/2023",
"title": "Frontin Floripa",
"description": "Evento Tech em Floripa!!"
}
POST REGISTRATION
POST /events/${id} - Register a user into a Event if event is not full
{
"participantEmail": "liveskipperdev@gmail.com"
}
The project utilizes H2 Database as the database.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request to the repository.