Skip to main content

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

1

Clone the Repository

Clone RestAI to your local machine:
git clone <repo-url>
cd restai
2

Install Dependencies

Use Bun to install all workspace dependencies:
bun install
This will install dependencies for all apps and packages in the monorepo.
3

Configure Environment

Copy the example environment file:
cp .env.example .env
Edit .env with your configuration:
.env
# PostgreSQL (your local instance)
DATABASE_URL=postgresql://usuario:password@localhost:5432/restai

# Redis (via Docker)
REDIS_URL=redis://localhost:6379

# JWT Secrets (change in production)
JWT_SECRET=your-secure-secret-here
JWT_REFRESH_SECRET=another-different-secret-here

# API Configuration
API_PORT=3001
API_URL=http://localhost:3001

# Web App
NEXT_PUBLIC_API_URL=http://localhost:3001
Change JWT_SECRET and JWT_REFRESH_SECRET to strong, random values in production.
Copy environment variables to individual apps:
# Copy to API and database package
cp .env apps/api/.env
cp .env packages/db/.env

# Web app only needs API URL
echo "NEXT_PUBLIC_API_URL=http://localhost:3001" > apps/web/.env
4

Start Redis

Use Docker Compose to start Redis:
docker compose up -d
This starts only Redis. PostgreSQL should already be running locally.
Verify Redis is running: docker ps should show a redis container.
5

Create Database

Create the PostgreSQL database (if it doesn’t exist):
createdb restai
Or using psql:
CREATE DATABASE restai;
6

Apply Database Schema

Push the Drizzle schema to your database:
bun run db:push
This creates all tables, indexes, and relationships.
7

Load Demo Data (Optional)

Seed the database with sample data:
bun run db:seed
This creates:
  • A demo organization
  • Sample categories and products
  • Tables with QR codes
  • An admin user account
Default Credentials
8

Start the Development Server

Launch both API and web app:
bun run dev
Turborepo will start both applications in parallel:
AppURLDescription
Webhttp://localhost:3000Dashboard admin + customer flow
APIhttp://localhost:3001REST API + WebSocket

Verify Installation

Check if the API is running:
curl http://localhost:3001/health
You should see a success response:
{
  "success": true,
  "data": {
    "status": "ok",
    "timestamp": "2026-03-02T..."
  }
}
  1. Open http://localhost:3000 in your browser
  2. Log in with the seed credentials:
  3. You should see the RestAI dashboard
The WebSocket server runs on the same port as the API:
ws://localhost:3001/ws
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:
# Start both API and Web in dev mode
bun run dev

# Build for production
bun run build

# Run linting
bun run lint

Troubleshooting

Error: Database connection failed or ECONNREFUSEDSolutions:
  • Verify PostgreSQL is running: pg_isready
  • Check your DATABASE_URL in .env
  • Ensure the database exists: psql -l | grep restai
  • Verify credentials match your PostgreSQL setup
Error: Redis connection failedSolutions:
  • Check if Redis container is running: docker ps
  • Start Redis: docker compose up -d
  • Verify REDIS_URL in .env is redis://localhost:6379
Error: EADDRINUSE: address already in use :::3000 or :::3001Solutions:
  • Find the process: lsof -i :3000 or lsof -i :3001
  • Kill the process: kill -9 <PID>
  • Or change the port in .env
Error: bun: command not foundSolutions:
  • Install Bun: curl -fsSL https://bun.sh/install | bash
  • Restart your terminal
  • Verify installation: bun --version
If you encounter issues not listed here, check the GitHub Issues or open a new issue.

Next Steps

Now that RestAI is running, you can:
1

Create Your Organization

Register a new organization at http://localhost:3000/register
2

Set Up Your Menu

Add categories, items, and modifiers in the menu management section
3

Configure Tables

Create tables with QR codes for customer access
4

Test Customer Flow

Scan a QR code and place a test order
5

Explore Features

Try the POS system, kitchen display, and reports

Build docs developers (and LLMs) love