Skip to main content
Generates a deployment shell that composes one or more apps and includes platform-specific infrastructure configuration (Docker, Vercel, Lambda, or Cloudflare).

Usage

nx g @frontmcp/nx:server production --apps crm,analytics

Options

OptionTypeDefaultDescription
namestringRequired. The name of the server
appsstringRequired. Comma-separated app names to compose
directorystringservers/<name>The directory of the server
deploymentTargetnode | vercel | lambda | cloudflarenodeThe deployment target platform
redisdocker | existing | nonenoneRedis setup option (node target only)
tagsstringComma-separated tags

Generated Files

servers/production/
├── src/main.ts              # Entry point composing apps
├── Dockerfile               # Multi-stage Docker build
├── docker-compose.yml       # Docker Compose (+ Redis if selected)
├── .dockerignore
├── project.json
├── tsconfig.json
└── tsconfig.lib.json

Generated Code

The entry point imports and composes all specified apps:
src/main.ts
import 'reflect-metadata';
import { FrontMcp } from '@frontmcp/sdk';
import { CrmApp } from '../../apps/crm/crm.app';
import { AnalyticsApp } from '../../apps/analytics/analytics.app';

@FrontMcp({
  info: { name: 'Production Server', version: '0.1.0' },
  apps: [CrmApp, AnalyticsApp],
})
export default class Server {}

Nx Targets

TargetExecutorDescription
build@frontmcp/nx:buildCompile with deployment adapter
deploy@frontmcp/nx:deployDeploy to target platform

Example

# Node.js server with Docker Redis
nx g @frontmcp/nx:server production --apps crm,analytics --deploymentTarget node --redis docker

# Vercel deployment
nx g @frontmcp/nx:server edge --apps crm --deploymentTarget vercel

# Build and deploy
nx build production
nx deploy production