Installation
Setup local del monorepo en menos de 5 minutos.
Prerequisitos
- Bun 1.3+
- Node 22+ (sólo para herramientas que aún no soportan Bun)
- PostgreSQL 15+ (local o Docker)
- Git
Clone & install
git clone <your-repo> my-saas
cd my-saas
bun installVariables de entorno
cp apps/server/.env.example apps/server/.envEdita apps/server/.env:
DATABASE_URL— Postgres connection stringBETTER_AUTH_SECRET— generá uno conopenssl rand -base64 32BETTER_AUTH_URL—http://localhost:3005en dev
Database
cd apps/server
bunx prisma migrate dev
bunx prisma generateRun
# desde la raíz
bun run dev- Client: http://localhost:3004
- Server: http://localhost:3005
- Docs: http://localhost:3004/docs
Dev services (Docker)
The dev stack includes Postgres, Redis, and MailHog (SMTP trap for E2E tests):
docker compose -f docker-compose.dev.yml up -dMailHog captures all outbound emails. Web UI: http://localhost:8025.
To route the server through it, set SMTP_HOST=localhost and SMTP_PORT=1025
in apps/server/.env.
First-run setup
The boilerplate ships with no built-in super-admin. The first time you load any URL with an empty user table, Next.js middleware redirects to /setup and a wizard creates the very first user with platformAdmin = true. After submitting, you land on /admin.
If you ever lose every platform admin (manual UPDATE, an incident wiped the user, etc.), use the recovery CLI to grant platformAdmin = true to an existing user without going through HTTP:
bun run platform:promote -- [email protected]See Platform admin → Bootstrap for the full flow and the race-safety guarantees.
Troubleshooting
@prisma/client did not initialize — corré bunx prisma generate desde apps/server/.
Server crashea con Invalid environment — el .env no existe o le faltan vars requeridas.