A robust and scalable RESTful API backend for an Event Management Platform, built with Go.
- User Authentication: Secure registration and login using JWT (JSON Web Tokens) and Bcrypt for password hashing.
- Role-Based Authorization: Distinguishes between
creatorandattendeeroles, controlling access to specific API endpoints.creator: Can create, update, and delete events.attendee: Can view events, register for, and unregister from events.
- Event Management: Full CRUD (Create, Read, Update, Delete) operations for events.
- Attendee Management: Functionality for attendees to register for and unregister from events.
- CORS Support: Configured to allow cross-origin requests from frontend applications.
- Go (Golang): The primary programming language.
- Gin Web Framework: High-performance HTTP web framework for routing and API handling.
- MongoDB: NoSQL document database for flexible data storage.
- JWT (JSON Web Tokens): For stateless authentication.
- Bcrypt: For secure one-way password hashing.
- Docker: (Optional, for running MongoDB locally) Containerization.
- Clone the repository:
git clone [https://github.com/Sumit-2028/EventManagementBackend.git](https://github.com/Sumit-2028/EventManagementBackend.git) cd go-event-management-backend - Create a
.envfile in the root directory with your MongoDB URI and JWT Secret:MONGO_URI="mongodb://localhost:27017" # Or your MongoDB Atlas connection string JWT_SECRET="YOUR_VERY_STRONG_RANDOM_JWT_SECRET_KEY" PORT="8080" - Run MongoDB:
Ensure a MongoDB instance is running (e.g., via Docker:
docker run -d --name mongo-db -p 27017:27017 mongo). - Install Go dependencies:
go mod tidy
- Run the application:
The server will start on
go run main.go
http://localhost:8080.
Feel free to fork the repository, open issues, or submit pull requests.