The REST API powering Deen Bridge: authentication, courses, library, community, and USDC payments on Stellar.
Live API Β· Web App Β· Report a Bug Β· Contribute
This is the API service for Deen Bridge, a platform for authentic Islamic education. It handles users and roles, courses, the digital book library, community spaces, reels, notifications, and β at its core β non-custodial USDC payments on the Stellar network: the API builds an unsigned payment transaction, the buyer signs it in their own wallet, and the API verifies the payment on-chain before granting access. Creators receive USDC directly to their wallets.
The platform is composed of three services:
| Repository | Role | Live |
|---|---|---|
| dnb-frontend | Next.js web application | dnb-frontend.vercel.app |
| dnb-backend (this repo) | REST API β auth, content, Stellar payments | dnb-backend-api.onrender.com |
| dnb-ai | FastAPI service for the AI assistant | dnb-ai.onrender.com |
- π JWT Authentication β access + refresh tokens, role-based access (student / mentor / admin)
- π Course Management β create, enroll, review, and track courses
- π Digital Library β upload, purchase, and read Islamic books
- β Stellar Payments β USDC payment initialize β sign β submit β on-chain verify flow
- π Wallet Management β connect Freighter, xBull, or Albedo; balance and trustline checks
- π¬ Real-time β Socket.io messaging and notifications
- βοΈ Media β Cloudinary uploads for avatars, covers, books, and reels
- π‘οΈ Hardened β helmet, rate limiting, sanitization (mongo-sanitize, hpp, xss), CORS
| Layer | Technology |
|---|---|
| Runtime | Node.js 20 Β· Express 5 (ESM) |
| Database | MongoDB Β· Mongoose 8 Β· Redis (caching) |
| Blockchain | @stellar/stellar-sdk v16 Β· Horizon |
| Auth | JWT (access + refresh) |
| Media & Realtime | Cloudinary Β· Multer Β· Socket.io |
| Observability | Winston logging |
- Node.js 20+
- MongoDB (local or Atlas)
- Redis (optional, for caching)
git clone https://github.com/Deen-Bridge/dnb-backend.git
cd dnb-backend
npm install
cp .env.example .env # then fill in your values
npm run devThe API runs at http://localhost:5000.
| Variable | Description |
|---|---|
PORT |
Server port (default 5000) |
MONGO_URI |
MongoDB connection string |
JWT_SECRET |
Secret for signing tokens (32+ chars) |
STELLAR_NETWORK |
testnet or mainnet |
CLOUDINARY_* |
Cloudinary credentials for media uploads |
See .env.example for the full list.
| Command | Purpose |
|---|---|
npm run dev |
Start with hot reload |
npm start |
Start in production mode |
npm test |
Run the Jest + Supertest suite |
npm run seed |
Seed sample data |
| Area | Base Route |
|---|---|
| Auth & Users | /api/auth, /api/users |
| Courses & Books | /api/courses, /api/books |
| Spaces & Reels | /api/spaces, /api/reels |
| Stellar Wallet | /api/stellar/wallet/* |
| Stellar Payments | /api/stellar/payment/* |
This repository participates in the Stellar Drips Wave bounty program β contributors earn Points (and real rewards) for resolving this repo's issues during a Wave, with complexity tiers set in the Drips Wave app.
- All pull requests target the
devbranch (mainis releases only) - CI (tests) must pass before review
- One contributor per issue β comment to claim it first
Read CONTRIBUTING.md for the full workflow, coding standards, and Wave rules.
MIT Β© Deen Bridge
- π Website: dnb-frontend.vercel.app
- π¦ X/Twitter: @deen_bridge
- π’ Organization: github.com/Deen-Bridge