An open API service indexing awesome lists of open source software.

https://github.com/itssanthoshhere/ghost-arc

๐Ÿ‘ป AI-powered collaborative architecture design platform with real-time multiplayer canvas, Gemini AI agents, Liveblocks sync, and automated technical spec generation.
https://github.com/itssanthoshhere/ghost-arc

architecture-diagram collaborative-editor fullstack liveblocks postgresql prisma realtime-collaboration system-design triggerdev

Last synced: 2 days ago
JSON representation

๐Ÿ‘ป AI-powered collaborative architecture design platform with real-time multiplayer canvas, Gemini AI agents, Liveblocks sync, and automated technical spec generation.

Awesome Lists containing this project

README

          

Ghost Arc Banner

# ๐Ÿ‘ป Ghost Arc

### AI-Powered Collaborative System Architecture Platform

> Design scalable software systems with AI, collaborate in real-time, and generate production-ready technical specifications instantly.





















---

# ๐Ÿ“‹ Table of Contents

- [๐Ÿ“– About The Project](#-about-the-project)
- [โœจ Features](#-features)
- [๐Ÿง  How It Works](#-how-it-works)
- [๐Ÿ—๏ธ Architecture](#๏ธ-architecture)
- [โš™๏ธ Tech Stack](#๏ธ-tech-stack)
- [๐Ÿ“‚ Project Structure](#-project-structure)
- [๐Ÿš€ Getting Started](#-getting-started)
- [๐Ÿ” Environment Variables](#-environment-variables)
- [๐ŸŽฏ Core AI Workflow](#-core-ai-workflow)
- [โšก Performance Optimizations](#-performance-optimizations)
- [๐Ÿงช Future Improvements](#-future-improvements)
- [๐Ÿค Contributing](#-contributing)
- [๐Ÿ‘จโ€๐Ÿ’ป Author](#-author)

---

# ๐Ÿ“– About The Project

**Ghost Arc** is an AI-powered collaborative architecture design platform that helps developers and software teams generate scalable system designs using natural language.

Instead of manually drawing architecture diagrams and writing lengthy technical documentation, users can simply describe a system like:

Design a scalable e-commerce backend with authentication,
payment gateway, Redis caching, and microservices

Ghost Arc uses **Google Gemini AI** to autonomously generate architecture nodes and connections on a collaborative React Flow canvas in real time.

Multiple users can join the same workspace, edit diagrams together, and generate production-ready technical specifications instantly.

---

## ๐ŸŽฏ Problem It Solves

Modern software teams often struggle with:

- Manual architecture diagram creation
- Outdated technical documentation
- Slow collaboration workflows
- Repetitive system design discussions
- Poor visibility into architectural decisions

Ghost Arc solves this by combining:

- ๐Ÿค– AI-generated architecture planning
- โšก Real-time multiplayer collaboration
- ๐Ÿง  AI-generated technical documentation
- ๐Ÿ“ฆ Persistent project management
- ๐Ÿ”„ Live synchronization across users

---

# โœจ Features

## ๐Ÿค– AI Architecture Agent

Describe your system in plain English and let Gemini AI generate architecture diagrams automatically.

---

## ๐Ÿ‘ฅ Multiplayer Collaboration

Real-time shared canvas powered by Liveblocks:

- Live cursors
- Presence indicators
- Shared canvas state
- Synchronized editing

---

## ๐Ÿง  AI Technical Specification Generator

Generate multi-page Markdown technical specifications directly from the architecture graph.

Includes:

- System overview
- Database design
- API architecture
- Deployment recommendations
- Scalability notes

---

## ๐ŸŽจ Interactive React Flow Canvas

Supports:

- Drag & drop nodes
- Resizable components
- Custom node styling
- Dynamic edges
- Inline editing
- Color customization

---

## ๐Ÿ’พ Persistent Project Storage

Projects are stored using:

- PostgreSQL (metadata)
- Blob storage (spec files)
- JSON canvas persistence

---

## ๐Ÿ” Authentication & Access Control

Secure authentication powered by Clerk:

- Sign in / Sign up
- Protected routes
- Session handling
- User-based project access

---

## โšก Background AI Workflows

Long-running AI tasks handled by Trigger.dev:

- AI architecture generation
- Spec generation
- Retry handling
- Workflow orchestration

---

# ๐Ÿง  How It Works

## AI Architecture Generation Flow

```text
User Prompt
โ†“
Trigger.dev Background Task
โ†“
Gemini AI Tool Calling
โ†“
Structured Architecture Actions
โ†“
Liveblocks Storage Mutation
โ†“
Realtime Canvas Update
```

---

## Technical Specification Flow

```text
Canvas Graph
โ†“
Context Builder
โ†“
Gemini AI
โ†“
Markdown Generation
โ†“
Blob Storage Upload
โ†“
Downloadable Technical Spec
```

---

# ๐Ÿ—๏ธ Architecture

```text
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Frontend โ”‚
โ”‚ Next.js + React + React Flow โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ API Layer โ”‚
โ”‚ Next.js Route Handlers โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Background Workflows โ”‚
โ”‚ Trigger.dev โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ AI Processing โ”‚
โ”‚ Google Gemini Models โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Realtime Collaboration โ”‚
โ”‚ Liveblocks โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Persistence โ”‚
โ”‚ PostgreSQL + Prisma + Blob Storage โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

---

# โš™๏ธ Tech Stack

| Category | Technology | Purpose |
| --------------- | -------------- | ------------------------------- |
| Frontend | Next.js 16 | Full-stack React framework |
| UI | React 19 | Component-based architecture |
| Language | TypeScript | Type safety |
| Styling | TailwindCSS v4 | Utility-first styling |
| Realtime | Liveblocks | Multiplayer collaboration |
| Authentication | Clerk | Auth & user management |
| Database | PostgreSQL | Persistent storage |
| ORM | Prisma | Database modeling |
| AI | Google Gemini | AI architecture generation |
| Background Jobs | Trigger.dev | Async AI workflows |
| Flow Editor | React Flow | Interactive architecture canvas |
| Deployment | Vercel | Hosting platform |

---

# ๐Ÿ“‚ Project Structure

```bash
Ghost-Arc/
โ”‚
โ”œโ”€โ”€ app/
โ”‚ โ”œโ”€โ”€ api/ # API route handlers
โ”‚ โ”œโ”€โ”€ editor/ # Collaborative editor pages
โ”‚ โ”œโ”€โ”€ sign-in/ # Clerk auth pages
โ”‚ โ””โ”€โ”€ sign-up/
โ”‚
โ”œโ”€โ”€ components/
โ”‚ โ”œโ”€โ”€ editor/ # Canvas/editor components
โ”‚ โ””โ”€โ”€ ui/ # Reusable UI primitives
โ”‚
โ”œโ”€โ”€ hooks/ # Custom React hooks
โ”‚
โ”œโ”€โ”€ lib/
โ”‚ โ”œโ”€โ”€ ai/ # Gemini AI logic
โ”‚ โ”œโ”€โ”€ liveblocks/ # Liveblocks config
โ”‚ โ”œโ”€โ”€ prisma/ # Prisma client
โ”‚ โ””โ”€โ”€ utils/
โ”‚
โ”œโ”€โ”€ prisma/
โ”‚ โ”œโ”€โ”€ schema.prisma
โ”‚ โ””โ”€โ”€ migrations/
โ”‚
โ”œโ”€โ”€ trigger/
โ”‚ โ”œโ”€โ”€ design-agent.ts # AI architecture generation
โ”‚ โ””โ”€โ”€ generate-spec.ts # AI spec generation
โ”‚
โ”œโ”€โ”€ data/
โ”‚ โ”œโ”€โ”€ canvas/
โ”‚ โ””โ”€โ”€ specs/
โ”‚
โ””โ”€โ”€ types/
```

---

# ๐Ÿš€ Getting Started

## Prerequisites

Make sure you have installed:

- Node.js >= 18
- npm
- PostgreSQL
- Git

---

## 1. Clone Repository

```bash
git clone https://github.com/Itssanthoshhere/Ghost-Arc.git

cd Ghost-Arc
```

---

## 2. Install Dependencies

```bash
npm install
```

---

## 3. Setup Environment Variables

Create a `.env.local` file in the root directory.

---

# ๐Ÿ” Environment Variables

```env
# Clerk

NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=

CLERK_SECRET_KEY=

NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in

NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

# Liveblocks

NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY=

LIVEBLOCKS_SECRET_KEY=

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

# Trigger.dev

TRIGGER_PROJECT_REF=

TRIGGER_SECRET_KEY=

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

# Database

DATABASE_URL=

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

# Blob Storage

BLOB_READ_WRITE_TOKEN=

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

# Google AI

GOOGLE_AI_API_KEY=

# Optional
GEMINI_MODEL=

GEMINI_SPEC_MODEL=

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

APP_URL=http://localhost:3000
```

---

## 4. Setup Prisma

```bash
npx prisma generate

npx prisma migrate dev
```

---

## 5. Run Development Server

```bash
npm run dev
```

Open:

```txt
http://localhost:3000
```

---

## 6. Start Trigger.dev Worker

Open a second terminal:

```bash
npx trigger.dev@latest dev
```

---

# ๐ŸŽฏ Core AI Workflow

## Step 1 โ€” User Prompt

User submits a natural language architecture request.

Example:

```txt
Build a scalable SaaS backend with Redis,
PostgreSQL, authentication, and microservices
```

---

## Step 2 โ€” Trigger.dev Background Task

A long-running background workflow is triggered.

---

## Step 3 โ€” Gemini AI Tool Calling

Gemini AI receives:

- system prompts
- canvas context
- available architecture tools

AI generates structured actions like:

```json
{
"tool": "addNode",
"input": {
"label": "API Gateway"
}
}
```

---

## Step 4 โ€” Liveblocks Sync

Canvas state updates are broadcast in real time to all connected users.

---

## Step 5 โ€” Technical Spec Generation

The final architecture graph is transformed into a detailed Markdown technical document.

---

# โšก Performance Optimizations

- Debounced canvas auto-save
- Background AI workflows
- Blob-based specification storage
- Incremental realtime updates
- Shared collaborative state synchronization
- Optimized React Flow rendering

---

# ๐Ÿงช Future Improvements

- [ ] AI diff previews before applying changes
- [ ] Canvas version history
- [ ] Multiplayer commenting
- [ ] Voice-based architecture generation
- [ ] AI architecture recommendations
- [ ] Dockerized deployment
- [ ] Kubernetes deployment templates
- [ ] Testing suite (Vitest + Playwright)
- [ ] Prompt injection protection
- [ ] Rate limiting & abuse prevention

---

# ๐Ÿค Contributing

Contributions are welcome!

## Steps

```bash
1. Fork the repository
2. Create your feature branch
3. Commit your changes
4. Push to GitHub
5. Open a Pull Request
```

---

# ๐Ÿ‘จโ€๐Ÿ’ป Author

## V S Santhosh

- ๐ŸŒ Portfolio: [https://santhosh-vs-portfolio.vercel.app](https://santhosh-vs-portfolio.vercel.app)
- ๐Ÿ’ผ LinkedIn: [https://linkedin.com/in/thesanthoshvs](https://linkedin.com/in/thesanthoshvs)
- ๐Ÿ™ GitHub: [https://github.com/Itssanthoshhere](https://github.com/Itssanthoshhere)

---

# ๐Ÿ“œ License

This project is licensed under the MIT License.

---

### โญ If you found this project interesting, consider giving it a star!

Built with โค๏ธ by Itssanthoshhere

---