This project is an implementation of the assignment for the Wolt Software (Backend) 2024 Summer Internship. It includes a delivery fee calculation service built with FastAPI and is designed to showcase best practices in code quality, maintainability, and testing.
To get a local copy up and running, follow these simple steps.
Ensure you have Python 3.8+ installed on your system. You can check your Python version by running:
python --version- Clone the repo
git clone https://github.com/EhsanKA/fastApiDFC.git
cd fastApiDFC- Install the required packages:
pip install -r requirements.txtTo run the FastAPI application locally, use the following command:
uvicorn app.main:app --reloadThe API will be available at http://127.0.0.1:8000/orders/ or to have it tested, use http://127.0.0.1:8000/docs/.
Before running the tests, set the PYTHONPATH environment variable to ensure the test framework can locate all necessary project files.
export PYTHONPATH=$PYTHONPATH:/path/to/your/projectReplace /path/to/your/project with the actual path to your project directory.
Navigate to the tests directory and run the tests using pytest:
cd tests
pytest unit_test.py
pytest integration_test.pyOur project uses GitHub Actions for Continuous Integration and Continuous Deployment, ensuring that every change is automatically tested and stable before being merged into the master branch.
The CI/CD pipeline is defined in the .github/workflows/main.yaml file. This workflow triggers on every push to the master branch
Ehsan Karimiara
- @ehsan-ka on Linkedin
- E.karimiara@gmail.com
- @EhsanKA on Github