惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Last Week in AI
Last Week in AI
D
DataBreaches.Net
腾讯CDC
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
罗磊的独立博客
月光博客
月光博客
MyScale Blog
MyScale Blog
U
Unit 42
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
G
Google Developers Blog
博客园 - 【当耐特】
D
Docker
I
InfoQ
雷峰网
雷峰网

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work Top 15 Reinforcement Learning Questions That Will Appear in Exams The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026
I built a CLI that scaffolds complete multi-tenant SaaS apps
Jean-David B · 2026-04-17 · via DEV Community

Jean-David Bonicel

After building the same multi-tenant platform architecture over and over -- React shell, micro-frontends, Spring Boot backends, API gateway, shared UI kit, tenant isolation, auth -- I decided to automate it.

apps-generator is a Python CLI that scaffolds a complete full-stack tenant app from a few commands. You describe your resources, and it generates everything: backend CRUD with tenant isolation, typed API client, data-fetching frontend pages with charts, Docker Compose, Kubernetes manifests, and CI/CD pipelines.

What it generates

6 templates that wire together automatically:

  • platform-shell -- React host app with Module Federation, Clerk/OIDC auth, org switcher, i18n (EN/FR)
  • frontend-app -- React micro-frontends with data-aware pages (list tables, create forms, dashboards with Recharts)
  • api-domain -- Spring Boot 3 backends with DDD architecture, PostgreSQL, Hibernate tenant filter, CRUD from resource schema
  • api-gateway -- Spring Cloud Gateway with JWT validation, tenant header forwarding, correlation IDs
  • api-client -- Typed TypeScript fetch client shared across all MFEs, with auto-generated types from resource schema
  • ui-kit -- 26 shadcn/ui components + Recharts charts + Storybook

How it works

# Generate infrastructure
appgen generate ui-kit -o ./ui-kit -s projectName=my-ui-kit
appgen generate api-client -o ./api-client -s projectName=my-api-client
appgen generate api-gateway -o ./gateway -s projectName=my-gateway \
  -s basePackage=com.example.gateway

# Generate a backend with CRUD resources
appgen generate api-domain -o ./product-service \
  -s projectName=product-service \
  -s basePackage=com.example.products \
  -s 'resources=[{
    "name": "product",
    "fields": [
      {"name": "name", "type": "string", "required": true},
      {"name": "price", "type": "decimal", "required": true},
      {"name": "stock", "type": "integer"}
    ]
  }]' \
  --gateway ./gateway --api-client ./api-client

# Generate the shell + a micro-frontend with pages
appgen generate platform-shell -o ./shell -s projectName=my-platform \
  --uikit ./ui-kit --api-client ./api-client

appgen generate frontend-app -o ./products -s projectName=products \
  -s 'pages=[
    {"path":"dashboard","label":"Dashboard","resource":"product","type":"dashboard"},
    {"path":"list","label":"Products","resource":"product","type":"list"},
    {"path":"new","label":"New Product","resource":"product","type":"form"}
  ]' \
  --shell ./shell --uikit ./ui-kit --api-client ./api-client

# Generate Docker Compose and start everything
appgen docker-compose .
docker compose up --build

Enter fullscreen mode Exit fullscreen mode

Open http://localhost and you have a working multi-tenant app with auth, CRUD, tenant isolation, charts, and i18n.

What makes it different

Tenant isolation at the ORM level

Every entity extends TenantAwareEntity which has a Hibernate @Filter that automatically adds WHERE tenant_id = :tenantId to every query. Even findAll() is tenant-scoped. You cannot leak data across tenants.

Resource schema is the single source of truth

You define fields once in JSON. The CLI generates:

  • Java entity with JPA annotations
  • Spring Data repository with tenant-scoped queries
  • Service layer with CRUD operations
  • REST controller with validation
  • Create/Update/Response DTOs with Bean Validation
  • Liquibase database migration
  • Integration test with Testcontainers
  • TypeScript interfaces in the shared API client

Backend and frontend types match by construction -- no manual sync needed.

Data-aware pages

When you specify "type": "list" or "type": "form" on a page, the generator creates a real component with data fetching:

  • List pages get a shadcn Table with pagination and useQuery
  • Form pages get typed inputs with validation and useMutation
  • Dashboard pages get stat cards and Recharts bar charts

Everything wires together

  • --shell registers MFEs in the shell's remotes.json
  • --gateway registers routes in the gateway's routes.yaml
  • --uikit links the shared component library with the Tailwind theme
  • --api-client generates TypeScript types and links the shared fetch client

No manual configuration between projects.

The stack

Layer Technology
Shell React 18, Module Federation, Clerk/OIDC, i18next
MFEs React 18, Vite, TanStack Query, TypeScript
UI Kit 26 shadcn/ui components, Recharts, Tailwind CSS, Storybook
Gateway Spring Cloud Gateway, JWT, correlation IDs, security headers
Backend Spring Boot 3, JPA/Hibernate, PostgreSQL, Liquibase, Testcontainers
Infra Docker Compose, Kubernetes (Kustomize), GitHub Actions CI/CD

Built-in security

  • Correlation ID tracing across the full stack (shell -> gateway -> backend)
  • Security headers: CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy
  • CORS configuration with environment-based allowed origins
  • OAuth2/JWT validation with dev escape hatch (@Profile("local"))
  • Structured error responses with correlation IDs for debugging

Open source

The project is GPL v3 and on GitHub:

https://github.com/jeandbonicel/apps-generator

  • 89+ automated tests
  • Full EN/FR i18n support
  • Comprehensive docs covering architecture, security, multi-tenancy, and deployment
  • Contribution guide with PR templates and CI on every PR

If you build multi-tenant SaaS apps and are tired of scaffolding the same architecture every time, give it a try. Feedback and contributions welcome.