GithubHelp home page GithubHelp logo

oxcened / my-flight Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 219 KB

A simple app that retrieves the cheapest flight from a DB

License: MIT License

PHP 17.52% JavaScript 4.47% HTML 1.63% TypeScript 74.81% CSS 1.58%
mysql php react tailwind typescript

my-flight's Introduction

🏝 MyFlight 🛩

A simple app that retrieves the cheapest flight from a DB

Key FeaturesHow To UseTestingTech StackLicense

screenshot

Key Features

  • Select departure and arrival airport
  • Airports are retrieved from DB
  • Easily swap departure and arrival airports
  • Find the cheapest flight, either direct or including up to 1 stopover
  • Renders any error from the API
  • Fully responsive
  • Unit and integration tested

How To Use

First Setup

To clone and run this application, you'll need Git installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/oxcened/my-flight

# Go into the repository
$ cd my-flight

# You are now ready to run!

Run Back-end

To run this application you will need a web server like Apache and a local MySQL DB. An easy way of accomplishing could be by using XAMPP.

Once you have that ready, follow these steps:

  • Prepare DB
    • Create a local MySQL DB and import the dump located in /api/dump.sql
    • Set your DB info in /utils/db_config.php
    • Make sure that your DB is up and running
  • Prepare web server
    • Place the application files in the htdocs folder or follow your web server procedure to serve the application
    • You may have to setup CORS on your web server
  • Connect Front-end
    • Create .env.local in /app/ and write inside of it: VITE_API_BASE_URL={your_web_server_host}/api/

Run Front-end

To run this application, you'll need Node.js (which comes with npm) installed on your computer. From your command line:

# Go into the repository
$ cd my-flight

# Install dependencies
$ npm install

# Run the app
$ npm run dev

Note If you're using Linux Bash for Windows, see this guide or use node from the command prompt.

Testing

To run unit and integration tests for the Front-end, do the following:

# Go into the app
$ cd my-flight/app

# Run the tests with Jest
$ npm run test

Tech Stack

  • Front-End
    • TypeScript v5
    • React v18
    • Vite.js v4
    • TailwindCSS
    • Jest + React Testing Library
  • Back-end
    • PHP v8.2
    • MySQL

License

This project is MIT licensed.


alenajam.dev  ·  GitHub @oxcened  ·  Twitter @oxcened

my-flight's People

Contributors

oxcened avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.