docs: developer documentation & customer-facing polish
All checks were successful
Build and Deploy / deploy (push) Successful in 45s
All checks were successful
Build and Deploy / deploy (push) Successful in 45s
Code documentation: - client.py: docstrings with Tink API docs URLs on every method - demo.py: docstrings on all route handlers explaining Tink flow context - webhook receiver: C# HMAC-SHA256 signature verification example Customer-facing cleanup: - Removed 'sales demo' / 'MoneyCapp × Tink' internal branding - Neutral footer, consistent terminology (external_user_id, not tink_external_ref) - Sandbox note on Step 3: anonymous flow vs production authorization_code flow - Step 6: 'Next Steps for C#/.NET implementation' section - demo_data.py: dynamic relative dates (no hardcoded year) - print() → logging.getLogger, /debug-session gated behind DEMO_MODE - Step 1 always resets session state (fresh start on every visit) - README: neutral/collaborative tone, what-it-is-not section Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
84
README.md
84
README.md
@@ -1,60 +1,52 @@
|
||||
# MoneyCapp × Tink API Demo
|
||||
# Tink API Demo
|
||||
|
||||
"Sales-y Swagger" — step-for-step gennemgang af Tink integrationsflowet med live JSON responses.
|
||||
En simpel Python-demo der viser Tink open banking-flowet fra ende til anden — bygget som proof-of-concept til at illustrere hvordan integrationen kan se ud i praksis.
|
||||
|
||||
## Hvad det er
|
||||
Formålet er ikke at erstatte en produktion C#/Umbraco-implementation, men at vise at Tink-flowet er veldokumenteret og relativt ligetil at bygge — uanset platform.
|
||||
|
||||
En hosted demo-app der viser hele Tink onboarding-flowet:
|
||||
## Hvad demo'en viser
|
||||
|
||||
| Step | Endpoint | Version |
|
||||
|------|----------|---------|
|
||||
| 1 | POST `/api/v1/oauth/token` — Client Credentials | v1 |
|
||||
| 2 | POST `/api/v1/user/create` — Opret bruger | v1 |
|
||||
| 3 | Tink Link redirect — Tilslut bank | Link v1 |
|
||||
| 4 | GET `/data/v2/accounts` — Konti med balances | **v2** |
|
||||
| 5 | GET `/data/v2/transactions` — Transaktioner | **v2** |
|
||||
| 6 | GET `/events/v2/account-transactions` + webhooks | **v2** |
|
||||
| Step | Hvad sker der | Tink endpoint |
|
||||
|------|---------------|---------------|
|
||||
| 1 | Hent app token (client credentials) | `POST /api/v1/oauth/token` |
|
||||
| 2 | Opret kunde i Tink med ekstern reference | `POST /api/v1/user/create` |
|
||||
| 3 | Åbn Tink Link — brugeren tilslutter sin bank | Tink Link v1 |
|
||||
| 4 | Hent brugerens konti med balances | `GET /data/v2/accounts` |
|
||||
| 5 | Hent transaktioner | `GET /data/v2/transactions` |
|
||||
| 6 | Webhook-registrering til real-time notifikationer | `POST /events/v2/webhook-endpoints` |
|
||||
|
||||
## Quick start (lokal dev)
|
||||
Live JSON responses på hvert trin — præcis som det vil se ud i en reel integration.
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# Udfyld TINK_CLIENT_ID og TINK_CLIENT_SECRET fra Tink Console
|
||||
# Tilføj http://localhost:8000/callback som Redirect URI i Tink Console
|
||||
## Kør det selv
|
||||
|
||||
python3 -m venv .venv && source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
uvicorn src.main:app --reload
|
||||
# Åbn http://localhost:8000
|
||||
```
|
||||
|
||||
## Docker
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
|
||||
## Deploy til i80/Nomad
|
||||
|
||||
> **Kun relevant for i80-infrastruktur.** For din egen infra: byg Docker image og kør med env vars.
|
||||
|
||||
1. Læg credentials i Consul KV:
|
||||
```bash
|
||||
consul kv put tink-demo/TINK_CLIENT_ID <din_client_id>
|
||||
consul kv put tink-demo/TINK_CLIENT_SECRET <din_client_secret>
|
||||
```
|
||||
2. Tilføj `https://tink-demo.i80.dk/callback` som Redirect URI i Tink Console
|
||||
3. Push til `main` → Gitea Actions bygger og deployer automatisk
|
||||
|
||||
## Docker (self-hosted)
|
||||
Du skal bruge egne Tink sandbox-credentials fra [console.tink.com](https://console.tink.com).
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# Udfyld TINK_CLIENT_ID og TINK_CLIENT_SECRET
|
||||
# Tilføj http://localhost:8000/callback som Redirect URI i Tink Console
|
||||
|
||||
python3 -m venv .venv && source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
make run
|
||||
# Åbn http://localhost:8000
|
||||
```
|
||||
|
||||
Eller med Docker:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
docker compose up
|
||||
```
|
||||
|
||||
1. Gå til [console.tink.com](https://console.tink.com)
|
||||
2. Opret en app → kopiér Client ID + Secret til `.env`
|
||||
3. Under **Redirect URIs**: tilføj din callback URL
|
||||
4. Under **Scopes**: aktiver `accounts:read`, `transactions:read`, `credentials:read/write`, `user:create`
|
||||
## Tink Console opsætning
|
||||
|
||||
1. Gå til [console.tink.com](https://console.tink.com) → opret en app
|
||||
2. Kopiér **Client ID** og **Client Secret** til `.env`
|
||||
3. Under **Redirect URIs**: tilføj `http://localhost:8000/callback`
|
||||
4. Under **Scopes**: aktiver `accounts:read`, `transactions:read`, `credentials:read`, `user:create`
|
||||
|
||||
## Hvad det ikke er
|
||||
|
||||
Dette er en demo — ikke produktionskode. Der er ingen database, ingen brugerstyring og tokens lever kun i hukommelsen. En reel implementation vil naturligvis bygge videre på jeres eksisterende platform og arkitektur.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user