Decentralized community finance on the Stellar blockchain β open source, contributor-first.
Traditional finance excludes billions of people through geographic barriers, credit requirements, and prohibitive fees. CoopLumen uses the Stellar network β with its 5-second finality, near-zero fees, and built-in DEX β to give any group (NGO, cooperative, local community, diaspora network) the tools to issue community tokens, run peer-to-peer lending pools, and govern shared treasuries without a bank in the middle.
Why Stellar specifically?
- Speed & cost: Transactions settle in 3β5 seconds for fractions of a cent
- Built-in asset primitives: Native support for custom assets, trustlines, and multi-sig
- Soroban smart contracts: Path to on-chain governance in Phase 3
- Freighter wallet: Mature browser extension for end-user signing
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Browser / PWA β
β Next.js 14 (App Router) Β· Freighter Wallet Extension β
βββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β REST (JSON)
βββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ
β Node.js / Express API (port 4000) β
β /api/communities /api/tokens /api/balances β
β β
β ββββββββββββββββββββ ββββββββββββββββββββββββββββββββ β
β β /contracts β β PostgreSQL (off-chain meta) β β
β β assets.ts β β communities Β· members β β
β β trustlines.ts β β loans β β
β β transactions.ts β ββββββββββββββββββββββββββββββββ β
β ββββββββββ¬ββββββββββ β
ββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββ
β Stellar SDK (Horizon REST)
ββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββ
β Stellar Network (Testnet / Mainnet) β
β Horizon API Β· Asset issuance Β· Trustlines β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
cooplumen/
βββ backend/ # Node.js / Express API
β βββ scripts/ # Manual testnet verification scripts
β βββ src/
β β βββ api/
β β β βββ middleware/ # Auth, CSRF, validation, rate limiting, errors
β β β βββ routes/ # One router per resource
β β β βββ schemas/ # Zod request schemas
β β β βββ utils/ # Session tokens, cookies, pagination, Horizon errors
β β βββ cache/ # Redis and in-process caches
β β βββ contracts/ # Stellar SDK layer: assets, trustlines, payments
β β βββ services/ # Non-Stellar integrations (market price feed)
β β βββ db/ # PostgreSQL pool, migrations and seed data
β β βββ testing/ # Shared test setup, teardown and fixtures
β β βββ utils/ # Logger
β βββ Dockerfile
β βββ package.json
βββ frontend/ # Next.js (App Router)
β βββ e2e/ # Playwright end-to-end suite and its support code
β βββ src/
β β βββ app/ # Routes, layout, global CSS
β β βββ components/
β β β βββ ui/ # Design-system primitives
β β β βββ layout/ # Header, footer, sidebar, navigation, theme and locale
β β β βββ auth/ # Protected routes and re-authentication
β β β βββ community/ # Community and member forms and lists
β β β βββ dashboard/ # Dashboard view
β β β βββ landing/ # Marketing landing page
β β β βββ loans/ # Lending flow
β β β βββ multisig/ # Multi-signature proposals
β β β βββ profile/ # Account profile
β β β βββ reputation/ # Borrower reputation
β β β βββ tokens/ # Token issuance, transfer and listing
β β β βββ transactions/ # Transaction history and live feed
β β β βββ treasury/ # Treasury balances and signers
β β β βββ wallet/ # Wallet connection and balances
β β βββ hooks/ # SWR data-fetching and mutation hooks
β β βββ lib/ # API client, SWR config, schemas, design tokens
β βββ Dockerfile
β βββ package.json
βββ contracts/governance/ # Soroban governance contract (Rust)
βββ deploy/ # nginx config for blue/green production deploys
βββ docs/ # Guides, design and the OpenAPI spec
βββ scripts/
β βββ ci/ # Branch protection setup
β βββ db/ # Backup and constraint-validation scripts
β βββ deploy/ # Deploy, rollback, smoke-test and notify scripts
β βββ issues/ # Backlog tooling
βββ .github/ # CI, release, publish and deploy workflows
βββ docker-compose*.yml # Local, test, E2E and production stacks
- Docker Desktop (v24+)
- Node.js 20+ (for local development without Docker)
- Freighter wallet browser extension
git clone https://github.com/BigNathan1/CoopLumen.git
cd cooplumen# Backend
cp backend/.env.example backend/.env
# Frontend
cp frontend/.env.example frontend/.env.localEdit backend/.env to set your Stellar keys and network preference.
docker compose upThis starts:
- PostgreSQL on
localhost:5432 - Backend API on
localhost:4000 - Frontend on
localhost:3000
docker compose exec backend npm run db:migrateNavigate to http://localhost:3000 and connect Freighter.
# Terminal 1 β Backend
cd backend
npm install
npm run dev # starts ts-node-dev on :4000
# Terminal 2 β Frontend
cd frontend
npm install
npm run dev # starts Next.js on :3000You will need a local PostgreSQL instance. Set DATABASE_URL in backend/.env.
| Variable | Default | Description |
|---|---|---|
PORT |
4000 |
API server port |
DATABASE_URL |
β | PostgreSQL connection string |
STELLAR_NETWORK |
testnet |
testnet or mainnet |
STELLAR_HORIZON_URL |
Testnet Horizon | Override Horizon endpoint |
STELLAR_WEBHOOK_SECRET |
- | HMAC secret for Stellar callbacks |
KYC_WEBHOOK_SECRET |
- | HMAC secret for KYC provider callbacks |
FRONTEND_URL |
http://localhost:3000 |
CORS allowed origin |
LOG_LEVEL |
info |
winston log level |
| Variable | Default | Description |
|---|---|---|
NEXT_PUBLIC_API_URL |
http://localhost:4000 |
Backend API base URL |
NEXT_PUBLIC_STELLAR_NETWORK |
TESTNET |
Network shown in UI |
| Method | Path | Description |
|---|---|---|
GET |
/api/communities |
List all communities |
GET |
/api/communities/:id |
Get a single community |
POST |
/api/communities |
Register a new community |
GET |
/api/communities/:id/members |
List community members |
POST |
/api/communities/:id/members |
Add a member |
| Method | Path | Description |
|---|---|---|
POST |
/api/v1/tokens/build-issue |
Build an unsigned issuance transaction for the issuer's wallet to sign |
POST |
/api/v1/tokens/build-trustline |
Build an unsigned trustline transaction for the holder's wallet to sign |
POST |
/api/v1/tokens/build-burn |
Build an unsigned burn transaction for the holder's wallet to sign |
POST |
/api/v1/tokens/build-airdrop |
Build one unsigned transaction paying every community member |
POST |
/api/v1/tokens/submit |
Submit a signed transaction envelope |
GET |
/api/v1/tokens |
List every token (operators only) |
| Method | Path | Description |
|---|---|---|
GET |
/api/balances/:publicKey |
Get all balances for an account |
GET |
/api/balances/:publicKey/loans |
Get loans for an account |
GET |
/api/balances/community/:id/loans |
Get all loans in a community |
GET /health β { "status": "ok", "version": "0.1.0" }
curl -X POST http://localhost:4000/api/communities \
-H "Content-Type: application/json" \
-d '{
"name": "EcoDAO Lagos",
"description": "Eco-finance cooperative for Lagos community",
"issuerPublicKey": "GXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"assetCode": "ECOLGS",
"assetIssuer": "GXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}'# Backend
cd backend && npm test
cd backend && npm run test:coverage
# Frontend
cd frontend && npm test
# End-to-end (Playwright, needs the Docker Compose stack)
docker compose -f docker-compose.yml -f docker-compose.e2e.yml up -d --build --wait
cd frontend && npm run test:e2eThe end-to-end suite drives a browser against the whole stack. See Testing for how to run it and how to write a spec.
- Product Requirements Document β goals, roadmap, user stories
- Contributing Guide β branch model, conventions, code review
- Architecture β how the frontend, API, database and Stellar fit together
- Database β schema, conventions and migrations
- API reference β OpenAPI specification for every endpoint
- Wallet authentication β challenge and verify, session tokens, RBAC and 401 handling
- Rate limiting β per-route limits and graduated slowdown
- Governance β Soroban proposals, token-weighted voting, quorum and execution
- Governance contract β contract types, functions, errors, events and deployment
- Multi-signature and batch operations β treasury signing lifecycle and batch payments
- SEP-12 KYC β provider integration, status mapping, privacy and security
- Testing β unit, component and Playwright end-to-end suites
- CI/CD β the CI jobs, quality gate, releases and deploy workflows
- Staging β the staging environment and its configuration
- Running PostgreSQL β connections, pooling, backups and production sizing
- Design β the Figma file and the screens designed in it
- GitHub Discussions: github.com/BigNathan1/CoopLumen/discussions
- Discord: coming soon
- Stellar Developers: discord.gg/stellar
MIT Β© CoopLumen Contributors