The Next-Generation, Open Source Backend-as-a-Service (BaaS)
Authentication, Database Collections, Realtime Sync, and a unique Plug-and-Play Integrations Hub.
Nirman is a high-performance, polyglot microservices platform built for modern development. Need to switch from Twilio to MSG91 or from SendGrid to Resend? Do it instantly from the Dashboard without touching a single line of application code.
- English: README.md
- Hindi: README.hi.md
- Spanish: README.es.md
- Chinese (Simplified): README.zh-CN.md
- Arabic: README.ar.md
- French: README.fr.md
Nirman follows a polyglot microservices architecture where each service is optimized for its job.
| Layer | Service | Stack | Purpose |
|---|---|---|---|
| API Layer | Gateway | Go, Chi, PostgreSQL, Redis | Auth, project APIs, API key validation, routing/proxy |
| Integration Layer | Hub | Bun, Hono, TypeScript | Provider adapters (OTP, Email, Maps, Notifications, Storage) |
| Async Layer | Workers | Python, Celery, Redis | Background jobs, retries, cleanup schedules |
| Realtime Layer | Realtime | Go, WebSockets, Redis Pub/Sub | Live updates and project-scoped realtime channels |
| UI Layer | Dashboard | Next.js, React, TypeScript | Admin panel for projects, keys, integrations |
| Infra Layer | Infra | Docker Compose, Nginx, PostgreSQL, Redis | Orchestration, reverse proxy, persistence, messaging |
| Provider System | packages/provider-sdk | TypeScript | Interface contract for all plug-and-play providers |
| Provider Registry | nirman-registry | JSON (separate repo) | Public listing of community-contributed providers |
- Go: High-performance API and realtime services
- Bun + Hono: Fast integrations execution engine
- Python + Celery: Reliable async task processing
- PostgreSQL: Primary relational data store
- Redis: Caching, broker, and pub/sub transport
- Next.js: Dashboard and developer control plane
- Docker Compose: Local self-hosted deployment
nirman-baas/
βββ .gitignore
βββ LICENSE
βββ README.md
βββ package.json # Root NPM workspace manifest
βββ package-lock.json
βββ turbo.json # Turborepo build pipelines
βββ docker-compose.yml # Full-stack container orchestration
β
βββ gateway/ # Go API Gateway (Chi + pgxpool)
β βββ Dockerfile
β βββ go.mod
β βββ cmd/
β β βββ server/
β β βββ main.go # Entry point, graceful shutdown
β βββ internal/
β βββ auth/
β β βββ jwt.go # Issue/verify JWT + refresh
β β βββ apikey.go # Generate + validate API keys
β β βββ oauth.go # OAuth stubs (Google/GitHub/Apple)
β β βββ middleware.go # JWT + API Key middleware
β βββ cache/
β β βββ redis.go # Redis client + rate limit helpers
β βββ config/
β β βββ config.go # Env vars, all settings
β βββ database/
β β βββ postgres.go # pgxpool connection
β β βββ query.go # Dynamic query builder
β β βββ schema.go # Create/drop collections
β βββ handlers/
β β βββ handlers.go # Base handler + helpers
β β βββ response.go # JSON response utilities
β β βββ auth.go # Register/Login/Refresh
β β βββ collections.go # Full CRUD + schema mgmt
β β βββ integrations.go # Proxy to Hub + storage + projects
β βββ middleware/
β β βββ middleware.go # Logger, RateLimit, Recover
β βββ models/
β β βββ user.go
β β βββ project.go
β β βββ api_key.go
β β βββ integration.go
β βββ router/
β βββ router.go # All routes registered
β
βββ hub/ # Integrations Hub (Bun + Hono)
β βββ Dockerfile
β βββ package.json
β βββ bunfig.toml
β βββ tsconfig.json
β βββ src/
β βββ index.ts # Hono server entry
β βββ middleware/
β β βββ auth.ts # Internal-only auth guard
β βββ vault/
β β βββ credentials.ts # AES-256-GCM credential store
β βββ registry/
β β βββ providers.ts # Dynamic provider loader
β βββ integrations/
β βββ otp/
β β βββ index.ts
β β βββ providers/
β β βββ twilio.ts
β β βββ msg91.ts
β β βββ twofactor.ts
β βββ email/
β β βββ index.ts
β β βββ providers/
β β βββ sendgrid.ts
β β βββ resend.ts
β β βββ ses.ts
β βββ maps/
β β βββ index.ts
β β βββ providers/
β β βββ googlemaps.ts
β β βββ mapbox.ts
β β βββ ola.ts
β βββ notifications/
β β βββ index.ts
β β βββ providers/
β β βββ fcm.ts
β β βββ apns.ts
β β βββ onesignal.ts
β βββ payments/
β β βββ index.ts
β β βββ providers/
β β βββ razorpay.ts
β β βββ stripe.ts
β β βββ payu.ts
β βββ ai/
β β βββ index.ts
β β βββ providers/
β β βββ openai.ts
β β βββ gemini.ts
β β βββ claude.ts
β βββ storage/
β βββ providers/
β βββ s3.ts
β
βββ workers/ # Background Workers (Python + Celery)
β βββ Dockerfile
β βββ pyproject.toml
β βββ app/
β βββ __init__.py
β βββ celery.py # Celery app + Redis broker
β βββ config.py # Environment config
β βββ database.py # PostgreSQL connection helpers
β βββ tasks/
β βββ __init__.py
β βββ webhook_task.py # HMAC-signed webhook delivery
β βββ email_task.py # Queued email sending
β βββ notification_task.py # Push notification dispatch
β βββ cleanup_task.py # Scheduled data cleanup
β
βββ realtime/ # WebSocket Server (Go + Redis Pub/Sub)
β βββ Dockerfile
β βββ go.mod
β βββ cmd/
β β βββ server/
β β βββ main.go # WS server entry
β βββ internal/
β βββ auth/
β β βββ jwt.go # Token validation for WS
β βββ hub/
β β βββ hub.go # Connection manager
β β βββ client.go # Per-client read/write pumps
β βββ pubsub/
β βββ redis.go # Redis subscriber β broadcast
β
βββ dashboard/ # Admin UI (Next.js 15)
β βββ Dockerfile
β βββ package.json
β βββ next.config.ts
β βββ tsconfig.json
β βββ postcss.config.mjs
β βββ eslint.config.mjs
β βββ src/
β βββ app/
β β βββ layout.tsx # Root layout (dark theme)
β β βββ page.tsx # Dashboard overview
β β βββ globals.css # Tailwind v4 base
β βββ components/
β β βββ ui/
β β βββ button.tsx # Shadcn button
β βββ lib/
β βββ utils.ts # cn() class merger
β
βββ sdk/
β βββ typescript/ # Official TS Client (@nirman/sdk)
β β βββ package.json
β β βββ tsconfig.json
β β βββ src/
β β βββ index.ts # NirmanClient class
β βββ python/ # Official Python Client
β βββ pyproject.toml
β βββ README.md
β βββ src/
β βββ nirman/
β βββ __init__.py
β βββ client.py # NirmanClient (httpx)
β
βββ shared/ # Cross-boundary TS interfaces
β βββ package.json
β βββ index.ts
β
βββ packages/
β βββ provider-sdk/ # [NEW] Interface contract for all providers
β βββ package.json
β βββ tsconfig.json
β βββ src/
β βββ index.ts # Public exports
β βββ types.ts # Shared provider types & interfaces
β βββ base/
β βββ provider.ts # BaseProvider abstract class
β
βββ database/ # Original SQL init script
β βββ init.sql
β
βββ infra/ # Infrastructure configs
β βββ nginx/ # Reverse proxy config
β βββ postgres/ # Migration SQL files
β βββ redis/ # Redis config
β βββ scripts/ # Utility scripts
β
βββ docs/ # Platform documentation
βββ lists/
βββ references/
βββ sdks/
βββ services/
βββ specs/
βββ tutorials/
- Docker & Docker Compose
- Node.js (v20+)
git clone https://github.com/yourusername/nirman-baas.git
cd nirman-baas
npm installdocker compose up --build -d| Service | URL |
|---|---|
| Admin Dashboard | http://localhost:3001 |
| API Gateway | http://localhost:8080 |
| Integrations Hub (Internal) | http://localhost:3000 |
| Realtime Server | ws://localhost:8000 |
| PostgreSQL | localhost:5432 |
| Redis | localhost:6379 |
TypeScript
import { NirmanClient } from "@nirman/sdk";
const client = new NirmanClient("nk_live_your_api_key_here");
await client.otp.send("+919876543210");Python
from nirman import NirmanClient
client = NirmanClient(api_key="nk_live_your_api_key_here")
client.otp.send(phone="+919876543210")BSD 3-Clause License. See LICENSE for details.