FastyAPI
A FastAPI based Stack boilerplate for heavy loads.
Explore the docs »
View Demo · Report Bug · Request Feature
Table of Contents
About The Project
FastyAPI is a FastAPI based Stack boilerplate designed for heavy workloads and simple developement in mind.
Here's why:
- FastAPI provides such a great developement experience due to its simple structure and the auto generated docs.
- we've improves this further by providing you with a simple design pattern, no subfolders <3
- every Stack element is carefully chosen and tested/optimised against heavy workloads
- boiletplate code for different situations, websocket, crud etc.. yet without bloat.
Built With
Our stack is as follows
- Gunicorn is a Python Web Server Gateway Interface (WSGI) HTTP server. It is a pre-fork worker model
- Gunicorn would act as a process manager, listening on the port and the IP. And it would transmit the communication to the worker processes running the Uvicorn class.
- FastAPI is a Web framework for developing RESTful APIs in Python.
- minimalistic, simple and scales well
- Celery soon + optional
- Flower soon + optional
- Redis is an in-memory data structure store, used as a distributed, in-memory key–value database, cache and message broker
- Motor presents a coroutine-based API for non-blocking access to MongoDB
- MongoDB is a source-available cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas.
- Sharding is the process of storing data records across multiple machines and it is MongoDB's approach to meeting the demands of data growth.
- Docker container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.
Getting Started
Set of instructions to get started with FastyAPI
Prerequisites
- Python3
- pip3
- venv
python3 -m pip install --user virtualenv
Environment setup
- Create the environment
python3 -m venv .
- Activate the environment
source env/bin/activate
Installation
- Clone the repo
git clone https://github.com/achaayb/FastyAPI
- Install the dependencies
cd FastyAPI pip3 install -r requirements.txt
Running and testing
- run uvicorn
uvicorn app:app --reload
- test the app
- navigate to : http://localhost:8000
- response should be something like this :
{"data":"","code":"success","message":"FastyAPI live!"}
Roadmap
- Base boilerplate
- Follow a naming convention
- Add comments and stuff
- Optimise the base boilerplate
- Finish up the base stack
- Gunicorn w/uvicorn workers
- FastAPI
- Motor
- Mongodb (sharding)
- Stress test 1
- Normal test (fork)
- Websocket stress (fork)
- implement stack extentions
- Celery
- Redis
- Flower
- Stress test 2
- Normal test (fork)
- Cpu bound operations test (fork)
- Docker
See the open issues for a full list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt
for more information.
Project Link: https://github.com/achaayb/FastyAPI