Skip to content

A modern flight search and cost monitoring application built with Next.js and NestJS. FCM provides real-time flight information and cost tracking using the Amadeus API, wrapped in a user-friendly interface.

License

Notifications You must be signed in to change notification settings

ogghst/flight-cost-monitor

Repository files navigation

Flight Cost Monitor (FCM)

A modern flight search and cost monitoring application built with Next.js and NestJS. FCM provides real-time flight information and cost tracking using the Amadeus API, wrapped in a user-friendly interface.

License: MIT Built with Turbo Powered by Next.js NestJS

Features

Flight Search

  • Simple and advanced search options
  • Multi-city routing support
  • Real-time pricing updates
  • Flexible date options
  • Customizable search filters

Search Management

  • Save and name frequent searches
  • Search history tracking
  • Favorite searches feature
  • Easy search reload

User Features

  • GitHub and Google OAuth authentication
  • Personalized search history
  • User preferences
  • Customizable alerts

User Interface

  • Modern Material UI design
  • Responsive layout
  • Real-time notifications
  • Comprehensive error handling

Quick Start

Prerequisites

  • Node.js >= 20
  • pnpm >= 9.15.5
  • Docker and Docker Compose (for containerized deployment)
  • Amadeus API credentials
  • GitHub OAuth credentials

Installation

  1. Clone the repository
git clone https://github.com/yourusername/flight-cost-monitor.git
cd flight-cost-monitor
  1. Install dependencies
pnpm install
  1. Set up environment variables
# Create environment files
cp apps/fcm-api/.env.example apps/fcm-api/.env
cp apps/fcm-webui/.env.example apps/fcm-webui/.env
  1. Start development servers
# Start all services
pnpm dev

# Or start individual services
pnpm --filter @fcm/api dev
pnpm --filter @fcm/webui dev

Docker Deployment

  1. Build images
pnpm docker:build
  1. Start services
pnpm docker:up

Project Structure

flight-cost-monitor/
├── apps/
│   ├── fcm-api/         # NestJS backend service
│   └── fcm-webui/       # Next.js frontend application
├── packages/
│   ├── eslint-config/   # Shared ESLint configuration
│   ├── fcm-shared/      # Shared business logic and types
│   ├── fcm-shared-webui/# Shared UI components
│   ├── jest-config/     # Shared Jest configuration
│   └── typescript-config/# Shared TypeScript configuration
└── docs/               # Project documentation

Tech Stack

Frontend (@fcm/webui)

  • Next.js 15
  • React 19
  • Material UI 6
  • TypeScript
  • React Query for data fetching
  • Next Auth for authentication

Backend (@fcm/api)

  • NestJS 10
  • TypeScript
  • Prisma ORM
  • JWT authentication
  • Swagger/OpenAPI documentation

Shared Infrastructure

  • Monorepo using Turbo
  • pnpm for package management
  • Docker containerization
  • ESLint with flat config
  • Jest for testing

Documentation

Available Scripts

Root Directory

  • `pnpm dev` - Start development servers
  • `pnpm build` - Build all packages and applications
  • `pnpm test` - Run unit tests
  • `pnpm test:e2e` - Run end-to-end tests
  • `pnpm lint` - Lint all packages
  • `pnpm format` - Format code using Prettier

Docker Commands

  • `pnpm docker:build` - Build Docker images
  • `pnpm docker:up` - Start Docker containers
  • `pnpm docker:down` - Stop Docker containers

Package-Specific Commands

# Run commands for specific packages
pnpm --filter @fcm/api dev
pnpm --filter @fcm/webui build

Development

IDE Setup

FCM is optimized for Visual Studio Code with the following extensions:

  • ESLint
  • Prettier
  • Docker
  • TypeScript and JavaScript Language Features

Adding Dependencies

# Add to root
pnpm add -w package-name

# Add to specific package
pnpm --filter package-name add dependency-name

Environment Setup

Configure the following environment variables:

Web UI (.env.local)

AUTH_GITHUB_ID=your_github_id
AUTH_GITHUB_SECRET=your_github_secret
AUTH_SECRET=your_secret_key

API (.env)

JWT_SECRET=your_jwt_secret
AMADEUS_CLIENT_ID=your_amadeus_id
AMADEUS_CLIENT_SECRET=your_amadeus_secret

API Documentation

Access the API documentation at:

Testing

Unit Tests

# Run all tests
pnpm test

# Run specific package tests
pnpm --filter @fcm/api test

E2E Tests

# Run all E2E tests
pnpm test:e2e

Coverage Reports

Coverage reports are generated in the `coverage` directory of each package.

Contributing

  1. Fork the repository
  2. Create your feature branch (`git checkout -b feature/amazing-feature`)
  3. Commit your changes (`git commit -m 'Add some amazing feature'`)
  4. Push to the branch (`git push origin feature/amazing-feature`)
  5. Open a Pull Request

Style Guide

  • Use TypeScript for all code
  • Follow ESLint configuration
  • Use Prettier for formatting
  • Follow conventional commits

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, email support@example.com or join our Slack channel.

Acknowledgments

  • Amadeus API for flight data
  • Next.js team for the amazing framework
  • NestJS team for the robust backend framework
  • All contributors who have helped shape FCM

About

A modern flight search and cost monitoring application built with Next.js and NestJS. FCM provides real-time flight information and cost tracking using the Amadeus API, wrapped in a user-friendly interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published