FlyByViews is an intelligent flight route planner that helps travelers discover scenic views and choose optimal airplane seats for sunrise/sunset viewing. The application analyzes geographical features along flight paths and calculates sun positions to provide personalized seat recommendations.
- Plan flight routes between any two cities worldwide
- Interactive map visualization with Leaflet and OpenStreetMap
- Real-time great-circle path calculation
- Discover mountains, volcanoes, and coastlines along your flight path
- Left/right side classification of scenic features
- Detailed scenery statistics and breakdown
- Sun Position Analysis: Real-time solar calculations for optimal sunrise/sunset viewing
- Time-based Recommendations: Suggests left or right window seats based on flight time
- Interactive Sun Tracking: Time slider to visualize sun position throughout the flight
- Night Flight Detection: Intelligent handling of nighttime flights
- Distance calculations and flight duration estimates
- Scenic feature counts by type (mountains, coastlines, volcanoes)
- Subsolar point tracking (where sun is directly overhead)
- React 17 - User interface framework
- Leaflet & React-Leaflet - Interactive maps
- Tailwind CSS - Utility-first CSS framework
- Axios - HTTP client for API requests
- Node.js - JavaScript runtime
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- Redis - Caching recent queries
- Nodemailer - Email service for OTP
- OpenStreetMap Nominatim - City coordinates geocoding
- Overpass API - Geographical feature data
- Custom astronomical calculations - Sun position algorithms
- Node.js (v16+ recommended)
- MongoDB (local installation or MongoDB Atlas)
- Redis (for caching)
- Git
git clone https://github.com/abdul8704/FlightBooking-clean.git
cd FlightBooking-cleancd servernpm installCreate a .env file in the server directory:
# Database
MONGODB_URI=mongodb://localhost:27017/flybyviews
# Or for MongoDB Atlas:
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/flybyviews
# Redis
REDIS_URL=redis://localhost:6379
# JWT Secrets
JWT_SECRET=your-super-secret-jwt-key-here
JWT_REFRESH_SECRET=your-refresh-token-secret-here
# Email Configuration (for OTP)
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-password
# API Configuration
USER_EMAIL=your-email@domain.com # Used for OpenStreetMap API requests
PORT=5000npm run dev
# Server runs on http://localhost:5000cd clientnpm installnpm run dev
# Client runs on http://localhost:5173Open your browser and navigate to:
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
- Navigate to the Flight Route Planner page
- Enter your source city (e.g., "Chennai")
- Enter your destination city (e.g., "Srinagar")
- Optionally add a departure time for sun calculations
- Click "Plan Route & Show Scenery"
- View the interactive map showing your flight path
- Examine scenic statistics showing mountains, coastlines, and volcanoes on left/right sides
- Click on map markers to see feature details
- If you provided a departure time, see smart seat recommendations
- Use the time slider to track sun position throughout your flight
- Choose between sunrise/sunset viewing or scenic features
- The yellow dot shows where the sun is directly overhead
- Drag the slider to see sun movement during your flight
- Get real-time guidance on which side to look for the sun
POST /api/flights/route-scenery- Get scenic features along a flight route
POST /auth/signup- User registrationPOST /auth/login- User loginPOST /auth/send-otp- Send OTP for password resetPOST /auth/verify-otp- Verify OTPPOST /auth/reset-password- Reset password
The application uses precise astronomical algorithms to calculate:
- Solar azimuth and altitude at any time and location
- Subsolar point (where sun is directly overhead)
- Relative bearing from aircraft heading to sun position
- Implements great circle interpolation for accurate flight paths
- Accounts for Earth's curvature in route calculations
- Provides smooth geodesic visualization
- Determines if scenic features are visible on left or right side of aircraft
- Uses cross-product mathematics for precise spatial classification
FlightBooking-clean/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Main application pages
β β βββ utils/ # Helper functions & calculations
β β βββ api/ # API configuration
β βββ package.json
βββ server/ # Node.js backend
β βββ src/
β β βββ controllers/ # Request handlers
β β βββ models/ # Database schemas
β β βββ routes/ # API route definitions
β β βββ services/ # Business logic
β β βββ utils/ # Helper utilities
β β βββ config/ # Database & app configuration
β βββ package.json
βββ instructions/ # Documentation
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- OpenStreetMap community for geographical data
- Leaflet for excellent mapping library
- Overpass API for efficient geographical queries
- Nominatim for city geocoding services
Built with β€οΈ for travelers who love scenic flights