A simple login system with FastAPI + SQLite as backend + database and Vanilla JS as frontend.
Python 3.10+
SQLite3
OpenSSL
Linux Bash / Windows Powershell
# Install the python packages needed
$ pip install -r requirements.txt
$ cp .env.example ./app/.env.local
$ cd app/
# Generate a secret key for JWT authentication
$ openssl rand -hex 32 # copy the output
# Use your favourite text editor to open the .env.local file
# Paste the secret key to the SECRET_KEY field
$ docker build -t <your-image-name>:<tag> .
Manual
$ cd app/
# Testing
$ uvicorn main:app --reload
# Production
$ uvicorn main:app --host 0.0.0.0 --port <desired-port>
Docker
$ docker run -d -p <host-port>:8000 --name <your-container-name> <your-image-name>
1. Run the FastAPI server
2. Open a Web Browser and navigate to localhost:8000
3. Login if you already have an account, otherwise click register and register an account.
4. Successfully login to the Home Page!