A modern starter template for monorepos with Preact, Preact Signals, Firebase Functions, blazing fast builds, and trunk-based development support.
- ⚡ Blazing fast build with Turborepo
- 🛠 Instant development setup: Dev Containers support
- 🚀 Front-end & Functions examples: ready-to-use Vite + Preact + Preact Signals app and Firebase Functions
- 🌳 Bounded contexts architecture for large-scale projects
- 🏷 Full TypeScript coverage from backend to frontend
- 🔬 Vitest for built-in unit testing
- 🔄 Preconfigured CI/CD with GitHub Actions (build, test, lint)
- 🌿 Ready for trunk-based development
- 🔥 Single command deploy with
npm run deploy
- Node.js v22.x
- Docker (for Dev Containers)
- VS Code (recommended)
- Firebase CLI (
npm i -g firebase-tools, for manual deploy if needed)
(root)
├── <bounded-context>/
│ ├── business-rules/ # Pure business logic, no side effects
│ ├── http-interfaces/ # API interfaces (browser ↔️ server)
│ ├── functions/ # Firebase Functions backend
│ └── service/
│ ├── in-browser/ # Services for browser
│ └── in-server/ # Services for server
├── factory/
│ ├── in-browser/ # Factories for browser
│ └── in-server/ # Factories for server
└── web-app/ # Vite + Preact web application
- Install Docker and VS Code.
- Click the Dev Containers badge above or this link.
- VS Code will set up everything automatically in an isolated environment.
-
Install dependencies:
npm install
-
Preview app and Firebase emulator:
npm run preview
Open in browser: http://127.0.0.1:5000/
-
Development mode for frontend only:
npm run dev -w web-app
- Organize your code by creating new packages (contexts) as needed.
- Use the provided examples as a basis for your own modules.
- Vitest is preinstalled in all packages.
- Run tests for all packages:
turbo test
To run build, test, and lint for all packages:
turbo build test lintOr use VS Code default build task.
- The repository includes a GitHub Actions workflow for build, test, lint, and Firebase deployment on every push to the
mainbranch. - To deploy manually:
(make sure to run
npm run deploy
firebase loginbeforehand)
If you add, modify, or remove packages in the monorepo:
- Re-install dependencies:
npm install
- Then:
turbo build test lint
If you encounter any issues, feel free to open an issue in the repository. The author will try to help if time permits.
Project sponsorship is welcome. Contact the author for details.