SubTracker is a local-first subscription tracking backend demo focused on privacy, explainability, and realistic fintech workflows. It ingests transaction data (seeded or Plaid Sandbox), detects recurring subscriptions, and parses invoices via AWS Textract (mocked by default).
Highlights:
- End-to-end subscription detection pipeline
- Privacy-first design (local SQLite, no real bank data by default)
- Testable REST API with OpenAPI / Swagger UI
- Deterministic demo flows (seeded data + mock OCR)
- Production-oriented structure (tests, CI, Docker)
docker compose up --buildOpen:
http://localhost:5000/docs
Prerequisites: Python 3.10-3.12 (recommended 3.11).
cd backend
pip install -r requirements.txt
copy .env.example .env
python app.pyAPI docs:
- Swagger UI:
http://localhost:5000/docs - OpenAPI JSON:
http://localhost:5000/openapi.json - ReDoc (read-only):
http://localhost:5000/redoc
Open http://localhost:5000/docs and run in order:
-
Reset demo DB
POST /api/demo/reset-> Execute
Expected:{ "ok": true, "reset": true } -
Seed demo transactions
POST /api/demo/seed-> Execute
Expected:{ "ok": true, "inserted": 12 } -
Detect subscriptions
POST /api/detect-> Execute
Expected: 3 subscriptions (Netflix, Adobe Inc., Spotify). Starbucks is filtered as noise. -
View results
GET /api/subscriptions
GET /api/vendors
GET /api/transactions(optionallimit=50) -
Invoice ingestion (mock)
POST /api/textract-> upload any file
Expected: mock invoice for "Adobe Inc." (MOCK_TEXTRACT=1).
Tip: If you seed more than once, run POST /api/demo/reset first to avoid duplicate dates confusing detection.
Put Plaid sandbox creds into backend/.env (see backend/.env.example):
PLAID_CLIENT_ID=...PLAID_SECRET=...
Run:
POST /api/plaid/sandbox_public_tokenPOST /api/plaid/exchangewith body{"public_token":"..."}GET /api/plaid/transactionsPOST /api/detect
cd backend
pytestIncludes smoke tests (API demo flow) and a unit test for subscription detection. CI runs via GitHub Actions: .github/workflows/tests.yml.
- DB models:
backend/models.py - Subscription detection heuristic:
backend/detection.py - API routes + Swagger bindings:
backend/api_routes.py,backend/api_schemas.py - App bootstrap + OpenAPI config:
backend/app.py