How minimalistorg/minimalistidev2 works
Project type and purpose
• This is a single-page full-stack (frontend-only) React application bootstrapped with Create React App.
• It visualizes and explores JavaScript/TypeScript code via Tree-Sitter: parsing code into an AST, rendering it, computing call trees, fuzzy-searching identifiers, etc.
• It may fetch code from external sources (GitHub Gist, repos) via apiService.tsx.
File structure
• Top-level:
• src/ – application source
– components/ – presentational React components grouped by feature
– services/ – business logic: apiService.tsx (fetching code), parser.ts (driving Tree-Sitter)
– hooks/ – custom React hooks for interactivity
– Root-file/Redux – Redux store and slices for global state (bubbles, call tree, JWT)
– util/ – URL params & helper functions
• tests under src/ – unit & integration tests for parsing, API, utilities
• Configuration:
• package.json, tsconfig.json, .env* – dependencies and environment
• playwright.config.ts – e2e test settings
• GitHub Actions workflow under .github/workflows
README for additional insights
• Standard Create React App scripts: start, test, build, eject.
Main components
a. User Interface (Browser)
– React SPA UI (index.html → index.tsx → App.tsx → components)
– Key UI modules:
• Code Loader (MenuHeader/LoadCode)
• Code Viewer (CodeBlock, RenderTreeSitter)
• Call Tree Visualizer (CallTree)
• Search (FuzzySearch)
• Alerts (AlertTemplate)
b. State Management Layer
– Redux store (Root-file/Redux/store.ts)
– Slices: addBubbleSlice, callTreeSlice, jwtSlice
c. Services Layer
– apiService.tsx – handles HTTP requests to external APIs (e.g., GitHub Gist, repo endpoints)
– parser.ts – wraps Tree-Sitter WASM parsing engine
d. Static Assets / External Dependencies
– Tree-Sitter WASM modules (public/assets/TreeSitter)
– GitHub or other external code hosting APIs
e. Build & Deployment
– Webpack/Babel under the hood (Create React App)
– CI pipeline (GitHub Actions .github/workflows/test.yml)
f. Testing
– Unit tests (columnCount, services, util)
– Integration tests under src/test
– E2E tests via Playwright
Relationships & interactions
• Browser → serves index.html → loads JS bundle
• UI Components dispatch actions → Redux store
• UI triggers parser service → Tree-Sitter WASM → produces AST
• AST fed back into UI (RenderTreeSitter) & call-tree generator
• UI invokes apiService to fetch code → results into Redux or direct props
• Redux updates propagate to components
• CI runs tests, lints, builds via GitHub Actions
Architectural patterns & design principles
• Component-based UI (presentational vs container)
• Unidirectional data flow (React → Redux → UI)
• Separation of concerns: parsing logic in services, state in Redux, rendering in components
• Lazy loading of WASM assets via public folder
• Hooks for encapsulating reusable logic