API & services layer for Eduban — decentralized learning & credential verification on Stellar.
- About
- Features
- Tech Stack
- Repository Layout
- Getting Started
- Environment Variables
- Database & Migrations
- Available Scripts
- API Overview
- Testing
- Deployment
- Contributing
- Related Repositories
- License
This repository is the backend for Eduban — an open-source platform for issuing and verifying tamper-proof educational credentials on the Stellar blockchain. It exposes a REST API (with realtime support) consumed by the Eduban frontend and coordinates on-chain operations against the Eduban smart contracts.
The core API in src/ runs standalone. Optional microservices in services/ exist for
horizontal scale-out and are not required for local development.
- 🎓 Credential API — issue, verify, and manage on-chain educational credentials
- 📚 Course management — CRUD, enrollment, content, and a moderation workflow
- 🔎 Search & recommendations — full-text search with personalized recommendations (see docs/COURSE_DISCOVERY.md)
- 📈 Analytics — enrollment/completion aggregation with PII-safe reporting
- ✉️ Email notifications — pluggable provider (SendGrid / AWS SES / SMTP) with templates
- 🔗 Transaction queue — reliable Stellar transaction submission with retries & backoff
- 🔐 Auth & security — JWT auth, rate limiting, Helmet, bcrypt
- 🧩 Modular services — optional gateway/auth/courses/analytics microservices
| Layer | Technology |
|---|---|
| Runtime | Node.js 18+ |
| Language | TypeScript 5 |
| Framework | Express |
| Datastores | PostgreSQL, Redis (queues/cache), MongoDB (select modules) |
| Blockchain | Stellar SDK / Soroban |
| Auth | JWT, bcrypt |
| Realtime | Socket.io |
| Media | FFmpeg, Sharp |
| Testing | Jest |
| Tooling | ESLint, ts-node, nodemon |
src/ # Core Express API — primary entry point
services/ # Optional scale-out microservices (gateway, auth, courses, analytics)
apps/ # Companion apps: developer portal + content-player components
migrations/ # SQL database migrations
scripts/ # Operational & maintenance scripts
tests/ # Test suites (unit, integration, api, performance)
docs/ # Architecture & system documentation
See services/README.md and apps/README.md for
details on the optional pieces.
- Node.js v18+
- PostgreSQL v13+
- Redis v6+
- A Stellar keypair for on-chain operations (testnet is fine for development)
- (optional) Docker, for running Postgres/Redis locally
# 1. Clone
git clone https://github.com/millystellar/Eduban_backend.git
cd Eduban_backend
# 2. Install dependencies
npm install
# 3. Configure environment
cp .env.example .env
# edit .env — see the Environment Variables section
# 4. Apply database migrations
npm run migrate:up
# 5. Start the API in watch mode
npm run devThe API listens on http://localhost:3001 by default.
💡 Need Postgres & Redis quickly?
docker run -d --name eduban-pg -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=eduban -p 5432:5432 postgres:15 docker run -d --name eduban-redis -p 6379:6379 redis:7
A complete reference lives in .env.example and
SETUP_GUIDE.md. The essentials:
| Variable | Description | Default |
|---|---|---|
NODE_ENV |
Environment | development |
PORT |
API port | 3001 |
DATABASE_URL |
PostgreSQL connection string | — |
REDIS_HOST / REDIS_PORT |
Redis connection | localhost / 6379 |
JWT_SECRET |
Signing secret (use a strong value) | — |
JWT_EXPIRES_IN |
Token lifetime | 24h |
STELLAR_NETWORK |
testnet or public |
testnet |
STELLAR_HORIZON_URL |
Horizon endpoint | — |
EMAIL_PROVIDER |
smtp / sendgrid / ses |
— |
EMAIL_FROM |
Sender address | — |
FRONTEND_URL |
Allowed CORS origin | http://localhost:3000 |
Migrations live in migrations/ and are applied with the migrate scripts:
npm run migrate:up # apply pending migrations
npm run migrate:down # roll back the last migration
npm run migrate:status # show migration status| Script | Description |
|---|---|
npm run dev |
Start API with hot reload (nodemon + ts-node) |
npm run build |
Compile TypeScript to dist/ |
npm start |
Run the compiled build |
npm run lint / lint:fix |
Lint (and auto-fix) |
npm run typecheck |
TypeScript type checking |
npm test |
Run the full test suite |
npm run test:coverage |
Tests with coverage |
npm run test:api |
API/route tests only |
npm run test:integration |
Integration tests only |
npm run migrate:up / :down / :status |
Database migrations |
Common endpoints (see route modules under src/routes for the full surface):
| Method | Path | Description |
|---|---|---|
GET |
/api/health |
Service health check |
POST |
/api/auth/login |
Authenticate and receive a JWT |
GET |
/api/courses |
List / search courses |
POST |
/api/credentials |
Issue a credential |
GET |
/api/credentials/:id/verify |
Verify a credential |
GET |
/api/v1/analytics/enrollment-trends |
Enrollment aggregation |
POST |
/api/transactions/submit |
Submit a Stellar transaction |
npm test # everything
npm run test:coverage # with coverage
npm run test:api # route/API tests
npm run test:integration # integration testsTests requiring a database expect a reachable Postgres/Redis (the CI workflow spins these up as service containers). New features should include tests — see CONTRIBUTING.md.
npm run build # produces dist/
npm start # node dist/index.jsA Dockerfile is provided for container deployments. Production guidance (Nginx, SSL,
PM2, scaling) is documented in SETUP_GUIDE.md.
Contributions are welcome! Please read the Contributing Guide and Code of Conduct first.
- Fork and branch:
git checkout -b feat/short-description - Ensure
npm run lint && npm run typecheck && npm testpass - Use Conventional Commits
- Open a PR with a clear description and linked issue
- 🖥️ Eduban_frontend — web dashboard
- ⚙️ Eduban_backend — this repo
- 📜 Eduban_contract — Soroban contracts
Distributed under the MIT License. See LICENSE for details.
© 2026 Meshmulla