A quest-based earning platform that turns work into achievements on the Stellar blockchain
StellarEarn is a quest-based earning platform where teams define tasks ("quests"), contributors complete them, and rewards are distributed on-chain via Stellar smart contracts (Soroban). Users level up by completing quests, building an on-chain reputation trail and unlocking higher-value opportunities.
- Create & manage quests with criteria, rewards, deadlines, and proof requirements
- Complete & verify quests with off-chain signals (API, GitHub webhooks, form attestations) and on-chain validation
- Distribute rewards programmatically to contributors via Stellar assets
- Track reputation and progress with XP and badges captured through contract state
- Provide a trust-minimized, low-fee, and fast-settlement reward system
- Align incentives for open-source projects, DAOs, and distributed teams
- Leverage Stellar's strengths in payments, asset issuance, and on/off-ramps
Payments-first chain: Stellar was designed for fast, low-cost asset transfers and global remittances, making it ideal for frequent micro-reward payouts.
Asset issuance & compliance-friendly design: Projects can issue reward tokens or use existing assets with built-in trustlines and anchors to access real-world on/off-ramps.
Soroban smart contracts: Modern, Rust-based contracts bring programmability to Stellar, enabling verifiable task completion, escrow, and conditional payouts with deterministic execution and safety-focused tooling.
Learn more: Stellar Developers | Soroban Documentation
- Open-source communities & maintainers who want to reward contributors transparently
- DAOs & Web3 communities running bounty boards or seasonal quests
- Startups & product teams incentivizing internal milestones or growth tasks
- Education & talent platforms that issue credentials and micro-grants for verifiable learning
- π§ Quest management β create, assign, and track task progress
- π§© Flexible verification β off-chain attestations, API checks, or multi-sig approvals
- πΈ On-chain payouts β rewards via Stellar assets (stablecoins or project tokens)
- π‘οΈ Escrow & conditions β release rewards only when criteria are met
- β Reputation & levels β XP, badges, and a provable on-chain record
- π Multi-network support β local sandbox, testnet, or mainnet-ready configs
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β FrontEnd/my-app β β BackEnd β β contracts/ β
β Next.js βββββββΊβ NestJS βββββββΊβ earn-quest β
β (App Router) β β (REST + TypeORM)β β Soroban (Rust) β
β β’ Dashboard β β β’ Auth & RBAC β β β’ Quest registry β
β β’ Quest browser β β β’ Quest/Payout β β β’ Escrow/Payout β
β β’ Submissions β β β’ Webhooks/Jobs β β β’ Reputation β
β β’ Wallet connect β β β’ Postgres+Redis β β β’ Dispute/Oracle β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
- FrontEnd/my-app β Next.js (App Router) web client; wallet connect, quest browsing, submissions, dashboards. Tested with Vitest + Playwright (a11y).
- BackEnd β NestJS API using TypeORM (PostgreSQL) and Redis/BullMQ for background jobs; auth, quests, submissions, payouts, webhooks, notifications, moderation, analytics, etc. Tested with Jest.
- contracts/earn-quest β the Soroban (Rust) smart contract: quest registry, escrow, payout, reputation, disputes, oracle. Tested with
cargo test.
- An admin creates a quest (the API persists off-chain metadata; the contract registers the reward logic and escrow).
- A contributor submits proof; the API verifies it (webhooks / API checks) and invokes the contract.
- The contract validates, transitions state, and releases the payout in Stellar assets.
- The UI reflects on-chain state + off-chain metadata; the contributor's reputation/XP updates.
stellar_Earn/
βββ BackEnd/ # NestJS API (TypeORM + PostgreSQL + Redis/BullMQ)
β βββ src/
β β βββ main.ts
β β βββ app.module.ts
β β βββ common/ # logger, tracing, guards, interceptors, filters
β β βββ database/
β β β βββ data-source.ts # TypeORM DataSource (migrations CLI target)
β β β βββ migrations/ # TypeORM migrations
β β βββ modules/ # auth, quests, submissions, payouts, stellar,
β β # webhooks, notifications, moderation, jobs, ...
β βββ test/ # e2e / integration Jest configs
β βββ docker-compose.yml # local Postgres 15 + Redis 7
β βββ .env.example
βββ FrontEnd/my-app/ # Next.js (App Router) web client
β βββ app/ # routes (locale-aware)
β βββ components/ # quest, submission, rewards, admin, wallet, ...
β βββ context/ lib/ store/ # wallet context, API client, hooks, state
β βββ .env.example
βββ contracts/earn-quest/ # Soroban / Rust smart contract
β βββ src/ # lib.rs, escrow.rs, payout.rs, dispute.rs, ...
β βββ tests/ # integration tests
β βββ Makefile / Justfile # build / test / deploy helpers
β βββ Cargo.toml
βββ docs/ # architecture, security, testing, API notes
βββ scripts/ # repo-level scripts
βββ subgraph/ # indexer
βββ .github/ # CI workflows, issue/PR templates, CODEOWNERS
- Node.js β₯ 20 (CI uses Node 20)
- Bun β₯ 1.1 β the backend's TypeORM/migration scripts invoke
bun run β¦ - Rust (stable) + the
wasm32-unknown-unknowntarget, and the Stellar CLI (stellar) for the contract - Docker (for local PostgreSQL + Redis) and Git
Package-manager note: the BackEnd currently contains multiple lockfiles (
bun.lock,package-lock.json,pnpm-lock.yaml); its scripts standardize on Bun. The FrontEnd uses npm/pnpm. Consolidating to a single package manager per app is a tracked cleanup task.
# 1. Clone
git clone https://github.com/EarnQuestOne/stellar_Earn.git
cd stellar_Earn
# 2. Start local infrastructure (PostgreSQL :5432, Redis :6379)
docker compose -f BackEnd/docker-compose.yml up -d
# 3. Backend β http://localhost:3001
cd BackEnd
cp .env.example .env # set DATABASE_URL to the compose Postgres
bun install # (npm ci also works for install)
bun run migration:run # apply TypeORM migrations
bun run start:dev
# 4. Frontend β http://localhost:3000 (in a new terminal)
cd FrontEnd/my-app
cp .env.example .env.local # set NEXT_PUBLIC_API_BASE_URL=http://localhost:3001
npm install
npm run dev
# 5. Contract (in a new terminal)
cd contracts/earn-quest
cargo test # run the contract test suite
stellar contract build # build the wasm (or: just build / make build)These commands are derived from the projects' own
package.jsonscripts,docker-compose.yml, and contractMakefile/Justfile. If a command drifts, those files are the source of truth β please open a PR to fix this section.
Each app ships an .env.example that is the authoritative list β copy it and fill in values.
Backend (BackEnd/.env from BackEnd/.env.example) β key variables:
NODE_ENV=development
PORT=3001
DATABASE_URL=postgres://user:password@localhost:5432/stellar_earn # matches BackEnd/docker-compose.yml
# plus optional: LOG_*, TRACING_* (OpenTelemetry), DB_POOL_*, FF_* feature flagsFrontend (FrontEnd/my-app/.env.local from FrontEnd/my-app/.env.example) β key variables:
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
NEXT_PUBLIC_CONTRACT_ID=<deployed-contract-id>
NEXT_PUBLIC_API_BASE_URL=http://localhost:3001
NEXT_PUBLIC_SITE_URL=http://localhost:3000
# optional: NEXT_PUBLIC_SENTRY_DSN, NEXT_PUBLIC_ANALYTICS_IDThe Soroban contract lives in contracts/earn-quest/. Its authoritative public interface is contracts/earn-quest/src/lib.rs (quest registration, submission, approval, claim/payout, reputation, disputes, oracle) β see contracts/earn-quest/docs/ for details.
cd contracts/earn-quest
cargo test # tests
cargo fmt --all -- --check # format check (CI-enforced)
cargo clippy --all-targets --all-features -- -D warnings # lints (CI-enforced)
stellar contract build # build release wasm
# Deploy to testnet (requires funded key + RPC configured)
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/earn_quest.wasm \
--source <account> --network testnetMakefile / Justfile provide build, test, and deploy shortcuts.
The backend exposes a REST API documented via OpenAPI/Swagger (generated in CI by the OpenAPI Generation Check workflow). Run the backend and browse the Swagger UI, or consult the generated OpenAPI spec, for the authoritative, always-current endpoint list β routes are intentionally not hardcoded here to avoid drift.
# Backend (Jest)
cd BackEnd && bun run test # unit
bun run test:integration # integration (needs Postgres/Redis)
bun run test:e2e # e2e
# Frontend (Vitest + Playwright)
cd FrontEnd/my-app && npm run test # unit/integration
npm run typecheck # tsc --noEmit
npm run test:a11y # accessibility (Playwright + axe)
# Contract (Rust)
cd contracts/earn-quest && cargo testGitHub Actions gate every PR (see .github/workflows/):
- backend-ci / backend-lint / backend-integration β build, lint, and integration tests for
BackEnd - backend-changelog β enforces per-module
CHANGELOG.mdupdates - frontend-ci / frontend-vitest-cache / accessibility β build, unit, and a11y tests for
FrontEnd/my-app - contract-ci β
cargo build/test,fmt --check,clippy -D warnings, and wasm build on Ubuntu + Windows - secret-scan β scans for committed secrets
- testnet-canary-deployment β contract canary deploy to testnet
We welcome contributions. Please read CONTRIBUTING.md and use the issue and pull-request templates:
- Issue templates:
.github/ISSUE_TEMPLATE/(architecture review, contract bug report, gas optimization) - PR template:
.github/pull_request_template.md - Code ownership:
.github/CODEOWNERS
Guidelines:
- Fork and create a feature branch:
git checkout -b feat/<short-name> - Follow Conventional Commits (
feat:,fix:,docs:,refactor:,test:,chore:) - Add/keep tests passing and update the relevant module
CHANGELOG.md - Lint, typecheck, and run the affected app's test suite before opening a PR
Please report vulnerabilities privately β see SECURITY.md. Do not open public issues for security problems and never commit secrets or key material.
- Stellar Developers Β· Soroban Docs
- Next.js Β· NestJS Β· TypeORM Β· Rust
Released under the MIT License.