Skip to content

Plane Scape is a web application designed for users to search, filter, and book flights easily, offering a seamless travel planning experience.

Notifications You must be signed in to change notification settings

ertugrulsertaslan/plane-scape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Plane Scape ✈️🌍

Plane Scape is a web application designed for users to search, filter, and book flights easily, offering a seamless travel planning experience.

Screenshots πŸ“Έ

Home Page πŸŽ₯

Home Page

Flights Page ✈️

FlightsPage

Filter Home Page πŸ”

movie-card movie-card

Login And Register Page πŸ”

loginPage registerPage

Mobile Screens πŸ“Έ πŸ“± ⬇️

Home Page πŸ“±

homepageMobilPage1 homepageMobilPage2 homepageMobilMenu

Flights Page ✈️

FlightsPageMobil

Features ✨

  • πŸ›« User Registration & Login: Users can create accounts and log in to access personalized features. for each transaction.
  • ✈️ Flight Browsing: Browse through available flights with detailed information.
  • πŸ” Advanced Filtering: Filter flights by airport, date, time, layovers, and direction (one-way or round-trip).
  • πŸ—“οΈ Reservation Management: Users can reserve flights, with bookings listed on their flights page.
  • πŸ–ΌοΈ Responsive Design: Adaptable interface that works on different screen sizes.
  • 🚫 Animation on No Results: Engaging animations display when no flights match the selected filters.
  • πŸ”” Notification Messages: Error and success notifications are displayed throughout the application for user actions such as registration, login, filtering and reservation.

Technologies Used πŸ’»

Frontend 🌐

  • πŸ“¦ Vite - Module bundler
  • πŸ’» React.js - JS library for crafting user interfaces
  • 🎨 Tailwind CSS - A utility-first CSS framework
  • βš™οΈ Material-UI (MUI) - React components for faster and easier web development.
  • πŸ–ΌοΈ React Icons - A library of popular icons for React applications
  • πŸ“¬ Notistack - Notification library for React
  • 🌐 Axios - Promise-based HTTP client for making API requests.
  • πŸ›€οΈ React Router - Declarative routing for React applications.

Backend πŸ”§

  • πŸš€ Express.js - Web framework for Node.js
  • 🌐 Cors - Mechanism for integrating applications
  • βš™οΈ Dotenv - A zero-dependency module that loads environment variables from a .env file into process.env
  • πŸ”’ Bcrypt - A library to help you hash passwords.
  • πŸ“‚ Multer - A middleware for handling multipart/form-data in Node.js, primarily used for uploading files.
  • πŸ’Ύ Google Cloud Storage: - For interacting with Google Cloud Storage.
  • 🧁 Body-parser - Middleware for parsing the body of HTTP requests.
  • πŸͺ Cookie-parser - For handling cookies.
  • πŸ”‘ Jsonwebtoken - For creating and verifying JSON Web Tokens.
  • πŸ‘¨β€πŸ’» Nodemon - Automatically restarts the application when file changes are detected.

Database πŸ—ƒοΈ

  • πŸ›’οΈ Prisma - Prisma ORM is an open-source next-generation ORM
  • ☘️ MongoDB Atlas Cloud Database - Cloud-based NoSQL database for storing and managing data.
  • ☁️ Google Cloud Console - Platform for managing Google Cloud services, including Cloud Firestore and Google Cloud Storage.

Installation πŸ› οΈ

Prerequisites

  • Install Node.js βš™οΈ
  • Clone the repo πŸ”„

πŸ“¦ After cloning the repo install dependecies with

  1. Open up two terminal instances and run scripts below in directories /server and /client
  • Server 🌐
   npm i && npm run dev
  • Client πŸ“±
   npm i && npm run dev

after running scripts go to http://localhost:5173 with your browser to use the app. 🌐

API Usage: Schiphol Airport Flights ✈️

