Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Belskap

FastAPI backend for Belskap. The first API supports creating an account with an email and password. Passwords are stored as Argon2 hashes, never as plain text.

Project structure

belskap/
├── backend/       FastAPI application, migrations, and tests
├── frontend/      Next.js authentication UI and dashboard
└── compose.yaml   Runs the project's containerized services

Run with Docker

Docker Compose starts both the API and PostgreSQL, applies database migrations, and persists PostgreSQL data in a named volume:

docker compose up --build

Open the frontend at http://localhost:3000 or the interactive API docs at http://localhost:8000/docs.

Register an account

Invoke-RestMethod -Method Post `
  -Uri http://localhost:8000/api/v1/auth/register `
  -ContentType "application/json" `
  -Body '{"email":"user@example.com","password":"a-secure-password"}'

The endpoint returns the user's ID, normalized email, and creation date. A duplicate email returns HTTP 409 and invalid input returns HTTP 422.

Run locally without Docker

Create a PostgreSQL database, copy .env.example to .env, then install and run:

cd backend
Copy-Item .env.example .env
pip install -e ".[dev]"
alembic upgrade head
python main.py

From the backend directory, run tests with pytest.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages