StellarAid Backend is the server-side API powering the StellarAid crowdfunding platform — a blockchain‑enabled system built on the Stellar network to support transparent, secure, and efficient fundraising for social impact initiatives.
/src
/app.ts # Express app bootstrap (middleware, routes registry)
/server.ts # HTTP server startup
/config # configuration & env loading
env.ts
logger.ts
rateLimit.ts
security.ts
/database # DB client & schema (Prisma/TypeORM/knex/etc.)
index.ts
prismaClient.ts # (if using Prisma)
migrations/ # (tool-specific)
/common # shared cross-cutting concerns
/middlewares
errorHandler.ts
notFound.ts
requireAuth.ts
validate.ts
/utils
crypto.ts
pagination.ts
response.ts
/types
express.d.ts # custom Request types (e.g. req.user)
/events - Discover global fundraising campaigns
- Donate in XLM or Stellar assets
- Wallet integration (Freighter, Albedo, Lobstr)
- On-chain transparency: verify all transactions
- Create social impact projects
- Accept multi-asset contributions
- Real-time donation tracking
- Withdraw funds directly on-chain
- Campaign approval workflow
- User & KYC management
- Analytics dashboard
StellarAid Backend is built with:
- Express js
- MongoDB
- Horizon API integration
- Worker processes (BullMQ)
StellarAid API includes Swagger (OpenAPI) documentation for easy exploration and testing of endpoints.
When the application is running with Swagger enabled:
- Swagger UI: http://localhost:3000/docs
- OpenAPI JSON: http://localhost:3000/docs-json
- Click the "Authorize" button in the top right of the Swagger UI
- Enter your JWT token in the format:
Bearer <your-token> - Click "Authorize" and close the dialog
- All protected endpoints will now include the Authorization header
Swagger is controlled via environment variables:
| Variable | Description | Default |
|---|---|---|
NODE_ENV |
Environment mode (development, production, test) |
development |
ENABLE_SWAGGER |
Override to enable/disable Swagger explicitly | - |
- Development: Swagger is enabled by default
- Production: Swagger is disabled by default (set
ENABLE_SWAGGER=trueto override) - Explicit override: Set
ENABLE_SWAGGER=trueorENABLE_SWAGGER=falseto force enable/disable regardless of environment
The application ships with a built‑in rate limiter based on express-rate-limit. It protects the entire API with a permissive window, and adds a more restrictive policy to
all /api/auth endpoints.
| Variable | Description | Default |
|---|---|---|
RATE_LIMIT_WINDOW_MS |
Time window in milliseconds | 900000 (15m) |
RATE_LIMIT_MAX |
Max requests per window for general routes | 100 |
AUTH_RATE_LIMIT_MAX |
Max requests per window for auth routes | 10 |
When a client exceeds the limit the server replies with 429 Too Many Requests and a Retry-After header indicating how many seconds remain
in the current window.
# Enable Swagger in production (not recommended for public APIs)
NODE_ENV=production
ENABLE_SWAGGER=true
# Or disable in development
NODE_ENV=development
ENABLE_SWAGGER=false
# Rate limiting (optional overrides)
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX=100
AUTH_RATE_LIMIT_MAX=10Click the "Fork" button in the top‑right of the GitHub repo and clone your fork:
git clone https://github.com/YOUR_USERNAME/stellaraid-api.git
cd stellaraid-apibash cp .env.example .env npm install npm run start:dev
git checkout -b feature/add-donation-flowUse conventional commits:
feat: add wallet connection endpoint
fix: resolve donation API error
docs: update project README
refactor: clean up project creation formPush your branch:
git push origin feature/add-donation-flowOpen a Pull Request from your fork back to the main branch.
MIT License — free to use, modify, and distribute.