LockLeaf is a self-hosted password manager backend built with Django + Django REST Framework.
Only the backend API exists right now. A Chrome extension and mobile app client are planned for the future.
- User accounts (custom
Usermodel) - JWT auth (access + refresh)
- “Master key” setup (stores an encrypted vault key per user)
- Vault unlock flow (short-lived vault unlock token)
- Vault items CRUD (with field-level encryption for sensitive fields)
- Django
- Django REST Framework
- SimpleJWT (
djangorestframework_simplejwt) - SQLite (dev)
cryptographydrf-spectacular
From the repo root:
- Create and activate a virtual environment
cd coreleaf
py -m venv .venv
.\.venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Run migrations
py manage.py migrate- Start the dev server
py manage.py runserverThe API will be available at http://localhost:8000/.
Base URL: http://localhost:8000/
- OpenAPI schema (JSON):
http://localhost:8000/api/schema/ - Swagger UI:
http://localhost:8000/api/schema/swagger-ui/ - ReDoc:
http://localhost:8000/api/schema/redoc/
POST /accounts/register/- create userPOST /accounts/token/- obtain JWT (access + refresh)POST /accounts/token/refresh/- refresh access tokenGET/PATCH /accounts/me/- get/update current userGET/PATCH /accounts/profile/<id>/- get/update user by idPOST /accounts/master-key/- set master key (one-time)
POST /vaults/unlock/- exchange master password for a vault unlock tokenGET/POST /vaults/list-create/- list or create vault itemsGET/PATCH /vaults/retrieve-update/<id>/- retrieve or update a vault item
- Most endpoints require:
Authorization: Bearer <access_token> - Vault item endpoints additionally require:
X-Vault-Unlock-Token: <vault_unlock_token>
This repo includes ready-to-run requests in dev_testing/example.http.
- Install the VS Code extension REST Client (publisher: Huachao Mao)
- Open dev_testing/example.http
- Run the requests in order:
- Register
- Get JWT token
- Set master key (one-time per user)
- Unlock vault (get
vault_unlock_token) - List/Create/Retrieve/Update vault items