This project contains a REST API for performing CRUD operations on the Python Panama group's website database.
The project was built with Flask, using SQLAlchemy, Marshmallow, and JWT_Extended. For testing, we used UnitTest.
To use the project in your development machine, clone it, and go to the project's root:
git clone https://github.com/pythonpanama/python-panama-backend.git
cd python-panama-backend
To run the development and the testing databases, go to the postgresql
directory
and run docker-compose
:
cd postgresql
docker-compose up --build -d
Go back to the project's root:
cd ..
From the project's root, create and activate your virtual environment:
python3 -m venv venv
. venv/bin/activate
And install the project's dependencies:
pip install -r requirements.txt
Familiarize yourself with the codebase and modify as needed. Important packages and modules are:
app.py
Contains the Flask application factory.auth.py
Uses flask_jwt_extended for fine-grained authentication/authorization.config.py
Contains the configuration classes.models/
Contains the SQLAlchemy models.resources/
Contains the API resources and endpoints.schemas/
Contains the Marshmallow schemas.tests/
Contains the UnitTests.
Push your changes to the dev
branch
git push origin dev
I will merge your changes with the main
branch after reviewing them.
To insure code quality, please add relevant tests for all production code additions/modifications.
Make sure the virtual environment is activated before running the tests.
To run the tests use:
python -m unittest tests/**/*
If you wish to run the tests with coverage, use instead:
coverage run -m unittest tests/**/*
The included tests provide 99% coverage for the codebase. You can find the coverage report here.
👤 Javier Feliu
- Twitter: @JavierFeliuA
- Github: @wanderindev
- Email: javier@wanderin.dev
Give a ⭐️ if this project helped you!
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator