Skip to Content
Adding an App

Adding an App

How to add a new Next.js app to the monorepo.

1. Copy an existing app

cp -r apps/energy apps/my-app

2. Update package.json

Change the package name and port:

{ "name": "@numa/my-app", "scripts": { "dev": "next dev --turbopack -p 300X", "start": "next start -p 300X" } }

3. Update proxy.ts

Adjust the routing rules for your new platform’s needs.

4. Add root scripts

In the root package.json, add convenience scripts:

{ "scripts": { "dev:my-app": "turbo run dev --filter=@numa/my-app", "build:my-app": "turbo run build --filter=@numa/my-app" } }

5. Add environment variable

Add the cross-app URL to .env.example:

NEXT_PUBLIC_MY_APP_URL=http://localhost:300X

And update @numa/config to export the new URL if needed.

6. Install and verify

pnpm install pnpm turbo run dev --filter=@numa/my-app

App structure checklist

Your new app should have:

FilePurpose
package.jsonDependencies and scripts
next.config.tsNext.js config with i18n plugin and transpilePackages
tsconfig.jsonTypeScript config extending tooling
eslint.config.mjsESLint config extending shared config
.prettierrc.mjsPrettier config extending shared config
postcss.config.mjsPostCSS with Tailwind plugin
components.jsonshadcn configuration
proxy.tsEdge routing (locale, auth, permissions)
app/layout.tsxRoot layout with providers
app/error.tsxRoot error boundary
app/i18n/request.tsi18n re-export
app/[lang]/layout.tsxLocale layout
global.d.tsType declarations for packages

Port assignments

AppPort
Gateway3000
Energy3001
Operations3002
Finance3003
Shared3004
Docs3005
Last updated on