File size: 5,458 Bytes
c2c8c8d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
---
title: GLMPilot
emoji: 🚀
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
license: mit
---

# GLMPilot

GLMPilot is an AI-native, browser-based IDE built around GLM. It combines code editing, AI chat, code completion, multi-agent review, terminal execution, and GitHub workflows in a single application.

## Executive Summary

| Item | Details |
| --- | --- |
| Product Type | Browser-based AI IDE |
| Primary Use Case | Build, review, and ship code faster from one workspace |
| AI Backbone | GLM API (chat, completion, analysis, orchestration) |
| Deployment Model | Monorepo with Docker and Docker Compose support |
| Key Integrations | GitHub, Redis, WebSocket streaming |

## Key Capabilities

| Capability | Description | Business Value |
| --- | --- | --- |
| AI Chat and Streaming | Real-time GLM assistant integrated in the IDE | Faster iteration and lower context switching |
| Code Completion | Context-aware inline suggestions | Higher coding velocity |
| Multi-Agent Review | Security, performance, style, and documentation agents | Better code quality before PR |
| Monaco-Based Editor | Multi-file editing with VS Code-grade engine | Familiar professional developer experience |
| Integrated Terminal | Browser terminal over WebSocket | In-app execution and validation |
| Live Preview | Real-time HTML/CSS/JS preview | Rapid UI feedback loop |
| GitHub Workflow | Repository import and patch/PR flow | Shorter path from idea to merge |

## Architecture Overview

```text
Client (React + Monaco + Zustand)
  -> REST API (Express routes)
  -> WebSocket channel (chat tokens, terminal, execution events)

Server (Express + Agent Orchestrator)
  -> GLM service client
  -> GitHub service
  -> Redis (cache/pub-sub/coordination)
```

Detailed architecture: [ARCHITECTURE.md](ARCHITECTURE.md)

## Repository Structure

| Path | Purpose |
| --- | --- |
| packages/client | React application, IDE shell, editor and UI components |
| packages/server | Express API, WebSocket handlers, AI services, agent orchestration |
| packages/shared | Shared types, constants, and cross-package utilities |
| Dockerfile | Production image build configuration |
| docker-compose.yml | Local multi-service orchestration |

## Technology Stack

| Layer | Technologies |
| --- | --- |
| Frontend | React 18, TypeScript, Vite, Tailwind CSS, Monaco, Zustand |
| Backend | Node.js, Express, Socket.io |
| AI | GLM API with streaming and retry support |
| Infrastructure | Docker, Docker Compose, Redis |
| Repository | npm workspaces monorepo |

## Local Development

### Prerequisites

| Requirement | Minimum Version |
| --- | --- |
| Node.js | 18+ |
| npm | 9+ |
| Docker | Recommended |

### Setup

```bash
git clone https://github.com/your-username/GLMPilot.git
cd GLMPilot
npm install
cp .env.example .env
```

### Environment Variables

| Variable | Required | Purpose |
| --- | --- | --- |
| NODE_ENV | No | Runtime mode (development/production) |
| PORT | No | Server port |
| CLIENT_URL | No | Allowed client origin |
| GLM_API_KEY | Yes | GLM authentication key |
| GLM_BASE_URL | No | GLM API base URL |
| GLM_MODEL | No | Default GLM model |
| GITHUB_TOKEN | Optional | GitHub integration and PR automation |
| REDIS_URL | No | Redis connection string |
| LOG_LEVEL | No | Server logging verbosity |

Start Redis and run development servers:

```bash
docker run -d --name glmpilot-redis -p 6379:6379 redis
npm run dev:all
```

| Service | URL |
| --- | --- |
| Client | http://localhost:5173 |
| Server | http://localhost:3001 |

## Scripts

| Command | Description |
| --- | --- |
| npm run dev | Start client development server |
| npm run dev:server | Start server development process |
| npm run dev:all | Run client and server concurrently |
| npm run build | Build shared, server, and client packages |
| npm run typecheck | Run TypeScript project-reference checks |

## Deployment

| Option | Command |
| --- | --- |
| Docker Compose | docker-compose up --build |
| Single Image | docker build -t glmpilot-ide . |
| Single Image Run | docker run --env-file .env -p 7860:7860 glmpilot-ide |

In containerized mode, the backend serves static frontend assets and API/WebSocket traffic from a single port.

## API and Realtime Surface

| Surface | Capability |
| --- | --- |
| REST | Chat, completion, review, docs and integration endpoints |
| SSE | Token streaming for chat responses |
| WebSocket | Terminal IO, execution events, chat token streaming |

Package-level docs:

- [packages/server/README.md](packages/server/README.md)
- [packages/client/README.md](packages/client/README.md)
- [packages/shared/README.md](packages/shared/README.md)

## Hackathon Readiness

| Requirement Area | Current Status |
| --- | --- |
| GLM Integration Depth | Implemented across chat, completion, and multi-agent analysis |
| Codebase Documentation | Root and package-level documentation available |
| Setup Reproducibility | .env template and Docker-based startup provided |
| Demonstration Path | Import -> Generate -> Review -> Validate -> PR workflow supported |

## Recommended Demo Flow

1. Import a GitHub repository.
2. Use GLM chat to generate or refactor feature code.
3. Run multi-agent review and inspect findings.
4. Apply fixes and verify using preview/terminal.
5. Create a PR with summarized changes.

## Contributing

1. Fork the repository.
2. Create a feature branch.
3. Commit changes.
4. Push branch.
5. Open a pull request.