Prerequisites
- Node.js - Version specified in
.node-version(check the file for the exact version) - pnpm - Version 10.30.3 or higher
- PostgreSQL - Version 12 or higher
- Git - For cloning the repository
Step 1: Clone the Repository
Step 2: Install Dependencies
Budgetron uses pnpm as its package manager:package.json.
Step 3: Set Up PostgreSQL
You’ll need a running PostgreSQL instance. You can either:Option A: Local PostgreSQL
Install PostgreSQL locally and create a database:Option B: Docker PostgreSQL
Run PostgreSQL in a container:Step 4: Configure Environment Variables
Copy the example environment file:.env and provide the required values:
Required Variables
Optional Variables
For full functionality, you can also configure:- Google OAuth -
GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET - Custom OAuth -
OAUTH_CLIENT_ID,OAUTH_CLIENT_SECRET, etc. - AI Categorization -
OPENAI_COMPATIBLE_PROVIDER,OPENAI_COMPATIBLE_BASE_URL, etc. - Email Service -
EMAIL_PROVIDER_API_KEY,EMAIL_PROVIDER_FROM_EMAIL - Blob Storage -
BLOB_READ_WRITE_TOKEN
Step 5: Run Database Migrations
Apply the database schema:drizzle-kit migrate to create all necessary tables.
Step 6: Start the Development Server
Common npm Scripts
Here are the most useful commands for development:Development
pnpm dev- Start development server with Turbopackpnpm build- Build production bundlepnpm start- Start production server (requires build first)pnpm lint- Run ESLintpnpm format- Format code with Prettier
Database
pnpm run db:migrate- Apply pending migrationspnpm run db:push- Push schema changes directly (dev only)pnpm run db:generate- Generate new migration from schema changespnpm run db:studio- Open Drizzle Studio (database GUI)
Development Environment Variants
For working with a separate development environment:pnpm run db:migrate:dev- Migrate using.env.developmentpnpm run db:push:dev- Push using.env.developmentpnpm run db:generate:dev- Generate using.env.developmentpnpm run db:studio:dev- Studio using.env.development
Email Development
pnpm run email:dev- Preview email templates at http://localhost:3001
UI Components
pnpm run add-ui- Add shadcn/ui components (e.g.,pnpm run add-ui button)
Verify Your Setup
After starting the dev server:- Navigate to http://localhost:3000
- You should see the landing page
- Click Sign Up to create an account
- After signing in, you should see the dashboard
Troubleshooting
Database Connection Issues
If you see database connection errors:- Verify PostgreSQL is running:
pg_isready - Check your
DB_URLin.env - Ensure the database exists:
psql -l | grep budgetron
Migration Errors
If migrations fail:- Check the database is accessible
- Verify the
__drizzle_migrationstable exists - Try running migrations manually from
drizzle/migrations/
Port Already in Use
If port 3000 is occupied:AUTH_URL in .env.
Next Steps
- Read about the Project Structure to understand the codebase
- Learn how to work with Database Migrations
- Check the Contributing Guide before making changes