How fabrigu/codetown works
CodeTown surveys a Git repository, turns its modules, imports, and detected issues into a town model, then lets users explore that model in terminal, browser, snapshots, or live agent-watch views. Its distinct domain stages include language-aware source analysis, town layout and road routing, problem detection, and session/watch activity visualization. The graph reflects documented workflows and relationships visible in the supplied excerpts or source index; browser serving and several runtime details are documented but not sampled in source.
Main entry points: towncode.py Command interface · survey.py Survey engine · townmap.py Town map · watch.py Agent watcher
Components 20
Repository analysis
- Command interface
towncode.py - Repository reader
repo.py - Survey engine
survey.py - Language adapters
langs.py - Parser toolkit
langkit.py - Session analysis
session.py
Town modeling
- Repository model
model.py - District layout
plat.py - Town map
townmap.py - Import roads
roads.py - Problem detection
problems.py
Exploration and rendering
- Terminal viewer
viewer.py - Town renderer
drawtown.py - Browser town
webserve.py - 3D web client
web/town3d.js - PNG snapshot
snapshot.py
Live agent watch
- Agent watcher
watch.py - Live town state
livetown.py - Agent movement
crowd.py
Other components
- Engineer
Connections 26
- Engineer → Command interface: runs commands
- Command interface → Survey engine: runs survey
towncode.py - Survey engine → Repository reader: reads files
survey.py - Survey engine → Language adapters: selects languages
survey.py - Language adapters → Parser toolkit: uses parser
- Survey engine → Repository model: builds model
survey.py - Command interface → Session analysis: loads session
towncode.py - Session analysis → Repository reader: validates repository
session.py - Command interface → District layout: lays out town
towncode.py - Command interface → Town map: builds town
towncode.py - Town map → Repository model: maps modules
townmap.py - Command interface → Import roads: routes imports
towncode.py - Import roads → Town map: routes on tiles
roads.py - Command interface → Problem detection: finds issues
towncode.py - Problem detection → Repository model: checks modules
problems.py - Command interface → Terminal viewer: opens viewer
towncode.py - Terminal viewer → Town renderer: draws town
viewer.py - Command interface → PNG snapshot: renders snapshot
towncode.py - Command interface → Browser town: serves browser view
towncode.py - Browser town → 3D web client: serves client
- Command interface → Agent watcher: starts watch
towncode.py - Agent watcher → Live town state: updates town
livetown.py - Live town state → Agent movement: advances agents
livetown.py - Agent movement → Town map: moves through town
crowd.py - Live town state → Town renderer: draws activity
livetown.py - Agent watcher → Session analysis: reads transcripts
watch.py