Scaffold a modern polyglot microservices monorepo in seconds.
Build complete applications using multiple programming languages (Node.js, Python, Go, Java, Next.js) in one organized workspace with Docker support, hot reload, and shared libraries.
Quick Start β’ Features β’ Commands β’ Documentation
create-polyglot is a CLI tool that scaffolds production-ready polyglot microservice projects. It automates the tedious setup work of creating a multi-language development environment, letting you focus on building features instead of configuring boilerplate.
Building a polyglot architecture normally requires:
- Creating consistent folder structures across services
- Writing Dockerfiles for each language
- Configuring docker-compose with proper networking
- Setting up monorepo tooling (Turborepo/Nx)
- Creating shared package structures
- Managing port allocations and health checks
create-polyglot does all of this automatically with a single command.
- π Rapid prototyping - Test architectural ideas quickly
- π Learning projects - Explore multiple languages in a structured environment
- π₯ Team onboarding - Give developers a standardized starting point
- ποΈ Microservices - Scaffold complete service-oriented architectures
- π Rapid Scaffolding - Generate complete polyglot monorepos with Node.js, Python (FastAPI), Go, Java (Spring Boot), Next.js, Remix, Astro, and SvelteKit
- π§© Flexible Presets - Choose between Turborepo, Nx, or a basic runner for task orchestration
- π³ Docker Integration - Auto-generated Dockerfiles and docker-compose.yaml with proper networking and port mappings
- π₯ Unified Hot Reload - Single command (
create-polyglot hot) for auto-restart/HMR across all services - π¦ Shared Libraries - Language-specific shared packages (Python modules, Go packages, Java libraries)
- π οΈ Extensible - Add/remove services, plugins, and libraries post-initialization
- π Configuration-Driven - Central
polyglot.jsonmanifest for all project settings - π¨ Developer Experience - Colorized logs, health checks, and real-time monitoring
- π Plugin System - Extensible lifecycle hooks for custom scaffolding logic
- β Safety Checks - Port collision detection, reserved name validation, graceful error handling
Open your terminal (command line) and run:
npm install -g create-polyglotDon't have npm? You'll need to install Node.js first.
Create a new project called "my-project" with Node.js and Python services:
create-polyglot init my-project --services node,python --yesThat's it! Your project is ready.
Go into your project folder and start everything:
cd my-project
create-polyglot devYour services are now running! π
| Technology | Type | Template Includes | Typical Use Cases |
|---|---|---|---|
| Node.js | Backend | Express server, hot reload | REST APIs, microservices, real-time apps |
| Python | Backend | FastAPI, uvicorn, async support | ML services, data processing, scientific computing |
| Go | Backend | net/http, high-performance setup | High-throughput services, system tools |
| Java | Backend | Spring Boot, Maven, production-ready | Enterprise applications, legacy integration |
| Next.js | Frontend | App router, React 18+, TypeScript | Full-stack web applications, SSR/SSG |
| Remix | Frontend | Loaders, actions, nested routing | Progressive web apps, enhanced forms |
| Astro | Frontend | Island architecture, content focus | Documentation sites, marketing pages |
| SvelteKit | Frontend | Svelte 4+, file-based routing | Interactive UIs, lightweight apps |
# Create a complete stack: API gateway (Node), ML service (Python), data service (Go), UI (Next.js)
create-polyglot init my-app --services node,python,go,frontend --preset turborepo --git --yesOnce you've created your project, here are the main commands you'll use:
create-polyglot devStarts all your services and shows their logs
create-polyglot add service payments --type nodeAdds a new Node.js service called "payments"
create-polyglot remove service paymentsRemoves the "payments" service from your project
create-polyglot servicesShows all services in your project
my-project/
βββ services/ # Microservices directory
β βββ node/ # Express REST API
β β βββ src/index.js # Entry point with health check endpoint
β β βββ package.json # Dependencies + dev script
β β βββ Dockerfile # Multi-stage production build
β βββ python/ # FastAPI service
β β βββ app/main.py # Async endpoints with uvicorn
β β βββ requirements.txt # Python dependencies
β β βββ Dockerfile # Optimized Python image
β βββ go/ # Go HTTP server
β β βββ main.go # High-performance handler
β β βββ go.mod # Go modules
β β βββ Dockerfile # Distroless production image
β βββ java/ # Spring Boot application
β β βββ src/ # Java source tree
β β βββ pom.xml # Maven configuration
β β βββ Dockerfile # JVM optimized build
β βββ frontend/ # Next.js application
β βββ app/ # App router pages
β βββ package.json # Frontend dependencies
β βββ Dockerfile # Node.js container
βββ packages/
β βββ shared/ # Node.js shared utilities
β βββ libs/ # Language-specific libraries
β βββ python/ # Shared Python package
β βββ go/ # Go module
β βββ java/ # Maven library
βββ plugins/ # Custom lifecycle hooks
βββ gateway/ # API gateway (optional)
βββ infra/ # Infrastructure configs
βββ compose.yaml # Docker Compose orchestration
βββ polyglot.json # Project manifest & configuration
βββ turbo.json / nx.json # Monorepo tooling (if preset chosen)
βββ package.json # Root workspace configuration
Key Files:
polyglot.json- Single source of truth for services, ports, and configurationcompose.yaml- Production-ready Docker setup with health checks and networkingturbo.jsonornx.json- Build cache and task pipelines (optional)
Perfect for students or developers learning new programming languages. Each service is a working example you can study and modify.
Create a complete app with:
- A Python service for data processing
- A Node.js service for your API
- A Next.js frontend for your website
Give your team a standardized starting point where everyone knows where to find things.
Test ideas quickly without spending hours on setup.
Interactive Mode (recommended for first-time users):
create-polyglot init my-projectThe wizard prompts for:
- Number of services to create
- Type for each service (Node/Python/Go/Java/Frontend)
- Custom names and port overrides
- Preset selection (Turborepo/Nx/Basic)
Non-Interactive Mode (CI/CD, scripting):
create-polyglot init my-project \
--services node,python,go,frontend \
--preset turborepo \
--git \
--yes| Flag | Description | Example |
|---|---|---|
-s, --services <list> |
Comma-separated service types | --services node,python,go,java,frontend |
--preset <name> |
Monorepo tool: turborepo, nx, or basic |
--preset turborepo |
--package-manager <pm> |
npm, pnpm, yarn, or bun | --package-manager pnpm |
--git |
Initialize git repository with initial commit | --git |
--no-install |
Skip dependency installation | --no-install |
--frontend-generator |
Use create-next-app for Next.js (fallback to template) |
--frontend-generator |
--with-actions |
Generate GitHub Actions CI workflow | --with-actions |
--force |
Overwrite existing directory | --force |
--yes |
Accept all defaults, no prompts | --yes |
# Full stack with Turborepo and GitHub Actions
create-polyglot init my-app --services node,python,frontend --preset turborepo --with-actions --git --yes
# Minimal setup with pnpm
create-polyglot init api-services --services node,go --package-manager pnpm --yes
# All languages, interactive port selection
create-polyglot init polyglot-demo --services node,python,go,java,frontend,remix,astro,sveltekitStart all Node.js and frontend services with colorized logs and health checks:
create-polyglot devHow it works:
- Reads
polyglot.jsonto discover services withdevscripts - Spawns concurrent processes with prefixed logs (color-coded)
- Probes
/healthendpoints with 15s timeout - Displays status: β (ready), β³ (starting), β (failed)
Default ports:
- Node.js services: 3001, 3002, 3003...
- Python (FastAPI): 3004
- Go: 3005
- Java (Spring Boot): 3006
- Frontend: 3000
create-polyglot hot [--services <subset>] [--dry-run]Aggregates hot reload across all languages:
- Node.js: Watches with nodemon, auto-restarts on file changes
- Next.js/Remix: Native HMR (Fast Refresh)
- Python: uvicorn auto-reload on .py changes
- Go: go run with file watcher, recompile on changes
- Java: Spring Boot DevTools hot swap
Options:
# Watch specific services only
create-polyglot hot --services node,python
# Dry run (see commands without executing)
create-polyglot hot --dry-run
# All services with full reload
create-polyglot hotRun all services (including Python/Go/Java) via containers:
create-polyglot dev --dockerExecutes docker compose up --build with:
- Multi-stage Dockerfiles for optimal image sizes
- Shared
app-netnetwork for inter-service communication - Volume mounts for development (source code sync)
- Health checks and restart policies
Stop services:
docker compose downDefault packages/shared for JavaScript/TypeScript utilities:
// packages/shared/index.js
export const greet = (name) => `Hello, ${name}!`;
// services/node/src/index.js
import { greet } from '../../packages/shared';Create shared code for Python, Go, or Java services:
# Python package (importable across FastAPI services)
create-polyglot add lib common-utils --type python
# Go module (reusable across Go services)
create-polyglot add lib shared-models --type go
# Java library (Maven dependency)
create-polyglot add lib data-types --type javaGenerated structures:
Python:
# packages/libs/common-utils/__init__.py
# packages/libs/common-utils/models.py
# packages/libs/common-utils/pyproject.tomlGo:
// packages/libs/shared-models/shared-models.go
// packages/libs/shared-models/go.modJava:
// packages/libs/data-types/src/main/java/com/example/DataTypes.java
// packages/libs/data-types/pom.xmlSee Shared Libraries Guide for usage patterns.
Make sure you installed create-polyglot globally:
npm install -g create-polyglotAnother program is using that port. Either:
- Stop the other program
- Use a different port:
--port 4000
Check that you have the language installed:
- Node.js:
node --version - Python:
python --version - Go:
go version - Java:
java -version
- Explore the structure - Look at the generated files to understand the layout
- Modify a service - Edit files in
services/<name>/to customize behavior - Add more services - Use
create-polyglot add serviceas your project grows - Read the docs - Check the documentation for advanced features
- π Documentation: See the docs folder for detailed guides
- π Found a bug? Open an issue on GitHub
- π‘ Have an idea? We welcome suggestions and contributions!
Extend create-polyglot with custom lifecycle hooks:
create-polyglot add plugin postgresGenerates plugins/postgres/index.js with hook skeleton:
module.exports = {
afterInit: async (config) => {
// Custom logic after project initialization
}
};See Plugin System Documentation.
Central manifest driving all operations:
{
"name": "my-project",
"preset": "turborepo",
"packageManager": "pnpm",
"services": [
{
"name": "api",
"type": "node",
"port": 3001,
"path": "services/api"
}
],
"sharedLibs": [
{
"name": "common-utils",
"type": "python",
"path": "packages/libs/common-utils",
"createdAt": "2024-01-15T10:30:00.000Z"
}
],
"plugins": {}
}Generated GitHub Actions workflow (with --with-actions):
- Triggers on push/PR to main
- Matrix testing across Node versions
- Dependency caching (npm/pnpm/yarn/bun)
- Runs test suite and builds
Extend for Docker publishing, multi-language testing, or deployment.
Modify generated templates:
- Add middleware, database connections, authentication
- Configure environment variables
- Integrate logging, monitoring, tracing
- Customize Dockerfiles for production optimization
See Guide: Extending Services.
This project is open source under the MIT License. Feel free to use it however you like!