Welcome to our Event Management System built with Gin, a high-performance HTTP web framework for Golang. This system provides functionalities for managing events and users, including adding, removing, and updating events, as well as registering and logging in users, and registering or unregistering users for events.
-
Make sure you have Go installed on your system. You can download and install it from here.
-
Clone this repository to your local machine:
git clone https://github.com/AdleeAfif/event-management-api
-
Navigate to the project directory:
cd event-management-api
-
Install dependencies:
go mod tidy
-
Build the project:
go build .
-
Run the application:
go run .
Once the application is running, you can interact with the Event Management System using the following endpoints:
-
Add Event:
- Endpoint:
/events
- Method: POST
- Description: Adds a new event to the system.
- Request Body:
{ "name": "Testing Event", "description": "A test event", "location": "A test location", "dateTime": "2025-01-01T15:30:00.000Z" }
- Endpoint:
-
Remove Event:
- Endpoint:
/events/:id
- Method: DELETE
- Description: Removes the event with the specified ID from the system.
- Endpoint:
-
Update Event:
- Endpoint:
/events/update/:id
- Method: PUT
- Description: Updates the details of the event with the specified ID.
- Request Body:
{ "name": "Not Testing Event", "description": "A non test event (updated!)", "location": "A non test location", "dateTime": "2025-01-01T15:30:00.000Z" }
- Endpoint:
-
Signup User:
- Endpoint:
/signup
- Method: POST
- Description: Registers a new user in the system.
- Request Body:
{ "email": "email", "password": "password" }
- Endpoint:
-
Login User:
- Endpoint:
/login
- Method: POST
- Description: Logs in an existing user.
- Request Body:
{ "username": "username", "password": "password" }
- Endpoint:
-
Register User for Event:
- Endpoint:
/events/:id/register/
- Method: POST
- Description: Registers the logged-in user for the event with the specified ID.
- Endpoint:
-
Unregister User from Event:
- Endpoint:
/events/:id/register
- Method: DELETE
- Description: Unregisters the logged-in user from the event with the specified ID.
- Endpoint:
-
See all users (ADMIN):
- Endpoint:
/users
- Method: GET
- Description: Display all the users available in the database.
- Endpoint:
-
Remove single user by ID (ADMIN):
- Endpoint:
/users/:id
- Method: Delete
- Description: Remove a user from the system permanently.
- Endpoint:
Contributions are welcome! If you find any bugs or want to add new features, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
Special thanks to the Gin contributors for creating such a powerful framework for building web applications in Go.