Skip to content

Swaraj is a modular, open-source microservices foundation designed for modern backend systems with built-in support for agents, MCP, and AI workflows. This repository serves as the central hub linking all core services like user-auth-gateway, notification, process-engine, and AI-driven services.

Notifications You must be signed in to change notification settings

thinklikeacto/swaraj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 

Repository files navigation

Swaraj πŸ›•

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.


🌟 Key Highlights

  • βœ… 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)

πŸ›  Tech Stack

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

🧱 Project Structure

Microservices

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

Service Structure Template

microservice/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ main.py / main.ts
β”‚   β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ repository/
β”‚   β”œβ”€β”€ services/
β”‚   └── utils/
β”œβ”€β”€ migrations/
β”œβ”€β”€ tests/
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ .env
└── README.md

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/your-org/swaraj.git
cd swaraj

2. Start All Services with Docker

docker-compose up --build

Each service runs in its own container. Use ports or a unified gateway path for routing.


πŸ›£ Roadmap

  • 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

πŸ”„ Design Philosophy

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

🀝 Contributing

We welcome contributions of all kinds:

  1. Fork the repo
  2. Create a branch (git checkout -b feature/my-feature)
  3. Make your changes
  4. Open a PR

Please follow code standards and folder conventions per service type.


πŸ“„ License

Licensed under the MIT License


πŸ™ Inspired By

  • 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

πŸ’¬ Connect

For questions, ideas, or contributions β€” open an Issue or Discussion.


About

Swaraj is a modular, open-source microservices foundation designed for modern backend systems with built-in support for agents, MCP, and AI workflows. This repository serves as the central hub linking all core services like user-auth-gateway, notification, process-engine, and AI-driven services.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published