Skip to content

koksalkapucuoglu/track-flight-app

Repository files navigation

trackflight app

Tech Stack

Core Tech: Python

Backend Service: Django, Django Rest Framework

Database: Mysql

Test Django Test, Flake8, Factory Boy

CI/CD Docker, Github Actions

Documentation: Swagger

Features

  • Management of airport list and flight list
  • Track of flight count
  • Better documentation using Swagger
  • Better system to using test-driven development
  • Continuous Integration for deployment

Run Locally

Clone the project

  git clone https://github.com/koksalkapucuoglu/track-flight-app.git

Go to the project directory

  cd track-flight-app

Create python env

  python -m venv env

Activate enviroment

  source env/Scripts/activate

or

  env\Scripts\activate

Install requirements

  pip install -r requirements.txt
  pip install -r requirements_dev.txt

Setup MySQL Enviroment

  1. Install XAMPP and run
  2. Start Apache and MySQL module
  3. Go to MySQL dashboard.
  4. Create database as trackingFlightDatabase
  5. Import dataset using trackingflightdatabase_old.sql file

Detect django model changes

  python manage.py makemigrations

Apply django model changes

  python manage.py migrate

Run django project

  python manage.py runserver

Airport List

Flight List

Flight Count

Swagger

  1. Go to http://localhost:8000/swagger to see Swagger documentation for API endpoints.

Swagger Endpoint List

Create Airport

Create Flight

Get Flight Count

Run Django admin dashboard

  1. Setup a password to login to the Django admin dashboard.
$ python manage.py createsuperuser
  1. Go to http://localhost:8000/admin and login to the dashboard using username admin and the password you chose in step 1 above.

Run tests and check code coverage

-> -v {0 ,1 ,2 ,3} is verbocity, verbosity is for detailed display of test results

python manage.py test -v 2 
coverage run manage.py test
coverage report 

Test Results

Coverage Result and Report

Lint your code

flake8 <dir>

Lint Results

Run the app inside a Docker container

  1. Build the docker container and get it up and running.
$ docker-compose build
$ docker-compose up
  1. Setup database tables by running migrations.
$ docker-compose run --rm web python manage.py makemigrations
$ docker-compose run --rm web python manage.py migrate

About

This app allow to track flights

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published