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