feat: Tink open banking demo — 6-step API walkthrough
Demonstrates the full Tink integration flow for open banking: Step 1 — Client credentials auth (app token) Step 2 — Create Tink user with external_user_id Step 3 — Connect bank via Tink Link OAuth redirect Step 4 — List accounts (v2 endpoint) Step 5 — List transactions (v2 endpoint, cursor pagination) Step 6 — Webhooks (register endpoint, receive events) Built with Python / FastAPI + Jinja2 templates. Each step shows live JSON responses, cURL examples and API version badges. Includes server-side token store (prevents session cookie overflow), asyncio lock on OAuth callback, and demo mode with realistic mock data. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
50
Makefile
Normal file
50
Makefile
Normal file
@@ -0,0 +1,50 @@
|
||||
.PHONY: install run dev docker-build docker-up docker-down push deploy logs vault-setup test clean
|
||||
|
||||
REGISTRY = registry.i80.dk
|
||||
IMAGE = $(REGISTRY)/moneycapp-tink-demo
|
||||
|
||||
install:
|
||||
python3 -m venv .venv && .venv/bin/pip install -q -r requirements.txt
|
||||
cp -n .env.example .env || true
|
||||
@echo "✓ Done — edit .env with your Tink credentials"
|
||||
|
||||
run:
|
||||
.venv/bin/uvicorn src.main:app --host 0.0.0.0 --port 8000
|
||||
|
||||
dev:
|
||||
.venv/bin/uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload
|
||||
|
||||
docker-build:
|
||||
docker build -t moneycapp-tink-demo .
|
||||
|
||||
docker-up:
|
||||
docker compose up
|
||||
|
||||
docker-down:
|
||||
docker compose down
|
||||
|
||||
# --- Deploy to i80.dk ---
|
||||
|
||||
push:
|
||||
docker build --platform linux/amd64 -t $(IMAGE):latest .
|
||||
docker push $(IMAGE):latest
|
||||
@echo "✓ Image pushed to $(IMAGE):latest"
|
||||
|
||||
vault-setup:
|
||||
@echo "Storing Tink credentials in Vault..."
|
||||
vault kv put secret/moneycapp-tink-demo \
|
||||
client_id=$(TINK_CLIENT_ID) \
|
||||
client_secret=$(TINK_CLIENT_SECRET) \
|
||||
session_secret=$$(openssl rand -hex 32)
|
||||
@echo "✓ Vault secret stored at secret/moneycapp-tink-demo"
|
||||
|
||||
deploy: push
|
||||
scp moneycapp-tink-demo.nomad autobox.i80.dk:/tmp/
|
||||
ssh autobox.i80.dk 'export NOMAD_ADDR=https://nomad.i80.dk:4646 && nomad job run /tmp/moneycapp-tink-demo.nomad'
|
||||
@echo "✓ Deployed — https://tink-demo.i80.dk"
|
||||
|
||||
logs:
|
||||
ssh autobox.i80.dk 'export NOMAD_ADDR=https://nomad.i80.dk:4646 && nomad alloc logs -job moneycapp-tink-demo'
|
||||
|
||||
clean:
|
||||
rm -rf .venv __pycache__ src/__pycache__ src/**/__pycache__
|
||||
Reference in New Issue
Block a user