Code Monkey home page Code Monkey logo

kami_airline_backend's Introduction

Kami Airline Project

Setup and Execution Instructions

Step 1: Clone the Project

Clone the repository using the command:

git clone https://github.com/brianhuynh2021/kami_airline_backend.git

Step 2: Build and Run with Docker

Execute the following command to build and start the Docker containers:

docker compose up --build

Verify if Docker containers are running: docker ps

Docker Verification

Run source code manually

  • First, activate virtual environment: If macOS: source venv/bin/activate or Windows: venv\Scripts\activate

  • pip install -r requirements.txt

  • python manage.py runserver 0.0.0.0:8000

Testing the API

You can test the API using Postman

  • Postman: Configure a new request in Postman as follows:
  • URL: localhost:8000/api/airplane/
  • Method: POST
  • Body: {"id": 1, "passengers": "17"} [ { "id": 1, "passengers": 100 }, { "id": 2, "passengers": 150 } ]

Running Unit Tests

Use the following methods to run unit tests:

  • Via Virtual Environment: Activate the virtual environment and then run the tests:
  • macOS: source venv/bin/activate
  • Windows: venv\Scripts\activate

python manage.py test

Unit Test in Virtual Environment

  • Via Docker CLI: Open the Docker CLI and execute:

python manage.py test

Unit Test in Docker CLI

kami_airline_backend's People

Contributors

brianhuynh160922 avatar

Watchers

Brian 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.