Getting Started
Setting up your development environment
This guide helps you bootstrap a Beztack project locally.
Prerequisites
Make sure you have installed:
- Node.js 22 (the version CI runs)
- pnpm 11
- PostgreSQL with an empty database
- Git
Create a New Project
You can create a new Beztack project using the create-beztack command:
pnpm create beztackThe CLI will walk you through:
- Project name: The name for your new project (lowercase with dashes)
- Project description: A short description of your project
- Default currency and locale: An ISO 4217 code (for example
USD) and a BCP 47 tag (for exampleen-US), written to the.env.examplefiles. Beztack has no built-in default and the apps refuse to start without them. - Initialize Git repo?: Choose if you want to set up a new Git repository
- Install dependencies?: Choose if you want to automatically install dependencies using
pnpm install - Modules: Optional modules (payments, email, AI, OCR, state management) and, when payments is selected, the payment provider
The CLI copies this repository into your new folder. Its closing "Next steps"
message prints pnpm run push, which is not a script in the project. Use the
database commands below instead.
Template updates
Receiving later template changes as pull requests (Template Sync) is on the roadmap and not available yet. See Template Sync.
Initial Setup
Once the project is created, navigate to the directory and set up your environment:
1. Set Up Environment Variables
Copy the .env.example file of each app to .env:
cd your-project
cp apps/api/.env.example apps/api/.env
cp apps/ui/.env.example apps/ui/.env
cp apps/docs/.env.example apps/docs/.env2. Configure Required Variables
Open the .env files in each app directory and set the required variables.
At minimum, configure the database, BETTER_AUTH_SECRET, APP_NAME,
DEFAULT_CURRENCY, DEFAULT_LOCALE, the Resend settings, and the credentials
of the payment provider you plan to use (Polar or Mercado Pago, selected with
PAYMENT_PROVIDER).
3. Initialize the Database
Apply the migrations:
pnpm db:migrateTo sync the schema without migration files during early development, use pnpm db:push.
Development
Start all services in parallel:
pnpm devThis will start:
- UI at http://localhost:5173
- API at http://localhost:3000
- Docs at http://localhost:3002
Running Individual Apps
Beztack uses Nx for task execution. You can run individual apps:
- UI:
nx dev ui - API:
nx dev api - Docs:
nx dev docs
Production Build
To build all projects:
pnpm buildOr build specific projects:
nx build ui
nx build api