/sanic-tortoise-user-api

Creating a user api to learn Sanic and TortoiseORM

Primary LanguagePython

Sanic Tortoise User API

A simple user API to learn how to use Sanic and Tortoise-ORM

Enviroment Variables

To run this project, you will need to add the following variables to your environment or .env

PROJECT_KEY -> Secret to make JWTs and other security related features, you can use:

  openssl rand -hex 32

DATABASE_URI -> URI with schema to connect to db, Ex: sqlite://db.sqlite3

Authors

Features

  • Register
  • Login
  • Logout
  • Profile CRUD

Setup

Install sanic-tortoise-user-api with poetry

  cd sanic-tortoise-user-api
  poetry install

Or

  cd sanic-tortoise-user-api
  docker compose up -d

Roadmap

  • Add unit tests

Project Stack

Back-end: Python, Sanic, TortoiseORM

Deploy

To build project:

  docker build -t sanic-tortoise-user-api:latest .
  • Docker exposes port 8000

Run locally

Clone the project

  git clone https://github.com/guscardvs/sanic-tortoise-user-api

Enter project directory

  cd sanic-tortoise-user-api

Install packages

  poetry install

Start the Server (Port 5000)

  make run-dev