GithubHelp home page GithubHelp logo

solnsumei / fastapi-template Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 20 KB

Starter template for building REST APIs using FastAPI and Tortoise-ORM

Python 100.00%
fastapi-template fastapi fastapi-tortoiseorm fastapi-with-tortoise-orm fastapi-starter-template python-async-api-setup fastapi-async-db tortoise-orm python

fastapi-template's Introduction

FastAPI Starter Template

Starter template for building REST APIs using FastAPI and tortoise ORM

Features

  • JWT Authentication
  • Roles and Permissions
  • Database migrations
  • Routing
  • Test Setup

Built with

  • Python FastAPI
  • Tortoise ORM
  • RDMS(Sqlite / MySQL / PgSQL)
  • Uvicorn

Usage

  • Clone this repository
  • Change .env.example.txt to .env
  • Fill in the environment variables
  • Run pip install -r requirements.txt to install requirements
  • Run uvicorn main:app
  • Happy usage

Migrating your database

  • Create your database
  • Delete the initial migration file in the migration folder if any
  • Define your models in the models folder provided
  • CD into project directory and run aerich init-db from your terminal to migrate initial data
  • To update your db models, change the model definition and run aerich migrate --name <example_update>
  • Run aerich upgrade to upgrade to the latest version
  • To downgrade, run aerich downgrade
  • To show history, run aerich history
  • To show heads to be migrated, run aerich heads

License

  • MIT License

Credits

fastapi-template's People

Contributors

solnsumei avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

editorgit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.