SuiOni / fast-api-sample-project

This is a fast api sample project for the arc.dev application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fast-api-sample-project

Welcome to the arc dev challenge solution of Sakander Zirai arc.dev/@SuiOni πŸ‘‹

Go to https://ideas-projects.herokuapp.com/api/v1 to see Swagger API Documentation for this project πŸ‘€

Backend is written in Python3 with the FastAPI Framework 🏎

More details: https://www.codementor.io/@codementorx/draft/ixvyx7tvj?utm_swu=4667

Change log

  • Refactor architecture into python sub packages
  • Using SQLAlchemy models
  • Using seperate crud logic for easy extensibility
  • Using environment variables for enhanced security
  • Use real PostgreSQL Database hosted in Heroku
  • Host App itself with Heroku => changed api url
  • CI/CD: Auto deployment
  • Added script for linting and formatting
  • DB initialisation scripts
  • Using versionised endpoints "api/v1"
  • Fixing potential thread unsafe code

Folder Structure

β”œβ”€β”€ Procfile
β”œβ”€β”€ README.md
β”œβ”€β”€ app
β”‚   β”œβ”€β”€ api
β”‚   β”‚   β”œβ”€β”€ api_v1
β”‚   β”‚   β”‚   β”œβ”€β”€ api.py
β”‚   β”‚   β”‚   └── endpoints
β”‚   β”‚   β”‚       β”œβ”€β”€ auth.py
β”‚   β”‚   β”‚       β”œβ”€β”€ ideas.py
β”‚   β”‚   β”‚       β”œβ”€β”€ index.py
β”‚   β”‚   β”‚       └── users.py
β”‚   β”‚   └── deps.py
β”‚   β”œβ”€β”€ core
β”‚   β”‚   β”œβ”€β”€ config.py
β”‚   β”‚   └── security.py
β”‚   β”œβ”€β”€ crud
β”‚   β”‚   β”œβ”€β”€ crud_idea.py
β”‚   β”‚   └── crud_user.py
β”‚   β”œβ”€β”€ db
β”‚   β”‚   β”œβ”€β”€ base.py
β”‚   β”‚   β”œβ”€β”€ base_class.py
β”‚   β”‚   β”œβ”€β”€ init_db.py
β”‚   β”‚   └── session.py
β”‚   β”œβ”€β”€ initial_data.py
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ models
β”‚   β”‚   β”œβ”€β”€ idea.py
β”‚   β”‚   └── user.py
β”‚   β”œβ”€β”€ pre_start.py
β”‚   β”œβ”€β”€ schemas
β”‚   β”‚   β”œβ”€β”€ token.py
β”‚   β”‚   └── user.py
β”‚   └── utils.py
β”œβ”€β”€ requirements.txt
└── scripts
    β”œβ”€β”€ format-imports.sh
    β”œβ”€β”€ format.sh
    └── lint.sh

About

This is a fast api sample project for the arc.dev application.


Languages

Language:Python 98.2%Language:Shell 1.8%