Getting Started
Setting up your development environment
This guide will help you set up the Beztack project on your local machine.
Prerequisites
Make sure you have installed:
Create a New Project
You can create a new Beztack project using the create-beztack command:
pnpm create beztackThe script will walk you through a few setup steps:
- Project name: The name for your new project (lowercase with dashes)
- Project description: A short description of your project
- 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
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 to .env:
cd your-project
cp .env.example .env2. Configure Required Variables
Open the .env file and set up the following variables:
BETTER_AUTH_SECRET: Secret key for Better AuthBETTER_AUTH_URL: Your application's base URLDATABASE_URL: Connection string for your PostgreSQL database
3. Initialize the Database
Run database migrations:
pnpm run migrateDevelopment
To start the dev server (UI + API):
pnpm run devThis will start:
- UI at http://localhost:5173
- API at http://localhost:3000
Additional Nx Commands
Beztack uses Nx for task execution. You can run individual apps:
- UI:
npx nx serve ui - API:
npx nx serve api - Docs:
npx nx serve docs(Defaults to http://localhost:3001)
Production Build
To build all projects:
pnpm run buildOr build specific projects:
npx nx build ui
npx nx build api