A Golang based african banking system
# Finbank Banking System
A production-grade core banking API built in Go — double-entry ledger, KYC tiers, Paseto v4 auth, field-level encryption.
**Stack:** Go 1.23 · Gin · PostgreSQL 16 · Redis 7 · SQLC · Paseto v4 · AES-256-GCM
---
### Prerequisites
| Tool | Version | Install |
|------|---------|---------|
| Go | ≥ 1.23 | go.dev |
| Docker | any | docker.com |
| golang-migrate | latest | `go install
github.com` |
| sqlc | latest | `go install
github.com` |
### 1. Clone & configure
```bash
git clone
github.com
cd banking
cp .env.example .env
```
The `.env.example` ships with placeholder keys. For a real dev environment the repo already ships a pre-generated `.env` with local-only keys — **replace them before any shared/cloud deployment.**
To regenerate keys at any time:
```bash
make gen-paseto-key # paste result into PASETO_SYMMETRIC_KEY
make gen-encryption-key # paste result into FIELD_ENCRYPTION_KEY
### 2. Start infrastructure
```bash
make docker-up
# Starts: postgres:16-alpine on :5432
# redis:7-alpine on :6379
```
Or start individually:
```bash
make postgres-up
make redis-up
```
### 3. Run migrations
```bash
make migrate-up
# Applies: 000001_customers, 000002_accounts
```
### 4. Run the server
```bash
make run
# → Server listening on :8080
```
Verify:
```bash
curl
localhost
# {"status":"ok"}
```
---
## Other Make Commands
```bash
make build # Compile binary → bin/banking-api
make test # Run all tests with race detector
make lint # golangci-lint
make migrate-down # Roll back all migrations
make migrate-down-1 # Roll back one migration
make migrate-create # Scaffold a new migration (prompts for name)
make sqlc # Regenerate db/sqlc from queries + schema
```
---
## Double-Entry Ledger Design
Every balance mutation creates an immutable `journal_entry` (the a …