Skip to content

Commit 9f33180

Browse files
anatoly314claude
andcommitted
Bump version to 1.1.3
- Enhanced CLAUDE.md with additional documentation - Added CLI arguments, reconnection behavior, and CI/CD details - Documented ENUM/Type operations and missing commands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 62dee54 commit 9f33180

File tree

3 files changed

+65
-14
lines changed

3 files changed

+65
-14
lines changed

CLAUDE.md

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ pnpm build --filter=backend # Build backend only
4242
pnpm lint # Run linters for all apps
4343
pnpm format # Format all code with Prettier
4444
pnpm clean # Clean all build artifacts and node_modules
45+
pnpm backend:inspector # Launch MCP Inspector for testing tools (STDIO mode)
4546
```
4647

4748
### Docker
@@ -128,6 +129,8 @@ This is a **pnpm workspaces + Turborepo** monorepo (converted from standalone ap
128129
- Enabled when `VITE_REMOTE_CONTROL_ENABLED=true` (automatically set in Docker builds)
129130
- WebSocket auto-detects URL from browser (supports both direct access and nginx proxy)
130131
- Commands are handled by contexts, responses sent back to backend
132+
- Automatic reconnection with exponential backoff (max 10 attempts, up to 30s delay)
133+
- Connection status displayed via Toast notifications
131134

132135
### Backend (apps/backend)
133136

@@ -220,11 +223,13 @@ Example: `apps/backend/src/mcp/primitives/essential/tools/add-table.tool.ts`
220223
- `addRelationship()`, `updateRelationship()`, `deleteRelationship()` - Relationship operations
221224
- `addArea()`, `updateArea()`, `deleteArea()` - Area (grouping) operations
222225
- `addNote()`, `updateNote()`, `deleteNote()` - Note operations
223-
- `getTables()`, `getTable()`, `getRelationships()` - Query operations
226+
- `addEnum()`, `updateEnum()`, `deleteEnum()` - PostgreSQL ENUM type operations
227+
- `addType()`, `updateType()`, `deleteType()` - PostgreSQL composite type operations
228+
- `getTables()`, `getTable()`, `getRelationships()`, `getAreas()`, `getNotes()`, `getEnums()`, `getTypes()` - Query operations
224229
- `setDatabase()` - Set database type (MySQL, PostgreSQL, SQLite, etc.)
225230
- `importDiagram()` - Import complete diagram JSON
226231

227-
See `apps/backend/src/drawdb/drawdb-client.service.ts` for full command list.
232+
See `apps/backend/src/drawdb/drawdb-client.service.ts` and `apps/gui/src/hooks/useRemoteControl.js` for full command list.
228233

229234
### Frontend Data Model
230235

@@ -253,6 +258,15 @@ See `apps/backend/src/drawdb/drawdb-client.service.ts` for full command list.
253258

254259
- `id`, `title`, `content` (Lexical editor state), `x`, `y`, `width`, `height`
255260

261+
**Enums (PostgreSQL):**
262+
263+
- `id`, `name`, `values[]` - Array of allowed enum values
264+
265+
**Types (PostgreSQL):**
266+
267+
- `id`, `name`, `fields[]` - Array of field objects with `name` and `type`
268+
- `comment` - Optional description
269+
256270
### Environment Variables
257271

258272
**GUI:**
@@ -263,10 +277,19 @@ See `apps/backend/src/drawdb/drawdb-client.service.ts` for full command list.
263277

264278
- `PORT` - HTTP server port (default: 3000)
265279
- `HOST` - HTTP server host (default: 127.0.0.1)
266-
- `MCP_SERVER_NAME` - MCP server name (default: drawdb-mcp-server)
267-
- `MCP_SERVER_VERSION` - MCP server version (default: 0.1.0)
280+
- `MCP_SERVER_NAME` - MCP server name (default: drawdb-mcp-server-dev)
281+
- `MCP_SERVER_VERSION` - MCP server version (default: from package.json)
268282
- `LOG_LEVEL` - Logger level (default: info)
269283

284+
**CLI Arguments** (HTTP mode only):
285+
286+
```bash
287+
node dist/main-http.js --port 3000 --host 127.0.0.1
288+
```
289+
290+
- `--port <number>` - Override PORT environment variable
291+
- `--host <string>` - Override HOST environment variable
292+
270293
## Development Tips
271294

272295
### Adding a New MCP Tool
@@ -312,10 +335,37 @@ function MyComponent() {
312335
### Common Gotchas
313336

314337
- **WebSocket connection fails**: Check that `VITE_REMOTE_CONTROL_ENABLED=true` and backend is running
315-
- **MCP tools timeout**: Default timeout is 30s (configured in `DrawDBClientService`)
338+
- **MCP tools timeout**: Default timeout is 30s (configured in `DrawDBClientService:16`)
316339
- **Docker nginx issues**: Nginx runs as non-root user `nodejs:nodejs`, requires proper permissions
317340
- **Build failures**: Run `pnpm clean` then `pnpm install` to reset
318341
- **Turborepo cache issues**: Delete `.turbo` directory to clear cache
342+
- **Area/Note deletion**: Areas and notes use numeric array indices internally but are looked up by `name`/`title` for MCP operations
343+
- **Field IDs**: All entities (tables, fields, relationships) use `nanoid()` for ID generation
344+
345+
## CI/CD and Deployment
346+
347+
### GitHub Actions
348+
349+
**Docker Image Publishing** (`.github/workflows/docker-publish.yml`):
350+
351+
- Triggers on version tags (`v*`)
352+
- Builds multi-platform images (linux/amd64, linux/arm64)
353+
- Publishes to GitHub Container Registry (ghcr.io)
354+
- Creates tags: `latest`, `vX.Y.Z`, `vX.Y`, `vX`
355+
356+
**Release Process:**
357+
358+
1. Update version in `apps/backend/package.json`
359+
2. Commit changes
360+
3. Create git tag: `git tag -a v1.1.2 -m "Release message"`
361+
4. Push tag: `git push origin v1.1.2`
362+
5. GitHub Actions automatically builds and publishes Docker image
363+
364+
### Version Management
365+
366+
- Backend version: `apps/backend/package.json` (currently 1.1.2)
367+
- GUI version: `apps/gui/package.json` (currently 1.0.0)
368+
- Root package: `package.json` (workspace root)
319369

320370
## Git Workflow
321371

@@ -324,3 +374,4 @@ function MyComponent() {
324374
- `768d638` - Converted to Turborepo monorepo with MCP server
325375
- `cef2d67` - Added GHCR support and CI/CD
326376
- `db9950e` - Restructured README to Docker-first approach
377+
- `62dee54` - Version 1.1.2 (current)

apps/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backend",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "Model Context Protocol server for DrawDB - enables AI assistants to create and modify database diagrams via WebSocket",
55
"author": "Anatoly Tarnavsky",
66
"private": true,

apps/gui/src/hooks/useRemoteControl.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ export function useRemoteControl(enabled = false) {
223223
break;
224224

225225
case "deleteArea":
226-
// Areas use numeric array indices, so find by name
227-
const areaToDelete = areas.areas.find((a) => a.name === params.id || a.id === params.id);
226+
// Areas use numeric array indices, so find by name or numeric ID
227+
const areaToDelete = areas.areas.find((a) => a.name === params.id || a.id === parseInt(params.id, 10));
228228
if (areaToDelete) {
229229
areas.deleteArea(areaToDelete.id, params.addToHistory ?? true);
230230
result = { success: true, message: "Area deleted" };
@@ -234,8 +234,8 @@ export function useRemoteControl(enabled = false) {
234234
break;
235235

236236
case "updateArea":
237-
// Areas use numeric array indices, so find by name
238-
const areaToUpdate = areas.areas.find((a) => a.name === params.id || a.id === params.id);
237+
// Areas use numeric array indices, so find by name or numeric ID
238+
const areaToUpdate = areas.areas.find((a) => a.name === params.id || a.id === parseInt(params.id, 10));
239239
if (areaToUpdate) {
240240
areas.updateArea(areaToUpdate.id, params.updates);
241241
result = { success: true, message: "Area updated" };
@@ -251,8 +251,8 @@ export function useRemoteControl(enabled = false) {
251251
break;
252252

253253
case "deleteNote":
254-
// Notes use numeric array indices, so find by title
255-
const noteToDelete = notes.notes.find((n) => n.title === params.id || n.id === params.id);
254+
// Notes use numeric array indices, so find by title or numeric ID
255+
const noteToDelete = notes.notes.find((n) => n.title === params.id || n.id === parseInt(params.id, 10));
256256
if (noteToDelete) {
257257
notes.deleteNote(noteToDelete.id, params.addToHistory ?? true);
258258
result = { success: true, message: "Note deleted" };
@@ -262,8 +262,8 @@ export function useRemoteControl(enabled = false) {
262262
break;
263263

264264
case "updateNote":
265-
// Notes use numeric array indices, so find by title
266-
const noteToUpdate = notes.notes.find((n) => n.title === params.id || n.id === params.id);
265+
// Notes use numeric array indices, so find by title or numeric ID
266+
const noteToUpdate = notes.notes.find((n) => n.title === params.id || n.id === parseInt(params.id, 10));
267267
if (noteToUpdate) {
268268
notes.updateNote(noteToUpdate.id, params.updates);
269269
result = { success: true, message: "Note updated" };

0 commit comments

Comments
 (0)