Development
Setup
Generate local environment secrets (into apps/api/.env.local):
./create_local_secrets.sh
Start PostgreSQL and SMTP services:
docker compose up -d db mail
Available commands
# Run API and Web
bun dev
# Run linter and code formatter
bun lint
bun lint:fix
# Run test
bun run test
App: http://localhost:3000
Webmail for the SMTP: http://localhost:1080
Better-Auth OpenAPI in dev mode: http://localhost:3001/auth/reference
Folder Structure
.
├── apps
│ ├── api
│ │ ├── better-auth_migrations # user schema
│ │ ├── public
│ │ ├── src
│ │ │ ├── emails # email templates
│ │ │ ├── middleware
│ │ │ └── routes # endpoint definitions
│ │ └── tests
│ │ └── integration
│ └── web
│ ├── public
│ └── src
│ ├── components
│ │ ├── form
│ │ │ └── primitives
│ │ ├── layout
│ │ ├── ui
│ │ └── user
│ ├── hooks
│ ├── lib
│ └── routes # file-based route components
├── docs
├── packages
│ ├── schemas # form and endpoint definitions
│ └── shared
├── pgdata
└── scripts