Swaraj is a modular, production-grade microservices starter kit built for fast, clean, and scalable product development. Itβs ideal for MVPs and real-world backend systems β blending structured monolith design with microservice-ready boundaries.
Unlike typical microservice starters, Swaraj starts simple β with a single unified core service for authentication, user management, and gateway logic β and scales gracefully as your product grows.
- β
Combined
core-service
for auth, user, and API gateway - β Additional plug-and-play services: notifications, schedulers, ML, agentic AI
- β Support for both Python (FastAPI) and Node.js (Express/Nest.js)
- β Clean project layout with modular folders
- β Independent DB containers per service (PostgreSQL, MongoDB, Redis)
- β Kafka-ready for async event communication
- β Docker-first setup (works out-of-the-box)
Layer | Tools |
---|---|
Backend | Python (FastAPI), Node.js (Express/Nest) |
Auth | JWT (inside core-service ) |
Messaging | Kafka / Redpanda |
Databases | PostgreSQL, MongoDB, Redis |
Containerization | Docker, Docker Compose |
Scheduling | APScheduler / BullMQ / Node-Cron |
ML & AI | Python-based services (PyTorch, LangChain, Transformers, etc.) |
Agentic AI | LangGraph / LangChain + MCP (Model Context Protocol) |
Migrations | Alembic / Prisma |
Testing | Pytest / Jest |
swaraj/
βββ core-service/ # Combines auth + user + API gateway logic
βββ notification-service/ # For email/SMS/in-app events
βββ process-engine/ # Cron-based or trigger-based scheduler
βββ ml-service/ # Model inference APIs (custom ML)
βββ agentic-ai-service/ # LangChain/LangGraph-based agent system
βββ shared-libs/ # Reusable logic (optional)
βββ databases/
β βββ postgres/
β βββ mongodb/
β βββ redis/
βββ docker-compose.yml
microservice/
βββ app/
β βββ main.py / main.ts
β βββ api/
β βββ core/
β βββ models/
β βββ repository/
β βββ services/
β βββ utils/
βββ migrations/
βββ tests/
βββ Dockerfile
βββ .env
βββ README.md
git clone https://github.com/your-org/swaraj.git
cd swaraj
docker-compose up --build
Each service runs in its own container. Use ports or a unified gateway path for routing.
- Unified core-service (auth + user + gateway)
- Redis/Postgres/Mongo DB containers
- Notification service scaffold
- Process engine (scheduler) setup
- ML service starter (model loading, inference APIs)
- Agentic AI service with LangChain + MCP server
- Kafka integration across services
- Observability (Prometheus + Grafana)
- GitHub Actions CI/CD pipelines
- Helm charts for Kubernetes deployment
Swaraj balances simplicity and scale:
- Begin unified (fewer services, less complexity)
- Maintain clean boundaries per module
- Add or extract services as the product matures
- Use open standards (Docker, Kafka, REST, JWT, gRPC)
- Encourage developer clarity over early abstraction
We welcome contributions of all kinds:
- Fork the repo
- Create a branch (
git checkout -b feature/my-feature
) - Make your changes
- Open a PR
Please follow code standards and folder conventions per service type.
Licensed under the MIT License
- FastAPI, LangChain, NestJS, Kafka
- The spirit of Swaraj β self-governed, modular, and scalable systems
- Real-world needs of fast-moving product teams and startup builders
For questions, ideas, or contributions β open an Issue or Discussion.