@devheptagon/mono
v1.0.0
Published
Scaffold a pnpm monorepo with apps (api, admin, web, mobile) and shared packages
Maintainers
Readme
@devheptagon/mono
Scaffold a pnpm monorepo with apps and shared packages. Creates a workspace skeleton, then invokes official CLIs for React (Vite) and React Native (Expo) apps.
Usage
# With pnpm
pnpm dlx @devheptagon/mono my-project
pnpm dlx @devheptagon/mono my-project --yes
# With npx
npx @devheptagon/mono my-projectOptions
| Option | Description |
|--------|-------------|
| -y, --yes | Skip prompts, use default project name |
| -f, --force | Overwrite existing files |
| --skip-install | Don't run pnpm install |
| --skip-apps | Only create skeleton; skip create-vite and create-expo-app |
API Structure (apps/api)
The API template includes:
- PostgreSQL via
pgwith connection pooling - Firebase Auth middleware (add
firebase-adminsdk.jsonto enable) - Rate limiting per route (global, auth, upload, public)
- Query helpers for pagination and sorting
- Stripe and Stream Chat scaffolding (configure via env)
- Buffer polyfill for Node.js 21+ compatibility
- Repos layer between handlers and DAL
Copy apps/api/env.local.example to apps/api/.env and fill in PGUSER, PGHOST, PGDATABASE, PGPASSWORD for the API to run.
Mobile Structure (apps/mobile/src)
After create-expo-app runs, the following is copied into apps/mobile/src/:
- components/core/ — XView, XText, XButton, XTextInput, XScrollView, XModal
- components/loading.tsx — Loading spinner
- contexts/ThemeContext.tsx — Theme provider (wrap your App with
<ThemeProvider>) - style/ — colors, layout utilities, theme (light/dark)
- utils/ — generic (delay, generateGuid, randomIntInRange), money (centsToDecimal, etc.)
- screens/HomeScreen.tsx — Example usage
Generated Structure
my-project/
├── apps/
│ ├── api/ # Node/Express + PostgreSQL (created by this tool)
│ ├── admin/ # Vite + React + TypeScript (via create-vite@latest)
│ ├── web/ # Vite + React + TypeScript (via create-vite@latest)
│ └── mobile/ # Expo React Native (via create-expo-app@latest) + src/ with UI components
├── packages/
│ ├── types/ # @devheptagon/types
│ ├── utils/ # @devheptagon/utils
│ ├── data/ # @devheptagon/data
│ └── assets/ # @devheptagon/assets
├── pnpm-workspace.yaml
├── package.json
├── tsconfig.base.json
├── AGENTS.md
└── .gitignoreNext Steps After Scaffold
cd my-project
pnpm install
pnpm run build # Build shared packages
pnpm run api # Start API
pnpm run admin # Start admin app
pnpm run web # Start web app
pnpm run mobile # Start Expo dev server
pnpm run typecheck # Run typecheck across workspaceLocal Development
pnpm install
pnpm run build
pnpm run create my-test-repo
# Or: pnpm run create my-test-repo -- --skip-apps --skip-install