This repository contains the final project of the Go (Golang) course available on our YouTube channel. The project demonstrates a complete Ticket Booking System built with Go, showcasing advanced features and best practices.
You can follow along with the full tutorial for this project on our YouTube channel. Don't forget to subscribe to stay updated with the latest lessons and videos!
The Ticket Booking System is a web application built with Go, designed to manage ticket reservations. It includes features such as:
- User Registration and Authentication: Secure sign-up and login system for users.
- Ticket Booking: Users can book, view, and manage their tickets.
- Concurrency: Efficient handling of multiple requests using Go's goroutines and channels.
- ...
- Language: Go (Golang)
- Database: PostgreSQL
- Web Framework: fiber
- Authentication: JWT (JSON Web Tokens)
- Docker: For containerization and deployment
- golang-migrate: Database migrations. CLI and Golang library.
- sqlc: Generates Go code from SQL queries for type-safe database interactions
ticket/
├── internal/ # Core application logic
│ ├── api/ # HTTP request handling
│ │ ├── handlers/ # Controllers and request handlers
│ │ ├── middleware/ # Middleware for request processing
│ │ └── server.go # Server initialization and configuration
│ ├── db/ # Database connections, migrations, and models
│ ├── routes/ # Route definitions and management
│ ├── token/ # JWT token generation, validation, and authentication
│ ├── util/ # Utility functions, helpers, and shared components
├── Dockerfile # Docker configuration for containerizing the application
├── docker-compose.yml # Docker Compose configuration for orchestrating services
├── README.md # Project documentation, setup instructions, and usage
├── main.go # Main entry point of the application
└── app.env # Environment variables configuration file
To get started with the project, follow these steps:
git clone https://github.com/mousav1/ticket.git
cd ticket
Create a .env file based on .env.example and configure your database credentials and other settings.
migrate -path interna/db/migration -database "postgres://username:password@localhost:5432/database_name?sslmode=disable" up
go run main.go
docker-compose up --build
Access the application at http://localhost:8080.