A full-stack flight booking application built with modern web technologies, providing a comprehensive platform for users to search, book, and manage flight reservations.
This flight booking system is a complete end-to-end solution that allows users to:
- Search and browse available flights
- Book flights with secure payment processing
- Manage user accounts and bookings
- Rate and review flights
- Receive notifications about booking updates
- Administrative dashboard for flight and user management
The application follows a microservices architecture with separated frontend and backend:
flight-booking/
βββ flight-booking-backend/ # NestJS REST API
βββ flight-booking-frontend/ # Next.js React Application
- Framework: NestJS with TypeScript
- Database: PostgreSQL with TypeORM
- Authentication: JWT with Passport.js
- Payment Processing: Stripe
- File Upload: Multer
- Email Service: Nodemailer
- SMS Service: Twilio
- API Documentation: Swagger/OpenAPI
- Security: bcryptjs for password hashing
- Testing: Jest
- Framework: Next.js 15.3.1 with React 19
- Language: TypeScript
- Styling: Tailwind CSS
- State Management: Zustand
- HTTP Client: Axios
- Data Fetching: TanStack Query (React Query)
- Form Handling: React Hook Form with Zod validation
- UI Utilities: clsx, tailwind-merge
-
π Authentication & Authorization
- User registration and login
- JWT-based authentication
- Role-based access control
- Profile management with photo uploads
-
βοΈ Flight Management- Search flights by destination, date, and preferences
- View detailed flight information
- Filter and sort flight results
-
π« Booking System
- Secure flight booking process
- Booking history and management
- Booking modifications and cancellations
-
π³ Payment Integration
- Secure payment processing with Stripe
- Multiple payment methods support
- Payment history and receipts
-
π± Notifications
- Email notifications for booking confirmations
- SMS alerts for flight updates
- In-app notification system
-
β Reviews & Ratings
- Rate and review flights
- View other users' reviews
- Rating aggregation system
-
π Dashboard
- Comprehensive admin dashboard
- User and booking analytics
- System monitoring
-
π« Flight Management
- Add, edit, and remove flights
- Manage flight schedules and pricing
- Inventory management
-
π₯ User Management
- View and manage user accounts
- Handle user support requests
- Moderate reviews and ratings
- Node.js (v18 or higher)
- PostgreSQL database
- pnpm (recommended) or npm
- Stripe account (for payments)
- Twilio account (for SMS notifications)
-
Clone the repository
git clone <repository-url> cd flight-booking/flight-booking-backend
-
Install dependencies
pnpm install
-
Environment Configuration Create a
.envfile in the backend directory:# Database DATABASE_HOST=localhost DATABASE_PORT=5432 DATABASE_USERNAME=your_db_username DATABASE_PASSWORD=your_db_password DATABASE_NAME=flight_booking_db # JWT JWT_SECRET=your_jwt_secret_key JWT_EXPIRES_IN=7d # Stripe STRIPE_SECRET_KEY=your_stripe_secret_key STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key # Email (Nodemailer) EMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 EMAIL_USER=your_email@gmail.com EMAIL_PASS=your_email_password # Twilio TWILIO_ACCOUNT_SID=your_twilio_account_sid TWILIO_AUTH_TOKEN=your_twilio_auth_token TWILIO_PHONE_NUMBER=your_twilio_phone_number # Application PORT=3001 NODE_ENV=development
-
Database Setup
# Create PostgreSQL database createdb flight_booking_db # Run migrations (if any) pnpm run migration:run
-
Start the backend server
# Development mode pnpm run start:dev # Production mode pnpm run build pnpm run start:prod
-
Navigate to frontend directory
cd ../flight-booking-frontend -
Install dependencies
pnpm install
-
Environment Configuration Create a
.env.localfile in the frontend directory:NEXT_PUBLIC_API_URL=http://localhost:3001 NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
-
Start the frontend server
# Development mode pnpm run dev # Production mode pnpm run build pnpm run start
Once the backend is running, you can access the Swagger API documentation at:
http://localhost:3001/api
This provides interactive documentation for all available endpoints, including:
- Authentication endpoints
- User management
- Flight search and booking
- Payment processing
- Admin operations
cd flight-booking-backend
# Run unit tests
pnpm run test
# Run tests in watch mode
pnpm run test:watch
# Run tests with coverage
pnpm run test:cov
# Run e2e tests
pnpm run test:e2ecd flight-booking-frontend
# Run linting
pnpm run lint-
Build the application
pnpm run build
-
Set production environment variables
-
Deploy to your preferred platform (Heroku, AWS, DigitalOcean, etc.)
-
Build the application
pnpm run build
-
Deploy to Vercel, Netlify, or your preferred hosting platform
flight-booking-backend/
βββ src/
β βββ admin/ # Admin dashboard functionality
β βββ auth/ # Authentication & authorization
β βββ booking/ # Flight booking management
β βββ database/ # Database configuration
β βββ flight/ # Flight management
β βββ notification/ # Email & SMS notifications
β βββ payment/ # Payment processing
β βββ rating/ # Flight rating system
β βββ review/ # Flight review system
β βββ user/ # User management
β βββ app.module.ts # Main application module
β βββ main.ts # Application entry point
βββ test/ # E2E tests
βββ uploads/ # File uploads directory
βββ package.json
flight-booking-frontend/
βββ src/
β βββ app/ # Next.js app router pages
β βββ lib/ # Utilities and configurations
β βββ types/ # TypeScript type definitions
βββ public/ # Static assets
βββ package.json
pnpm run start:dev- Start development server with hot reloadpnpm run build- Build the applicationpnpm run test- Run unit testspnpm run test:e2e- Run end-to-end testspnpm run lint- Run ESLintpnpm run format- Format code with Prettier
pnpm run dev- Start development serverpnpm run build- Build for productionpnpm run start- Start production serverpnpm run lint- Run ESLint
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the UNLICENSED License - see the LICENSE file for details.
If you encounter any issues or have questions, please:
- Check the existing issues on GitHub
- Create a new issue with detailed information
- Include steps to reproduce the problem
- Mobile application (React Native)
- Real-time flight tracking
- Multi-currency support
- Advanced search filters
- Loyalty program integration
- Social media integration
- Push notifications
- Offline support
- Multi-language support
- Flight comparison features
- API response caching
- Database query optimization
- Frontend code splitting
- Image optimization
- Error tracking and monitoring
Built with β€οΈ by OwaliShawon
Happy Flying!