Backend platform for Hybrid Biometric Merchant Payment System (Single Device).
- Python 3.11+ with FastAPI
- Supabase (PostgreSQL + pgvector + Auth + Storage + Realtime)
- SQLAlchemy 2.0 for ORM
- InsightFace (ArcFace) for face recognition
- ONNX Runtime for ML inference
git clone <repo-url>
cd smart-access-apipython -m venv .venv
source .venv/bin/activateUntuk development (tanpa InsightFace/ONNX, lebih ringan):
pip install -r requirements-dev.txtUntuk production (lengkap dengan biometric ML):
pip install -r requirements.txtcp .env.example .envEdit .env dan isi variabel berikut:
| Variabel | Keterangan |
|---|---|
SUPABASE_URL |
URL project Supabase kamu |
SUPABASE_KEY |
Anon/public key Supabase |
SUPABASE_SERVICE_ROLE_KEY |
Service role key Supabase |
DATABASE_URL |
Connection string PostgreSQL (format: postgresql+asyncpg://user:pass@host:port/db) |
JWT_SECRET_KEY |
Secret key untuk signing JWT token |
KGITON_API_KEY |
API key untuk integrasi KGiTON (IoT device) |
docker compose up db -dDatabase PostgreSQL akan berjalan di port 5433.
python seed.pyuvicorn app.main:app --reload --host 0.0.0.0 --port 8000docker compose up --buildAPI akan tersedia di http://localhost:8000.
app/
├── main.py # FastAPI application entry
├── config.py # Settings / environment config
├── dependencies.py # Dependency injection
├── api/v1/ # API route handlers
│ ├── router.py # Main v1 router
│ └── endpoints/ # Endpoint modules
├── models/ # SQLAlchemy ORM models
├── schemas/ # Pydantic request/response schemas
├── services/ # Business logic layer
├── core/ # Core utilities (security, db, exceptions)
└── middleware/ # Custom middleware
Once running, visit:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc