Skip to content

๐Ÿ’ป An "Event Booking" REST-Api using Golang which can be consumed by all frontend systems ๐Ÿ”ต

Notifications You must be signed in to change notification settings

callmeskyy111/golang-event_booking-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


๐Ÿงฉ Golang REST API with JWT Auth & SQLite

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.


โœจ Features

  • ๐Ÿ” 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

๐Ÿ“ Project Structure

โ”œโ”€โ”€ 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

๐Ÿ“ฎ API Endpoints

Public

  • POST /signup โ€“ Create user account
  • POST /login โ€“ Authenticate user and return JWT
  • GET /events โ€“ List all events
  • GET /events/:id โ€“ Get a single event

Protected (Requires Token)

  • POST /events โ€“ Create new event
  • PUT /events/:id โ€“ Update an event
  • DELETE /events/:id โ€“ Delete an event

๐Ÿ› ๏ธ Tech Stack

  • Golang
  • Gin Gonic (HTTP Web Framework)
  • SQLite3 (lightweight DB)
  • JWT (Authentication)
  • bcrypt (Password hashing)

๐Ÿš€ Getting Started

go mod tidy
go run .

Server will start on: http://localhost:8080


About

๐Ÿ’ป An "Event Booking" REST-Api using Golang which can be consumed by all frontend systems ๐Ÿ”ต

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages