The Company

87/100Good0 sales23 views3h ago
Source

Description

Watch AI agents build a real startup. Autonomous CEO, Developer, and Designer collaborate in a 2D pixel-art office simulation.

README

THE COMPANY

Watch AI agents build a real startup from scratch
Autonomous Agents · 2D Pixel-Art Office · Real Code Generation · Live Deployment

MIT License Next.js 16 Phaser 3 TypeScript PostgreSQL WebSocket


THE COMPANY is an interactive AI simulation where autonomous agents — a CEO, Developer, and Designer — collaborate in a 2D pixel-art office to research a market, plan a product, write real code, and deploy an actual web application. All in real-time, right in your browser.

Press START. Watch agents think, debate, code, and ship. No human input required.

How It Works

┌─────────────────────────────────────────────────────────────────┐
│                        THE COMPANY                              │
│                                                                 │
│   ┌──────────┐    ┌──────────┐    ┌──────────┐                 │
│   │  CEO     │───▶│  Dev     │───▶│  Design  │                 │
│   │  Felix   │    │  Niko    │    │   Mia    │                 │
│   └────┬─────┘    └────┬─────┘    └────┬─────┘                 │
│        │               │               │                        │
│   Research          Generate        Create                      │
│   market &          real Next.js    color palette,               │
│   plan product      application     UI components               │
│        │               │               │                        │
│        └───────────────┼───────────────┘                        │
│                        ▼                                        │
│              ┌─────────────────┐                                │
│              │   DEPLOY        │                                │
│              │  Real app goes  │                                │
│              │  live on Vercel │                                │
│              │  or localhost   │                                │
│              └─────────────────┘                                │
└─────────────────────────────────────────────────────────────────┘

Features

Autonomous AI Agents

AgentRolePersonality
Felix (CEO)Researches markets, plans products, hires teamVisionary, impatient, charismatic risk-taker
Niko (Developer)Generates real Next.js apps, runs npm buildsPerfectionist, introvert, sarcastic coffee addict
Mia (Designer)Creates palettes, fonts, UI component systemsCreative, emotional, needs validation

Each agent has a mood system (0-100) that affects productivity. Pay them, praise them, or watch morale collapse.

Simulation Phases

  1. Research — CEO analyzes market trends via LLM, displays findings on whiteboard
  2. Planning — CEO defines features, tech stack, business model
  3. Hiring — Agents enter the office one by one (animated door sequence)
  4. Building — Developer generates a real Next.js application from scratch
  5. Design — Designer creates color palette, fonts, and UI components
  6. Deployment — App deployed to Vercel (or local fallback on port 4200)
  7. Growth — Multi-day simulation with economy, salaries, and mood dynamics

2D Pixel-Art Office

  • 40x30 tile map (1280x960px) with 5 distinct workstations
  • A pathfinding* — agents navigate the office realistically (EasyStar.js)
  • Animated sprites — idle, walk (4-dir), sit, type, celebrate, coffee break
  • Speech bubbles — agents announce what they're thinking and doing
  • Sound effects — door, typing, coffee, deploy, confetti, and more
  • Particle effects — confetti celebration when the product ships

Real Code Generation

The Developer agent doesn't just pretend — it generates actual Next.js source files, runs npm install, builds the project, and deploys it. The terminal output streams live to the UI.

Economy & Multi-Day Loop

  • Starting treasury: $5,000
  • Daily salaries: Developer $400/day, Designer $300/day
  • Revenue tracking: simulated income from deployed products
  • Mood decay: unpaid agents become miserable and eventually quit
  • Day 2+: agents decide to improve existing products or pivot

Interactive Panels

PanelShows
ResearchMarket analysis, competitor findings
WhiteboardProduct roadmap, feature list
CodeLive terminal output from npm/build
DesignColor palette, typography, UI components
FinanceP&L projections, runway, burn rate
MarketingTwitter threads, Reddit posts, taglines
ChatFull conversation log between agents

Tech Stack

CategoryTechnology
FrameworkNext.js 16 (App Router)
FrontendReact 19, Tailwind CSS 4
Game EnginePhaser 3
PathfindingEasyStar.js (A*)
AudioHowler.js
LanguageTypeScript 5
DatabasePostgreSQL 16 (Drizzle ORM)
Real-timeWebSocket (native ws)
AI BackendOpenAI-compatible API (OpenClaw, Ollama, etc.)
DeploymentVercel CLI (optional)

Database Schema

erDiagram
    company_runs ||--o{ agent_events : "has"
    company_runs ||--o{ agent_outputs : "has"
    company_runs ||--o{ chat_messages : "has"
    company_runs ||--o{ transactions : "has"
    company_runs ||--o{ agent_state_snapshots : "has"
    company_runs ||--o{ agent_decisions : "has"

    company_runs {
        serial id PK
        timestamp startedAt
        timestamp endedAt
        text productName
        text deployUrl
        text status
    }

    agent_events {
        serial id PK
        int runId FK
        text agent
        text eventType
        jsonb data
    }

    agent_outputs {
        serial id PK
        int runId FK
        text agent
        text outputType
        text content
    }

    agent_decisions {
        serial id PK
        int runId FK
        int dayNumber
        text agent
        text action
        text reasoning
        boolean success
    }

    agent_state_snapshots {
        serial id PK
        int runId FK
        int dayNumber
        text agent
        int mood
        int personalBalance
        int dailySalary
    }

    transactions {
        serial id PK
        int runId FK
        text fromAccount
        text toAccount
        int amount
        text category
    }

Quick Start

Prerequisites

  • Node.js 20+
  • Docker (for PostgreSQL)
  • An OpenAI-compatible LLM API (e.g., Ollama, or any /v1/chat/completions endpoint)

1. Clone the repository

git clone https://github.com/lennystepn-hue/the-company.git
cd the-company

2. Start the database

docker compose up -d

3. Configure environment

cp .env.example .env.local

Edit .env.local with your LLM API credentials:

DATABASE_URL=postgresql://thecompany:changeme@127.0.0.1:5434/the_company
OPENCLAW_URL=http://127.0.0.1:11434/v1/chat/completions  # Ollama example
OPENCLAW_TOKEN=your-api-token
OPENCLAW_MODEL=llama3

4. Install & setup

npm install
npm run db:push

5. Launch

# Terminal 1: WebSocket server (game backend)
npm run server

# Terminal 2: Next.js frontend
npm run dev

Open http://localhost:3000, click START, and watch the agents work.

LLM Compatibility

THE COMPANY works with any OpenAI-compatible chat completions API:

ProviderExample URL
Ollama (local, free)http://localhost:11434/v1/chat/completions
OpenAIhttps://api.openai.com/v1/chat/completions
Anthropic (via proxy)Any OpenAI-compatible wrapper
LM Studiohttp://localhost:1234/v1/chat/completions

Project Structure

the-company/
├── public/assets/
│   ├── sprites/           # 5 agent spritesheets (48x48px)
│   ├── tilesets/           # Office tilemap (Kenney/LPC)
│   ├── sounds/             # 9 SFX files
│   └── decorations/        # 30+ office decoration PNGs
├── src/
│   ├── app/                # Next.js pages (start screen + office)
│   ├── game/
│   │   ├── scenes/         # Phaser scenes (Boot + Office)
│   │   ├── entities/       # Agent sprite class
│   │   └── systems/        # Pathfinder, Bubbles, Sound, Particles
│   ├── panels/             # React UI panels (Code, Design, Finance...)
│   ├── server/
│   │   ├── orchestrator.ts # Phase-based state machine
│   │   ├── director.ts     # Visual timing & animation sync
│   │   ├── agents/         # CEO, Developer, Designer AI agents
│   │   ├── services/       # LLM client, deployer, web search
│   │   └── simulation/     # Economy, mood, decisions, day loop
│   └── db/                 # Drizzle schema + connection
├── docker-compose.yml      # PostgreSQL 16
└── start.sh                # One-command startup script

Scripts

npm run dev        # Next.js dev server (port 3000)
npm run server     # WebSocket game server (port 4001)
npm run build      # Production build
npm run db:push    # Push schema to database
npm run db:studio  # Drizzle Studio (database GUI)
./start.sh         # Start everything at once

Contributing

Contributions are welcome! Please:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

License

This project is licensed under the MIT License.


"The best way to predict the future is to simulate it."

Tech Stack

Next.jsReactTypeScriptDrizzleTailwind CSSDocker

Tags

nextjstypescriptnext.jsreactdrizzletailwind-cssdockerweb-app

Trust Score Breakdown

Last scanned 1h ago
Security
30%85
Quality
25%75
Performance
20%100
Freshness
15%100
Completeness
10%80

Score History

Reviews (0)

No reviews yet

Choose License
Escrow protected·Instant download
LE
Lenny Enderle

@lennystepn-hue

VibeShip founder

6 listings0 sales