mindmap.build - Agent Instructions
This document contains instructions for AI agents working on the mindmap.build codebase.
Project Overview
mindmap.build is a visual mind mapping platform (SaaS) combining infinite canvas collaboration with AI-powered ideation. It is a monorepo containing a React frontend and a Go Echo backend, managed by Turborepo.
Technology Stack
- Frontend (
apps/web-client): React 19, TypeScript, Vite, Tailwind CSS, shadcn/ui. - Backend (
apps/server-go): Go 1.25, Echo v4, SQLC, PostgreSQL. - Tools: ESLint, Prettier, Go Vet, Go Fmt, Playwright (E2E testing), Vitest.
Repository Structure
apps/web-client: Frontend application.apps/server-go: Backend application.package.json: Root scripts and workspace configuration.turbo.json: Turborepo pipeline configuration.README.md: Detailed project documentation.WORKSPACE.md: Developer command reference.DEPLOYMENT.md: Railway deployment architecture and configuration.
Development Workflow
Build & Run
- Start All:
npm run dev(Runs Frontend on 5173, Backend on 8001) - Frontend Only:
turbo dev --filter=web-client - Backend Only:
turbo dev --filter=server-go - Build Web:
npm run build
Verification & Testing
Always run these checks before submitting changes:
- Check All:
npm run check(Runs typecheck, lint, and tests for everything) - Lint:
npm run lint(Checks both JS/TS and Go) - Format:
npm run format(Checks formatting) - Tests:
- All:
npm run test - Frontend:
turbo test --filter=web-client - Backend:
turbo test --filter=server-go
- All:
Coding Standards
Frontend (React/TypeScript)
- Components: Use functional components with hooks.
- Styling: Use Tailwind CSS utility classes. Avoid inline styles unless dynamic.
- State Management: Use React local state for simple UI logic. The Mindmap Studio uses a complex state model described in
README.md. - UI Components: Use
shadcn/uicomponents located inapps/web-client/src/components/ui. - Imports & Encapsulation:
- Barrel Files: The project uses
index.tsfiles to define public APIs for modules (src/modules/*) and shared libraries (src/shared/*). - Rule: Always import from the barrel file (e.g.,
import { Button } from '@/shared/ui'), NOT the internal file path. - Exports: When creating new components or services, ensure they are exported from the corresponding
index.tsif they need to be accessed externally.
- Barrel Files: The project uses
Backend (Go)
- Static Typing: Explicitly type all function parameters and return values.
- Style: Follow standard Go formatting conventions (enforced by
go fmtandgo vet). - Error Handling: Explicitly check all errors (
if err != nil) and wrap them with context (fmt.Errorf). - Framework: Use Echo v4 context (
echo.Context) for all HTTP API route handlers.
Critical Files
apps/web-client/src/modules/studio/components/Studio.tsx: The core mind map canvas implementation. Handle with care. Complex logic for drag/drop, panning, zooming, reparenting, and node rendering resides here.apps/web-client/src/shared/lib/utils.ts: Common utility functions.apps/server-go/cmd/server/main.go: Backend entry point.
Agent Behavior Guidelines
- Explore First: Read
README.mdandWORKSPACE.mdto understand the context. - Verify Changes: distinct from "Testing", always verify that your changes (file creations, edits) were applied correctly using
read_fileorls. - Run Tests: Run relevant tests after making changes. Use
npm run checkto verify everything. - Fix Lint/Type Errors: Ensure
npm run checkpasses. - Do Not Break Existing Features: Regression testing is key.
- Dependency Management:
- Web: Use
npm installinapps/web-clientor root. - Server: Use
go get <package>inapps/server-go.
- Web: Use
- Documentation: Update
README.mdif you add significant new features or change architecture.