This challenge demonstrates a REST API for a Loan Amortization app using the Python miniframework FastAPI.
It provides sereral key features:
-
Create a user
-
Create a loan
-
Fetch loan schedule
-
Fetch loan summary for a specific month
- Python >= 3.8.1
- Poetry
- Database migrations
- Docker
# Clone repository
$ git clone https://github.com/danielnegri/fastapi-challenge.git
# Install dependencies
$ pip3 install poetry
$ poetry use env 3.8
$ poetry shell
$ poetry install
Database Migrations:
$ export PYTHONPATH=$PWD
# Create database
$ alembic upgrade heads
# Seed database, create superuser
$ python app/pre_start.py # Create admin user
See Fast API: First Steps for instructions on setting up a local development environment.
$ uvicorn app.main:app --reload
$ docker build --rm --progress=plain -t fastapi-challenge .
$ docker run -it --rm -p 8000:80 fastapi-challenge
$ open http://localhost:8000/docs
For a more complete example including how to create users, loans and schedules, see the Tutorial - User Guide.
See CONTRIBUTING for details on submitting patches and the contribution workflow.
This repository is under the AGPL 3.0 license. See the LICENSE file for details.