/auth-api

Simple Authentication API made in FastAPI

Primary LanguagePythonMIT LicenseMIT

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