# GOLDTRACE GHANA
National Gold Supply Chain Intelligence & Traceability System for the Ghana Gold
Board (GoldBod). Tracks every gram of gold from extraction to export with a
tamper-evident custody chain, QR-verifiable passports, geospatial monitoring, and
optional Hyperledger Fabric anchoring.
```
goldtrace-ghana/
├── backend/ Django 6 + DRF + MongoDB Atlas API (24 endpoints)
│ ├── accounts miners production trading exports gis # domain apps
│ ├── blockchain/ Hyperledger Fabric chaincode + gateway sidecar
│ ├── scripts/verify_core.py # runs core logic with no DB
│ └── Procfile · railway.json · requirements.txt
├── frontend/ React + TS console (Vite, Redux Toolkit, MUI, Leaflet map)
│ └── vercel.json
├── mobile/ React Native (Expo) app — field batches + QR passport verify
├── docker-compose.yml backend + worker + redis + frontend
└── package.json monorepo convenience scripts
```
## What's built
Mine → trade → export → verify, end to end: miner & concession registration →
gold batch with QR passport → ownership transfer → export certificate (gated on a
valid custody chain) → border verification. Plus a GIS map (concession boundaries
+ illegal-mining hotspots, point-in-polygon "illegal origin" checks) and a
permissioned-ledger anchoring layer. All 14 GoldBod roles with JWT + RBAC.
---
## 1. Local development
**Backend** (needs a MongoDB Atlas cluster)
```bash
cd backend
cp .env.example .env # set MONGODB_URI + a real DJANGO_SECRET_KEY
pip install -r requirements.txt
python manage.py makemigrations accounts miners production trading exports gis core
python manage.py migrate
python manage.py seed_demo # demo trail + GIS data
python manage.py runserver #
localhost (docs: /api/docs/)
redis-server & celery -A goldtrace worker -l info & # async anchoring
```
**Frontend**
```bash
cd frontend && npm install
cp .env.example .env # VITE_API_URL=
localhost
npm run dev …