vinkomlacic / auth-api

Simple Authentication API made in FastAPI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

auth-api

Simple Authentication API made in FastAPI

Endpoints

  • [POST] /users - registers a new user
  • [POST] /token - retrieves an access token provided the credentials
  • [GET] /user/me - retrieves the current user (protected by authentication)

Quickstart for local development

  1. Setup the virtual environment and install packages from requirements.txt
pip install -r requirements.txt
  1. Copy example.env file and fill it out with correct values
  2. Start the postgres database - for your convenience you can use docker/docker-compose.yml
cd docker
docker-compose up -d
  1. Run migrations (do this only the first time)
alembic upgrade head
  1. Run the server
python -m uvicorn app.main:app --reload

About

Simple Authentication API made in FastAPI

License:MIT License


Languages

Language:Python 94.6%Language:Mako 4.4%Language:Shell 1.0%