To list flights from Schiphol Airport, you need to use the Flight V4 API. Follow these steps:

  1. Create an Account:

  2. Obtain Credentials:πŸ”‘

    • After creating an account, retrieve your Application ID and Application Key for the Flight V4 API.
  3. API Endpoint:

    • Use the endpoint for fetching flights. No additional external processes are required.

You will use these credentials in your application to make API requests.

Setting Up the .env File βš™οΈ

  1. Cloning the Project: πŸ”„

    • Once you've cloned the project, you'll need to create a .env file.
    • I've included an .env.example file with detailed instructions on which environment variables the project requires and how to set them up.
  2. Creating the .env File: πŸ“

    • Start by copying the .env.example file and creating a new file named .env.
    • Make sure to fill in the contents of the .env file.
  3. Defining Environment Variables: πŸ”§

  • In the .env file, define the following variables for your API calls:

      # API credentials
        APPLICATION_ID=your_application_id
        API_KEY=your_api_key
    
      # Base URL for the API
        BASE_URL=https://api.yourservice.com/v1/flights
  • Or you can use json web token and db

      # API credentials
        ACCESS_SECRET_TOKEN=your_access_token
        REFRESH_SECRET_TOKEN=your_refresh_token
        DATABASE_URL=your_db_url

User Photo Storage in Google Cloud Storage πŸ“·β˜οΈ

This section outlines the steps to store user-uploaded photos in a Google Cloud Storage bucket within your application.

Steps to Store User Photos πŸ“Έ

1. Set Up Google Cloud Project 🌐

2. Enable Cloud Storage API ⚑

  • Navigate to APIs & Services > Library.
  • Search for Cloud Storage and enable the API.

3. Create a Cloud Storage Bucket πŸ—„οΈ

  • Go to Cloud Storage > Buckets.
  • Click on Create Bucket.
  • Choose a globally unique name and select the desired location and storage class.

4. Set Permissions πŸ”‘

  • Under Permissions, set the necessary roles for your application to access the bucket (e.g., Storage Object Admin).
  • If using service accounts, create one and download the JSON key.

5. Install Google Cloud Storage Client Library πŸ’»

  • In your Node.js project, run:

     npm install @google-cloud/storage

6. Configure Authentication πŸ”’

  • Set the environment variable for Google credentials:

     export GOOGLE_APPLICATION_CREDENTIALS="path/to/your/service-account-file.json"

7. Implement File Upload Logic πŸ“€

  • Use Multer to handle file uploads in your Express app:
  import multer = from 'multer';
  import  { Storage } from "@google-cloud/storage";

  const storage = new Storage();
  const bucket = storage.bucket('your-bucket-name');

  const upload = multer({ storage: multer.memoryStorage() });

app.post('/upload', upload.single('photo'), (req, res) => {
  const blobStream = bucket.file(req.file.originalname).createWriteStream({ resumable: false });

 blobStream
   .on('error', (err) => res.status(500).send(err))
   .on('finish', () => res.status(200).send('File uploaded successfully.'))
   .end(req.file.buffer);
});

8. Access Uploaded Files πŸ“‚

  • Files can be accessed via their public URLs if set, or programmatically through the Google Cloud Storage client.

Usage Details πŸ“‹

  1. User Registration and Login πŸ”: To use the application, you need to create an account first. After registering, you can log in to access personalized features.

  2. Flight Search ✈️: From the homepage, you can search for available flights and view detailed information. You can filter search results by airport, date, time, and number of layovers.

  3. Reservation Management πŸ—“οΈ: After making a flight reservation, you can view your bookings on the "My Flights" page.

  4. Responsive Design πŸ“±: The application adapts to different screen sizes, providing a seamless experience on mobile devices.

  5. Notifications πŸ””: You will receive error and success notifications for actions such as registration, login, filtering, and reservation.

License πŸ“„

MIT

Releases

No releases published

Packages

No packages published

Languages