Start All Services
The fastest way to start all development servers:- Server (API) -
http://localhost:3000 - Web (React app) -
http://localhost:4000 - Desktop (Electron) - Opens desktop window
Make sure Docker infrastructure services are running before starting dev servers. See Development Setup for details.
Run Individual Services
You can run each service independently for focused development:Server (Port 3000)
The Fastify backend API with WebSocket support:- Hot reload with tsx watch
- Loads environment from
.envfile - WebSocket server for real-time sync
- PostgreSQL database migrations
- BullMQ background jobs
Web App (Port 4000)
The React web application:- Hot module replacement (HMR)
- Vite dev server
- SQLite WASM database
- TailwindCSS v4
- PWA support
Desktop App
The Electron desktop application:- Electron with better-sqlite3
- Hot reload for renderer and main process
- Native SQLite database
- Auto-updates
On Windows, use
npm run dev:win to properly set environment variables.Watch Mode
Watch and rebuild core packages automatically:@brainbox/core@brainbox/crdt@brainbox/server
Development Workflows
Type Checking
Run TypeScript compiler without emitting files:Testing
Linting and Formatting
- ESLint - TypeScript, React, and import rules
- Prettier - Code formatting
- Husky - Git hooks for pre-commit checks
- lint-staged - Run linters on staged files
Building for Production
- Type checks with TypeScript
- Bundles with appropriate tooling (tsup, Vite, Electron Forge)
- Outputs to
dist/directories
Debug Mode
Enable debug logging for the server:debug package.
Database Inspection
Access the PostgreSQL database directly:Common Development Tasks
Reset Database
To start with a fresh database:This will delete all data. Use with caution.
Clear Local Storage
For the web app, clear browser storage:- Open DevTools (F12)
- Application → Storage → Clear site data
- Refresh the page
Rebuild Dependencies
If you encounter dependency issues:Environment Variables
Key environment variables for local development:Performance Tips
Faster Rebuilds
Use watch mode for packages you’re actively developing:Turbo Cache
Turbo caches build outputs. To clear the cache:Selective Builds
Build specific packages only:Next Steps
- Explore the project structure
- Review CLAUDE.md for architecture details
- Check CONTRIBUTING.md for contribution guidelines