Prerequisites
Before you begin, ensure you have the following installed:- Bun >= 1.1 (package manager and runtime)
- Node.js 18+ (for compatibility)
- PostgreSQL 15+ (local or hosted)
- Git (for version control)
Autonome uses Bun exclusively as its package manager. Never use npm or pnpm.
Installation Steps
1. Clone the Repository
2. Install Dependencies
Use Bun to install all project dependencies:package.json, including:
- TanStack Start framework
- React 19 and related libraries
- Database tools (Drizzle ORM)
- AI SDK and provider integrations
- UI components (shadcn/ui, Tailwind CSS v4)
3. Configure Environment Variables
Copy the example environment file and configure it:.env and fill in the required values:
Required Variables
Optional Variables
4. Set Up PostgreSQL Database
Local PostgreSQL Setup
If you don’t have PostgreSQL installed: macOS (Homebrew):DATABASE_URL in .env:
Using Hosted PostgreSQL
Alternatively, use a hosted PostgreSQL service:- Supabase: Free tier with generous limits
- Neon: Serverless PostgreSQL with branching
- Railway: Simple deployment and database hosting
5. Run Database Migrations
Apply the database schema:"Models", "Orders", "Trades").
6. Seed the Database (Optional)
Populate the database with default AI models:"Models" table for the four trading variants:
- Apex: Aggressive high-frequency trading
- Trendsurfer: Momentum-based trading
- Contrarian: Counter-trend strategies
- Sovereign: Conservative long-term positions
Running the Development Servers
Autonome has a split architecture with separate frontend and backend servers:Development Commands
Run Both Servers Concurrently
- API server on port 8081 (Hono backend)
- Frontend server on port 5173 (Vite + TanStack Start)
Run API Server Only
- Working on backend logic, oRPC procedures, or database queries
- Testing API endpoints independently
- Running the scheduler bootstrap
Run Frontend Only
- Working on UI components and styles
- The API server is already running separately
- Testing frontend-only changes
Vite Proxy Configuration: The frontend dev server automatically proxies
/api/* requests to the backend API server at http://localhost:8081. This is configured in vite.config.ts.When to Use Each Command
| Command | Use Case |
|---|---|
bun run dev:all | Default choice - Full-stack development with both servers |
bun run dev:api | Backend-focused work, oRPC procedures, database operations |
bun run dev | Frontend-focused work, UI components, styling |
Verifying Your Setup
1. Check Environment Configuration
Run the environment validation script:2. Access the Application
Once the dev servers are running:- Frontend: http://localhost:5173
- API: http://localhost:8081
- API Health Check: http://localhost:8081/health (if implemented)
3. Test Database Connection
Open Drizzle Studio to verify database connectivity:Troubleshooting
Port Already in Use
Error:EADDRINUSE: address already in use
Solution: Check if another process is using the port:
.env file:
Database Connection Failed
Error:Connection refused or authentication failed
Solutions:
-
Verify PostgreSQL is running:
-
Check DATABASE_URL format:
-
Test connection manually:
Bun Installation Issues
Error:bun: command not found
Solution: Install Bun:
Module Resolution Errors
Error:Cannot find module '@/...'
Solution: Ensure TypeScript path aliases are configured. Check tsconfig.json:
Migration Errors
Error:relation "Models" does not exist
Solutions:
-
Generate migrations after schema changes:
-
Apply migrations:
-
Reset database (destructive):
Vite Build Errors
Error: Build fails with TypeScript errors Solution: Run type checking:API Proxy Not Working
Symptom: Frontend can’t reach API endpoints Solutions:-
Verify API server is running:
-
Check VITE_API_URL in
.env: - Restart frontend dev server after changing environment variables.
Next Steps
Now that your development environment is set up:- Explore the codebase: Review Architecture to understand the project structure
- Run tests: See Testing for testing strategies
- Follow code style: Read Code Style for Biome rules and conventions
- Start coding: Check out the Contributing Guide for development workflow

