This project is a fully functional Event-Booking REST API built with Go (Golang) using the Gin framework, JWT-based authentication, and SQLite as the database. It provides secure user authentication and full CRUD functionality for managing events.
- ๐ JWT Authentication (
/signup,/login) - ๐งพ Event CRUD API (Create, Read, Update, Delete)
- โ Protected Routes using middleware
- ๐พ SQLite database integration
- ๐ก๏ธ Secure password hashing with bcrypt
- โ๏ธ Clean modular structure with packages
โโโ db/ โ Database setup & table creation
โโโ models/ โ User & Event models with DB logic
โโโ routes/ โ API route handlers
โโโ middlewares/ โ JWT authentication middleware
โโโ utils/ โ Token generation & password hashing
โโโ main.go โ App entry point
POST /signupโ Create user accountPOST /loginโ Authenticate user and return JWTGET /eventsโ List all eventsGET /events/:idโ Get a single event
POST /eventsโ Create new eventPUT /events/:idโ Update an eventDELETE /events/:idโ Delete an event
- Golang
- Gin Gonic (HTTP Web Framework)
- SQLite3 (lightweight DB)
- JWT (Authentication)
- bcrypt (Password hashing)
go mod tidy
go run .Server will start on: http://localhost:8080