DEV Community

Cover image for πŸš€ Luff Microservices Boilerplate: Build Production-Ready Apps Faster
Harsh Tanwar
Harsh Tanwar

Posted on

πŸš€ Luff Microservices Boilerplate: Build Production-Ready Apps Faster

🧠 What I Learned

While building the Luff Microservices Boilerplate, my primary focus was not just on writing code, but on designing a system that is scalable, maintainable, and production-ready.

Here are the key areas I focused on:

  • πŸ”§ End-to-End Architecture & Scalability

    Designed a microservices-based system with clear separation of concerns, enabling independent scaling of services.

  • βš™οΈ CI/CD & DevOps Practices

    Implemented modern development workflows including automated setups, containerization, and deployment-ready infrastructure.

This project helped me understand how real-world systems are structured beyond just frontend and backend covering infrastructure, deployment, and system design.


πŸ“ Description

A modern, production-grade microservices monorepo designed to help developers build scalable applications quickly using Next.js, Express, Prisma, and PostgreSQL all powered by Turborepo 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, and developer tooling 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.


⚑ 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 all pre-configured

πŸ—οΈ Architecture Overview

The system follows a clean microservices architecture:

  • API Gateway handles routing and rate limiting
  • Auth Service manages authentication via Google OAuth + JWT
  • Posts Service handles blog/content operations
  • Frontend App connects everything via a unified UI

This separation ensures:

  • Better scalability
  • Independent deployments
  • Clean service boundaries

πŸ› οΈ 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

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
Enter fullscreen mode Exit fullscreen mode

This command:

  • Clones the repo
  • Installs dependencies
  • Sets up project structure

βš™οΈ Local Development Setup

1. Install Dependencies

npm install
Enter fullscreen mode Exit fullscreen mode

2. Setup Environment

npm run setup
Enter fullscreen mode Exit fullscreen mode

3. Start Databases (Docker)

docker compose -f docker/docker-compose.yml up auth-db posts-db -d
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

5. Run the App

npm run dev
Enter fullscreen mode Exit fullscreen mode

🌐 Services Running Locally


πŸ“‚ Project Structure

The monorepo is cleanly organized:

  • frontend/ β†’ Next.js app
  • backend/auth/ β†’ Authentication service
  • backend/posts/ β†’ Blog service
  • backend/api-gateway/ β†’ Routing layer
  • shared/ β†’ Common utilities
  • docker/ β†’ Container setup
  • k8s/ β†’ Kubernetes configs

πŸ” Authentication Setup

To enable Google OAuth:

  1. Create credentials in Google Cloud Console
  2. Add origin: http://localhost:3000
  3. Update environment variables:
GOOGLE_CLIENT_ID=
NEXT_PUBLIC_GOOGLE_CLIENT_ID=
Enter fullscreen mode Exit fullscreen mode

🐳 Deployment Options

Docker

docker compose up --build
Enter fullscreen mode Exit fullscreen mode

Kubernetes

kubectl apply -f k8s/
Enter fullscreen mode Exit fullscreen mode

πŸ“œ 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 foundation for building real-world scalable systems.

Whether you're:

  • Building a SaaS product
  • Practicing system design
  • Preparing for interviews
  • Scaling a side project

This boilerplate gives you a serious head start.


πŸš€ Start Building Today

Skip the setup. Focus on building.

npx create-luff-app your-app
Enter fullscreen mode Exit fullscreen mode

Top comments (0)