https://github.com/omgupta12/ticket-booking
A train seat reservation application with user authentication, dynamic seat booking, and management features. Built using Next.js, Node.js, Express.js, and PostgreSQL, this project follows best practices in web development and provides a seamless user experience for reserving train seats.
https://github.com/omgupta12/ticket-booking
bcrypt expreesjs jwt-authentication nextjs nodejs postgresql tailwindcss
Last synced: 3 months ago
JSON representation
A train seat reservation application with user authentication, dynamic seat booking, and management features. Built using Next.js, Node.js, Express.js, and PostgreSQL, this project follows best practices in web development and provides a seamless user experience for reserving train seats.
- Host: GitHub
- URL: https://github.com/omgupta12/ticket-booking
- Owner: Omgupta12
- Created: 2024-12-30T22:30:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-01T12:15:27.000Z (over 1 year ago)
- Last Synced: 2025-02-09T02:18:13.929Z (over 1 year ago)
- Topics: bcrypt, expreesjs, jwt-authentication, nextjs, nodejs, postgresql, tailwindcss
- Language: JavaScript
- Homepage: https://seat-booking-frontend-rpi7.vercel.app/
- Size: 85.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Train Seat Reservation System
## Project Demo
- Live Application:- https://seat-booking-frontend-rpi7.vercel.app
- Video Presentation:- https://drive.google.com/file/d/1JC1PKEJYtqN5haBw6N3NH_WGWqLctpdL/view?usp=sharing
## About the Project
This application allows users to reserve train seats with specific constraints:
- The train has **80 seats**, arranged as **7 seats per row** with the last row having **3 seats**.
- Users can reserve up to **7 seats in one booking**, prioritizing booking in a single row.
- Seats are assigned nearby if a single row is unavailable.
- **User authentication** is required for seat booking.
- Booked seats are locked and cannot be reserved by others unless canceled.
---
## Tech Stack
### Frontend
- [Next.js](https://nextjs.org/)
- [Tailwind Css](https://tailwindui.com/)
### Backend
- [Node.js](https://nodejs.org/)
- [Express.js](https://expressjs.com/)
### Database
- [PostgreSQL](https://www.postgresql.org/)
### Deployment
- Frontend - Vercel
- Backend - Render
---
## Features
- **User Authentication**: Sign Up/Login functionality.
- **Responsive Design**: Optimized for various devices.
- **Dynamic Routing**: Utilizes Next.js file-based routing.
- **Error Handling**: Proper validation and error responses.
- **Secure Bookings**: Seat locks to avoid duplicate reservations.
- **Administrative Features**: Reset seat bookings.
- **Deployment-Ready**: Compatible with cloud platforms.
---
## Installation
### Prerequisites
- [Node.js](https://nodejs.org/) installed.
- [PostgreSQL](https://www.postgresql.org/) installed and running.
### Frontend Steps
1. Clone the repository:
```bash
git clone https://github.com/your-username/Ticket-Booking.git
cd Ticket-Booking
cd frontend
2. Install dependencies:
```bash
npm install
3. Start the application:
```bash
npm run dev
### Backend Steps
1. Clone the repository:
```bash
git clone https://github.com/your-username/Ticket-Booking.git
cd Ticket-Booking
cd backend
2. Install dependencies:
```bash
npm install
3. Start the application:
```bash
node server.js
## Screenshots
### Login Page

### Signup Page

### Booking Page

## API Endpoints
- https://seatbooking-backend-tsp2.onrender.com/api/auth/login - Login
- https://seatbooking-backend-tsp2.onrender.com/api/auth/signup - Signup
- https://seatbooking-backend-tsp2.onrender.com/api/seats - Get all seats
- https://seatbooking-backend-tsp2.onrender.com/api/seats/reset - Reset all bookings
- https://seatbooking-backend-tsp2.onrender.com/api/seats/book - Booking seats
## Best Practices Followed
- Validation: Input sanitization and validation.
- Error Handling: Graceful responses for edge cases.
- Security: Use of JWT, bcrypt, etc.
- Code Quality: Linting and adherence to coding standards.
- Modularity: Clean, reusable components and modules
## Contact
### Project Owner
- Portfolio: https://omgupta12.github.io/
- Email: omprakash1997242@gmail.com