Prerequisites
Before you begin, ensure you have the following installed:Bun
Version 1.3 or higher
PostgreSQL
Version 17 (running locally)
Docker
For running Redis
If you don’t have Bun installed, visit bun.sh and follow the installation instructions for your operating system.
Installation Steps
Install Dependencies
Use Bun to install all workspace dependencies:This will install dependencies for all apps and packages in the monorepo.
Configure Environment
Copy the example environment file:Edit Copy environment variables to individual apps:
.env with your configuration:.env
Start Redis
Use Docker Compose to start Redis:This starts only Redis. PostgreSQL should already be running locally.
Apply Database Schema
Push the Drizzle schema to your database:This creates all tables, indexes, and relationships.
Load Demo Data (Optional)
Seed the database with sample data:This creates:
- A demo organization
- Sample categories and products
- Tables with QR codes
- An admin user account
Default Credentials
- Email:
[email protected] - Password:
admin12345
Start the Development Server
Launch both API and web app:Turborepo will start both applications in parallel:
| App | URL | Description |
|---|---|---|
| Web | http://localhost:3000 | Dashboard admin + customer flow |
| API | http://localhost:3001 | REST API + WebSocket |
Verify Installation
Test the API
Test the API
Check if the API is running:You should see a success response:
Access the Dashboard
Access the Dashboard
- Open http://localhost:3000 in your browser
- Log in with the seed credentials:
- Email:
[email protected] - Password:
admin12345
- Email:
- You should see the RestAI dashboard
Test WebSocket Connection
Test WebSocket Connection
The WebSocket server runs on the same port as the API:The web app automatically connects when viewing real-time features like the kitchen display.
What’s Next?
Explore the Features
Learn about menu management, orders, and settings
API Documentation
Understand authentication and available endpoints
Core Features
Configure organization settings, branches, and users
Deploy to Production
Deploy RestAI using Docker or your preferred platform
Available Scripts
Here are the most useful commands for development:Troubleshooting
Database connection failed
Database connection failed
Error:
Database connection failed or ECONNREFUSEDSolutions:- Verify PostgreSQL is running:
pg_isready - Check your
DATABASE_URLin.env - Ensure the database exists:
psql -l | grep restai - Verify credentials match your PostgreSQL setup
Redis connection error
Redis connection error
Error:
Redis connection failedSolutions:- Check if Redis container is running:
docker ps - Start Redis:
docker compose up -d - Verify
REDIS_URLin.envisredis://localhost:6379
Port already in use
Port already in use
Error:
EADDRINUSE: address already in use :::3000 or :::3001Solutions:- Find the process:
lsof -i :3000orlsof -i :3001 - Kill the process:
kill -9 <PID> - Or change the port in
.env
Bun command not found
Bun command not found
Error:
bun: command not foundSolutions:- Install Bun:
curl -fsSL https://bun.sh/install | bash - Restart your terminal
- Verify installation:
bun --version
Next Steps
Now that RestAI is running, you can:Create Your Organization
Register a new organization at http://localhost:3000/register