π Description
A modern, production-grade microservices monorepo designed to help developers build scalable, AI-powered applications quickly using Next.js, Express, Prisma, and PostgreSQL β enhanced with built-in AI (chat + RAG), payment integrations, and optimized for real-world deployment.
π Check out the package here:
https://www.npmjs.com/package/create-luff-app
π Introduction
Building scalable applications from scratch can be time-consuming and complex. Setting up authentication, APIs, databases, infrastructure, AI capabilities, and payments often takes longer than building the actual product.
Thatβs where Luff Microservices Boilerplate comes in.
Itβs a production-ready monorepo designed to eliminate setup friction and let you focus on building features β not infrastructure.
Now extended with AI-first capabilities and payment integrations, it enables you to build modern SaaS applications faster than ever.
β‘ Why Luff Boilerplate?
This boilerplate is built with a strong focus on:
- π Speed β Instant project setup with CLI
- π§± Scalability β Microservices architecture
- π§βπ» Developer Experience β Clean structure + modern tooling
- π Production Readiness β Auth, DB, infra pre-configured
- π€ AI Ready β Built-in chatbot + RAG support
- π³ Monetization Ready β Payment gateway integration support
ποΈ Architecture Overview
The system follows a clean microservices architecture:
- API Gateway handles routing, rate limiting, and service orchestration
- Auth Service manages authentication via Google OAuth + JWT
- Posts Service handles blog/content operations
- AI Service enables chatbot + RAG pipelines
- Payment Service handles billing, subscriptions, and transactions
- Frontend App connects everything via a unified UI
This separation ensures:
- Better scalability
- Independent deployments
- Clean service boundaries
- Easy extensibility for AI and payments
π€ AI Capabilities (New)
Luff now comes with built-in AI support, enabling you to create intelligent applications out of the box.
Features:
-
AI Chatbot (Generic Mode)
- Direct LLM-based conversations
-
RAG (Retrieval-Augmented Generation)
- Upload PDFs or documents
- Convert into embeddings
- Context-aware responses
-
Multi-Provider Support
- Works with OpenAI, Groq, or other providers
-
Extensible AI Layer
- Easily build custom assistants (support bot, docs bot, etc.)
π³ Payment Integration (New)
Luff includes a foundation for integrating payment systems into your application.
Features:
- Subscription-based billing
- One-time payments
- Secure webhook handling
- User-level billing tracking
π Easily integrate providers like:
- Stripe
- Razorpay
This allows you to build monetizable SaaS products from day one.
π οΈ Tech Stack Breakdown
Frontend
- Next.js (App Router)
- Tailwind CSS
- React Query
Backend
- Node.js + Express
- TypeScript
Database
- PostgreSQL
- Prisma ORM
Authentication
- Google OAuth (PostMessage flow)
- JWT-based sessions
AI Layer
- LLM APIs (OpenAI / Groq)
- Embeddings + Vector DB (RAG support)
Payments
- Stripe / Razorpay integration ready
Infrastructure
- Docker (local + production)
- Kubernetes (ArgoCD-ready)
Monorepo
- Turborepo
- npm workspaces
π Quick Start
You can bootstrap your entire project in seconds:
npx create-luff-app my-app
This command:
- Clones the repo
- Installs dependencies
- Sets up project structure
- Optionally configures AI and payment modules
βοΈ Local Development Setup
1. Install Dependencies
npm install
2. Setup Environment
npm run setup
3. Start Databases (Docker)
docker compose -f docker/docker-compose.yml up auth-db posts-db -d
4. Initialize Databases
cd backend/auth && npm run db:push && npm run db:generate
cd backend/posts && npm run db:push && npm run db:generate
5. Run the App
npm run dev
π Services Running Locally
- Frontend β http://localhost:3000
- API Gateway β http://localhost:4000
- Auth Service β http://localhost:4001
- Posts Service β http://localhost:4002
- AI Service β http://localhost:4003 (if enabled)
- Payment Service β http://localhost:4004 (if enabled)
π Project Structure
The monorepo is cleanly organized:
-
frontend/β Next.js app -
backend/auth/β Authentication service -
backend/posts/β Blog service -
backend/api-gateway/β Routing layer -
backend/ai/β AI + RAG service -
backend/payments/β Payment service -
shared/β Common utilities -
docker/β Container setup -
k8s/β Kubernetes configs
π Authentication Setup
To enable Google OAuth:
- Create credentials in Google Cloud Console
- Add origin:
http://localhost:3000 - Update environment variables:
GOOGLE_CLIENT_ID=
NEXT_PUBLIC_GOOGLE_CLIENT_ID=
π€ AI Setup
Add your provider keys:
OPENAI_API_KEY=
GROQ_API_KEY=
Optional (for RAG):
VECTOR_DB_URL=
VECTOR_DB_TOKEN=
π³ Payment Setup
Configure your payment provider:
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
OR
RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=
π³ Deployment Options
Docker
docker compose up --build
Kubernetes
kubectl apply -f k8s/
π Useful Scripts
-
npm run devβ Start all services -
npm run buildβ Build everything -
npm run setupβ Setup env files -
npm run lintβ Run lint checks
π‘ Final Thoughts
The Luff Microservices Boilerplate is more than just a starter template β itβs a complete foundation for building modern AI-powered SaaS applications.
Whether you're:
- Building a SaaS product
- Adding AI to your app
- Implementing RAG workflows
- Monetizing with subscriptions
- Practicing system design
Luff gives you a serious head start.
π Start Building Today
Skip the setup. Focus on building.
npx create-luff-app your-app
π License
MIT License β free to use, modify, and scale.


Top comments (0)