The API that powers learn-to-earn on the Stellar network.
Anywhere. Anyone. Learn freely. Earn provably. Orivex turns financial literacy and digital skills into portable, on-chain credentials β built mobile-first for emerging markets.
π Website Β· π Docs Β· π Report Bug Β· β¨ Request Feature Β· π¬ Discord
Behind every credential, every reward, and every learner profile sits this repo: a stateless, JSON-first API that talks to PostgreSQL and the Stellar ledger with equal ease.
| πͺ Decentralised by default | Credentials and payouts settle on Stellar β no central authority can revoke or forge them. |
| π± Mobile-first ergonomics | Designed for low-bandwidth PWAs running on entry-level Android handsets. |
| π Privacy-preserving | ZK-proof friendly data shapes; selective disclosure comes standard. |
| πΌ B2B-ready | Verified-talent search API for employers β paid feature, built in. |
Orivex Backend is one of three repos. Together they form the full stack.
| Repo | Role | Stack |
|---|---|---|
Orivex-Backend β you are here |
API, identity, rewards, credentials | Node.js Β· Express Β· PostgreSQL Β· Prisma |
Orivex-App |
Mobile-first PWA frontend | React Β· Next.js Β· TypeScript Β· Tailwind |
Orivex-Contracts |
Soroban smart contracts for credential issuance | Rust Β· Soroban SDK |
- π Authentication & Sessions β JWT issuance, password bcrypt, role-aware middleware, and token rotation.
- π Modules & Progress β Catalogue, completion submission, offline sync, idempotent ingestion.
- π Rewards Engine β Stellar-based payouts with reconcilable memos and dispute handling.
- π Verifiable Credentials β Mint, fetch, and publicly verify credentials by on-chain ID.
- π€ Referrals β Multi-tier tracking, capped rewards, anti-abuse heuristics.
- π Push Notifications β Firebase Cloud Messaging with topic targeting, per-device tokens.
- π¨ Webhooks Out β HMAC-signed (
X-Orivex-Signature) deliveries with retry and DLQ semantics. - π§± Employer Search β Talent-pool query API for verified learners with consent gating.
- π‘οΈ Rate Limiting & Validation β Redis-backed counters and Zod schemas on every entry point.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Orivex PWA (mobile web) β
βββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β HTTPS Β· JWT Β· /api/v1
β
βββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β Orivex Backend (this repo) β
β β
β [ Auth ]ββ[ Modules ]ββ[ Rewards ]ββ[ Credentials ]ββ[ Search ]β
β Express Β· Zod Β· Winston Β· Helmet Β· Rate-Limit β
ββββββ¬ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββ¬βββββ
β β β
β β β
ββββββΌββββββββββ βββββββββΌβββββββββ βββββββββΌβββββββββ
β PostgreSQL β β Stellar Ledger β β Soroban RPC β
β (Prisma ORM) β β Horizon Β· β β Credential β
β Users Β· Mods β β Assets Β· Memosβ β Contracts β
ββββββββββββββββ ββββββββββββββββββ βββββββββββββββββ
Layered internals: routes (HTTP framing) β middleware (auth, validation, rate-limit)
β controllers (request orchestration) β services (business logic) β
Prisma / Stellar RPC (persistence and settlement).
For the full system design, see docs/ARCHITECTURE.md.
- Node.js 20 or newer
- pnpm 10 or newer
- PostgreSQL 14 or newer (or Docker)
- Optional: Redis for distributed rate-limiting
- Optional: Rust toolchain if you'll be hacking on linked Soroban contracts
# 1. Clone
git clone https://github.com/Kqirox/Orivex-Backend.git
cd Orivex-Backend
# 2. Install
pnpm install
# 3. Configure
cp .env.example .env
# edit .env with your DATABASE_URL and Stellar testnet secrets
# 4. Provision the database
pnpm db:migrate
pnpm db:seed # optional: load demo modules / sample users
# 5. Run
pnpm dev # starts Express + nodemon on the configured PORTThe API will be live at http://localhost:<PORT>/api/v1. Swagger UI is mounted in dev mode β see docs/API.md for the canonical endpoint reference.
π¦ Detailed database instructions live in
prisma/SETUP.md.
| Script | What it does |
|---|---|
pnpm dev |
Run the API with hot reload (nodemon + ts-node) |
pnpm build |
Compile TypeScript to dist/ |
pnpm start |
Boot the compiled build (production) |
pnpm test |
Run the Vitest suite (unit + integration) |
pnpm test:coverage |
Generate coverage report |
pnpm lint |
ESLint over src/ and tests/ |
pnpm db:migrate |
Apply Prisma migrations |
pnpm db:seed |
Load demo data |
pnpm db:studio |
Open Prisma Studio |
POST /api/v1/auth/register sign up
POST /api/v1/auth/login sign in
GET /api/v1/modules list catalogue
POST /api/v1/modules/:id/complete submit progress (idempotent)
GET /api/v1/credentials list my credentials
GET /api/v1/credentials/verify/:id public verification (no auth)
GET /api/v1/employer/search talent pool query
POST /api/v1/referrals register a referral
Full schemas, error envelopes, and example payloads: docs/API.md.
| Layer | Choice |
|---|---|
| Runtime | Node.js 20 LTS |
| Language | TypeScript (strict) |
| HTTP | Express 5 |
| ORM / DB | Prisma Β· PostgreSQL 14+ |
| Validation | Zod |
| Auth | JWT Β· bcrypt |
| Blockchain | @stellar/stellar-sdk Β· Soroban RPC |
| Notifications | Firebase Cloud Messaging |
| Testing | Vitest Β· Supertest |
| Tooling | ESLint Β· Prettier Β· Swagger UI Β· nodemon |
Every operational concern is documented.
| Doc | Purpose |
|---|---|
docs/API.md |
Endpoint reference and request/response schemas |
docs/ARCHITECTURE.md |
System design, layers, deployment topology |
docs/DEVELOPING.md |
Local setup, coding conventions, test strategy |
docs/OPERATIONS.md |
Deploying, scaling, logging, observability |
docs/ERROR_HANDLING.md |
AppError hierarchy, HTTP mapping, troubleshooting |
docs/SECURITY.md |
Threat model, secrets, reporting vulnerabilities |
docs/ROADMAP.md |
Current quarter priorities and later bets |
docs/CHANGELOG.md |
Notable versioned changes |
We welcome PRs of every shape: bug fixes, features, docs, tests, examples.
- Skim
docs/CONTRIBUTING.mdfor workflow and style. - Read
docs/CODE_OF_CONDUCT.mdβ be kind, stay constructive. - Pick an open issue or propose one via RFC. Tag-heavy work? Check
docs/ROADMAP.mdfirst. - Open a PR. CI will run lint, typecheck, and the test suite.
Conventional Commits are encouraged. Tags follow Semantic Versioning. Releases are cut from
main.
If you discover a vulnerability, do not open a public issue. Follow the disclosure process in docs/SECURITY.md and we'll respond within 72 hours.
This project is licensed under the MIT License β see LICENSE.
- Stellar Development Foundation β for the rails our payouts run on.
- Every contributor who has shipped a PR, filed a thoughtful issue, or helped a learner onboard.
- The Orivex community β testers, educators, and learners in equal measure.
- π Web: orivex.io
- π Email: orivex@toneflix.net
- π¬ Discord: Join the community
- π GitHub: Kqirox
Built with care by the Orivex team β and a lot of β