How harshcodespaces/maptocode works
MapToCode is a browser-based algorithm-learning workspace: users edit an algorithm specification or flowchart, reconcile and validate project representations, generate code, and inspect a step-by-step trace. The workspace also supports project management, examples, file-oriented editing, and a FastAPI execution boundary. The graph reflects excerpted calls and README-described capabilities; some UI panels and execution details were not sampled, so uncertain internal links are omitted.
Main entry points: WorkspaceClient.tsx Workspace controller · IdeWorkspace.tsx IDE workspace · generation-gate.js Generation gate · trace-engine.js Trace engine
Components 25
App and workspace
- Homepage
app/page.tsx - Workspace route
app/workspace/page.tsx - Workspace controller
components/workspace/WorkspaceClient.tsx - IDE workspace
components/workspace/IdeWorkspace.tsx
Algorithm modeling
- Project store
core/project-service.js - Workspace files
core/workspace-files.js - Project examples
core/examples.js - Project and AST models
types/contracts.ts - Pseudocode parser
core/pseudocode-parser.js - Flowchart editor
components/canvas/FlowCanvas.tsx - Flowchart and AST adapter
core/adapters.js
Validation and generation
- Representation reconciliation
core/reconciliation.js - Specification sync
core/reconciliation-sync.js - AST validation
core/ast-validation.js - Generation gate
core/generation-gate.js - C generator
core/c-generator.js - Python generator
core/python-generator.js - Java generator
core/java-generator.js
Learning and execution
- Trace engine
core/trace-engine.js - Logic tracer
components/tracer/LogicTracer.tsx - Flowchart explanation
core/flowchart-explanation.js - FastAPI client
api/client.ts - Execution endpoint
app/api/execute/route.ts
Other components
- Learner
- FastAPI service
Connections 27
- Learner → Homepage: opens
app/page.tsx - Learner → Workspace route: enters
app/workspace/page.tsx - Workspace route → IDE workspace: renders
app/workspace/page.tsx - Workspace controller → Project examples: loads example
components/workspace/WorkspaceClient.tsx - Workspace controller → Specification sync: syncs specification
components/workspace/WorkspaceClient.tsx - IDE workspace → Workspace files: loads and saves
components/workspace/IdeWorkspace.tsx - IDE workspace → Pseudocode parser: parses pseudocode
components/workspace/IdeWorkspace.tsx - IDE workspace → Flowchart and AST adapter: adapts flowchart
components/workspace/IdeWorkspace.tsx - IDE workspace → Flowchart explanation: explains flowchart
components/workspace/IdeWorkspace.tsx - Workspace controller → Project store: manages projects
components/workspace/WorkspaceClient.tsx - Workspace controller → Flowchart and AST adapter: adapts representations
components/workspace/WorkspaceClient.tsx - Workspace controller → Representation reconciliation: checks consistency
components/workspace/WorkspaceClient.tsx - Workspace controller → Generation gate: checks generation
components/workspace/WorkspaceClient.tsx - Generation gate → AST validation: validates AST
core/generation-gate.js - Generation gate → C generator: generates C
core/generation-gate.js - Generation gate → Python generator: generates Python
core/generation-gate.js - Workspace controller → Java generator: generates Java
- Workspace controller → Logic tracer: shows trace
components/workspace/WorkspaceClient.tsx - Logic tracer → Trace engine: runs trace
components/tracer/LogicTracer.tsx - Trace engine → AST validation: validates AST
core/trace-engine.js - Trace engine → C generator: maps source lines
core/trace-engine.js - Trace engine → Python generator: maps source lines
core/trace-engine.js - Logic tracer → C generator: previews C
components/tracer/LogicTracer.tsx - Logic tracer → Python generator: previews Python
components/tracer/LogicTracer.tsx - Learner → FastAPI client: requests execution
- FastAPI client → FastAPI service: sends API requests
api/client.ts - Execution endpoint → FastAPI service: forwards execution