A visual system design simulator that connects to GitHub repositories, reverse-engineers architecture, and runs real-time Monte Carlo simulations with AI-powered analysis and optimization suggestions — now with a built-in AI chat for designing, analyzing, and iterating on architectures conversationally.
- AI Chat — Embedded conversational assistant on the Home route for general architecture Q&A, design-aware analysis, and conversational design generation
- Visual Canvas Editor — Drag-and-drop node-based system design with React Flow
- Architecture Blocks — API Gateway, Service, Database, Cache, Message Queue, Load Balancer, CDN, Client, External API, Storage, and more
- GitHub Integration — OAuth sign-in, repository import, and architecture reverse-engineering
- Real-Time Simulation — Monte Carlo simulations with live SSE progress, traffic curves, failure injection, and growth scenarios
- Simulation Reports — Persistent reports containing reliability, scalability, cost, performance, and security analysis
- AI-Powered Analysis — AI-generated architecture insights and optimization suggestions using Google Gemini
- Team Collaboration — Create teams, invite members by email, and manage role-based access
- Design Management — Manage personal and team designs with versioned simulation history
- Audit Logging — Append-only audit logs for security, compliance, and debugging
- Dark/Light/System Themes — Fully customizable appearance and accent colors
- Settings — Profile, appearance, notifications, security, billing, and integrations
Resonance includes an embedded AI chat that lives on the Home route (/). The landing hero transitions seamlessly into an active conversation workspace — no page navigation required.
- General Architecture Q&A — Ask questions like "What is a circuit breaker?" or "Kafka vs RabbitMQ?" and get concise, technical answers
- Design-Aware Chat — Chat about an existing design and get answers that reference specific components, connections, and simulation metrics (e.g., "Why is my scalability score only 60?")
- Conversational Design Generation — Describe a system (e.g., "Build me a real-time notification system") and the AI generates a design that appears as an interactive card in the chat thread
- Quick Actions — One-click analysis chips when a design is linked: Find Bottlenecks, Suggest Improvements, Check Risks, Estimate Cost
- Persistent Conversations — Multiple searchable, resumable chat sessions listed in the sidebar, grouped by date
- Design Modification — Request changes to a linked design (e.g., "Add Redis cache") and apply suggestions directly
- Visit
/and type a question or system description into the hero composer - The workspace transitions to active mode — your prompt becomes the first message
- The AI streams its response token-by-token over SSE
- Generated designs appear as cards with component counts, estimated cost, and actions:
- Open in Canvas Editor — navigates to the Canvas Editor (explicit, user-initiated only)
- Run Simulation — triggers a simulation and streams results back into the chat
- Discard — removes the card from the thread
- To chat about an existing design, use "Chat about this design" from a design card or the design detail page — the session is linked to the design so every response is grounded in its components, connections, and latest simulation report
- Single-route experience — Landing and active modes both live on
/; transitions are client-side state changes via Zustand - SSE streaming —
chunk,generation,done,error, andheartbeatevents with idempotency-key support - Design context injection — Sessions linked to a design include components, connections, latest simulation, and optimization history in every prompt
- Performance — Singleton Gemini client, Redis-cached design context (5 min) and responses (24 hr), distributed locks to prevent duplicate AI calls, and optimistic UI
| Layer | Technology |
|---|---|
| Frontend | React 19 + Vite |
| Routing | React Router v7 |
| State Management | Zustand |
| Authentication | Clerk |
| Canvas | @xyflow/react (React Flow) |
| Styling | Tailwind CSS v3 |
| Animations | Anime.js |
| Icons | Lucide React |
| Backend | Node.js + Express |
| ORM | Prisma |
| Database | PostgreSQL |
| Cache / PubSub | Redis |
| Job Queue | BullMQ |
| Nodemailer + SMTP | |
| AI | Google Gemini |
| Monorepo | Turborepo |
- Node.js 20+
- npm
- Docker and Docker Compose
- A Clerk application
- PostgreSQL
- Redis
- SMTP credentials for team invitations
- Google Gemini API key
# Clone the repository
git clone <repo-url>
cd resonance
# Install dependencies
npm installCreate the environment files:
# Backend
cp apps/api/.env.example apps/api/.env
# Frontend
cp apps/web/.env.example apps/web/.envConfigure the required environment variables.
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/resonance?schema=public"
DIRECT_URL="postgresql://postgres:postgres@localhost:5432/resonance?schema=public"
REDIS_URL="redis://localhost:6379"
JWT_SECRET="your-jwt-secret"
CLERK_SECRET_KEY="sk_..."
CLERK_WEBHOOK_SECRET="whsec_..."
# SMTP
SMTP_HOST="smtp.gmail.com"
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER="your-email@gmail.com"
SMTP_PASS="your-app-password"
SMTP_FROM="noreply@resonance.com"
FRONTEND_URL="http://localhost:5173"
# AI
GEMINI_API_KEY="your-gemini-api-key"VITE_CLERK_PUBLISHABLE_KEY="pk_..."Never commit
.envfiles or expose secret keys in the frontend.
Start the local PostgreSQL and Redis services:
docker-compose up -dRun Prisma migrations and generate the Prisma client:
cd apps/api
npx prisma migrate dev
npx prisma generateStart the complete development environment:
npm run devThe application includes:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:3001 - PostgreSQL:
localhost:5432 - Redis:
localhost:6379
Frontend:
cd apps/web
npm run devBackend:
cd apps/api
npm run devSimulation worker:
cd apps/api
npm run workerResonance uses a background simulation pipeline powered by BullMQ and Redis.
The simulation engine supports:
- Steady traffic
- Bursty traffic
- Spiky traffic
- Seasonal traffic
- Randomized traffic
- Custom traffic curves
Simulation runs can use configurable Monte Carlo passes from 1 to 1000.
Results can include:
- Confidence intervals
- Latency distributions
- Throughput
- Error rates
- Resource utilization
- Reliability scores
- Capacity estimates
The simulator can model infrastructure and application failures such as:
- Network partitions
- Service crashes
- Resource exhaustion
- Database contention
- Dependency failures
- Increased latency
- Availability degradation
Traffic growth can be modeled using scenarios such as:
- 2× traffic
- 5× traffic
- 10× traffic
- Linear growth
- Exponential growth
The simulator estimates infrastructure costs across:
- Compute
- Storage
- Network traffic
- Databases
- Caches
- External APIs
- Other architecture components
Simulation runs support deterministic seeds.
Using the same architecture, configuration, and seed produces reproducible simulation results, making it easier to compare architectural changes.
Simulation results are stored as persistent reports.
Reports can contain:
- Executive summary
- Architecture/topology analysis
- Performance analysis
- Reliability analysis
- Scalability analysis
- Cost analysis
- Security analysis
- Failure scenario results
- Optimization recommendations
- AI-generated insights
This allows users to compare simulation results across different versions of a system design.
Resonance can connect to GitHub repositories to analyze existing applications.
The GitHub workflow includes:
- Authenticate with GitHub
- Select a repository
- Import repository information
- Analyze the application architecture
- Identify services and dependencies
- Generate a visual system representation
- Modify the generated architecture
- Run simulations against the design
This allows an existing software system to become the starting point for architecture experimentation.
Teams can collaborate on system designs with role-based access.
Supported roles include:
- Owner
- Admin
- Member
Team members can be invited through email using SMTP.
Team functionality includes:
- Team creation
- Member management
- Email invitations
- Invitation acceptance
- Role-based permissions
- Shared designs
- Shared simulation history
The backend exposes REST APIs for authentication, designs, simulations, chat, teams, and integrations.
| Endpoint | Description |
|---|---|
POST /auth/webhook |
Synchronize Clerk users |
GET /designs |
List designs |
POST /designs |
Create a design |
GET /designs/:id |
Get a design |
PUT /designs/:id |
Update a design |
DELETE /designs/:id |
Delete a design |
POST /simulations |
Queue a simulation |
GET /simulations/:id/stream |
Stream simulation progress through SSE |
POST /api/chat/sessions |
Create a chat session (optionally linked to a design) |
GET /api/chat/sessions |
List chat sessions |
GET /api/chat/sessions/:id |
Get a chat session with its messages |
DELETE /api/chat/sessions/:id |
Delete a chat session and its messages |
POST /api/chat/sessions/:id/messages |
Send a message and stream the AI response (SSE) |
POST /api/chat/generate-design |
Generate a design from a prompt |
GET /team |
Get team information |
POST /team |
Create a team |
POST /team/:id/invite |
Send a team invitation |
POST /team/invite/accept |
Accept a team invitation |
GET /github/status |
Get GitHub connection status |
GET /github/repos |
List GitHub repositories |
| Page | Route | Description |
|---|---|---|
| Home | / |
Landing hero, AI chat workspace, recent designs |
| Login | /login |
Clerk authentication |
| Dashboard | /dashboard |
Designs, statistics, and project management |
| Canvas Editor | /design/:id |
Visual architecture editor and simulation |
| Design Detail | /designs/:id |
Read-only design view with "Chat about this" |
| Team | /team |
Team and member management |
| Invite Accept | /team/invite?token=... |
Accept team invitations |
| Settings | /settings |
Account and application settings |
| Reports | /reports |
Simulation report history |
The Canvas Editor is the core interface of Resonance.
Users can:
- Drag architecture blocks onto the canvas
- Connect services using React Flow
- Configure individual components
- Define traffic and resource parameters
- Modify system topology
- Run simulations
- Monitor live simulation metrics
- Inspect simulation results
- Generate optimization recommendations
- Export architecture configurations
Designs generated through AI chat open in the Canvas Editor when you click "Open in Canvas Editor" from a generation card. The Canvas Editor is a focused workspace and does not include the chat sidebar — resume your conversation anytime from the Home page sidebar.
The simulator supports common distributed-system components including:
- Client
- API Gateway
- Service
- Database
- Cache
- Message Queue
- Load Balancer
- CDN
- External API
- Storage
Additional block types can be introduced as the simulator evolves.
Docker Compose is provided for local infrastructure services.
Start the development infrastructure:
docker-compose up -dThis starts:
- PostgreSQL on port
5432 - Redis on port
6379
Production Docker configurations are also provided for deployment of the application services.
Build the project:
npm run buildBuild the backend:
cd apps/api
npm run buildBuild the frontend:
cd apps/web
npm run buildFor production deployments, ensure that all required environment variables, database migrations, Redis connectivity, authentication configuration, SMTP credentials, and AI API credentials are configured.
Resonance aims to make system design visual, measurable, and interactive.
Instead of designing an architecture and relying only on intuition, engineers can model a system, simulate realistic workloads and failures, analyze the results, and iterate on the architecture before deploying it.
Prompt it. Design it. Simulate it. Understand it. Optimize it.
MIT