Skip to content

This is a simple API written in Python using the FastAPI framework. It allows users to create charity projects and make donations. The distribution of funds between the charity projects is done automatically under the hood.

Notifications You must be signed in to change notification settings

Kapshtyk/cat_charity_fund

Repository files navigation

Quality gate

FastAPI testing workflow

Cat charity project QRKot

This is a simple API written in Python using the FastAPI framework. It allows users to create charity projects and make donations. The distribution of funds between the charity projects is done automatically under the hood.

Main technologies:

  • FastAPI
  • SQL Alchemy
  • Alembic

Main features

  • User can view the list of charity projects and his donations.
  • Superuser can create the charity project with unique name, description and required funding amount.
  • Superuser can delete the charity projects without investments.
  • Superuser can change the name of the charity project or update the required funding amount.
  • Any registered user can make a donation. Information about the target charity project is not allowed for users.
  • After creating a new project or donation, the investment process comes to action. Free money will be invested in the new charity project and visa versa.

Getting Started

  1. Clone this repository to your local machine.
git clone [email protected]:Kapshtyk/cat_charity_fund.git
cd cat_charity_fund
  1. Set up a virtual environment and install the required packages from the requirements.txt file.
python3 -m venv venv

MacOS/Linux:

source venv/bin/activate

Windows:

source venv/scripts/activate
pip install -r requirements.txt
  1. Create .env file in the root of the project (you can use .env.example as a reference)
  2. Initialise the database (SQLite) for development.
alembic upgrade head
  1. Start the FastAPI application.
uvicorn app.main:app
  1. During the first run of the application a superuser with email [email protected] and password admin will be created (if you didn't change the credentials in the .env). These credentials can be used to access the API features via Postman or Swagger (see below).

User Interface

This project only provides the API, so you will need to use Postman (or another similar tool) to interact with the application. Another option is to use the Swagger documentation at http://localhost:8000/docs. You will need to authorise yourself using the Authorise button.

Swagger documentation screenshot

desktop

Acknowledgments

This project was created as part of a sprint assignment. Thank you for checking it out!

Author

About

This is a simple API written in Python using the FastAPI framework. It allows users to create charity projects and make donations. The distribution of funds between the charity projects is done automatically under the hood.

Topics

Resources

Stars

Watchers

Forks