How icyss999/algorithm-visualizer works
Icyrhythm turns a plain-language algorithm request into stored, stepwise visualization data, then presents it through visual, code, and explanation views. The main flow is grounded in the home client and agent API excerpts; the README documents the broader visualization and learning capabilities. Authenticated history and detail routes are represented from the indexed references. Some UI and route internals were not sampled, so those connections are omitted where the evidence does not establish a call.
Main entry points: route.ts Agent API · AppSidebar.tsx History and navigation · index.ts Postgres database · page.tsx Code and explanation routes
Components 24
Request and generation
- Algorithm search
src/components/web-component/HomeClient.tsx - Agent API
src/app/api/agent/route.ts - Prompt builder
src/agent/prompt.ts - DeepSeek API
- Rate limiting
src/lib/ratelimit.ts
Learning experience
- Home route
src/app/(users)/home/page.tsx - Visualization route
src/app/(users)/algorithm/[id]/page.tsx - Code and explanation routes
src/app/(users)/algorithm/[id]/[section]/page.tsx - Step visualizer
src/components/web-component/Visualizer.tsx - Visualization templates
src/components/templates - Tree template
src/components/templates/TreeTemplate.tsx - Code panel
src/components/web-component/CodePage.tsx - Explanation panel
src/components/web-component/Explaination.tsx - History and navigation
src/components/web-component/AppSidebar.tsx
Identity and persistence
- Sign-in and sign-up
src/app/(auth)/signin/page.tsx - Auth client
src/lib/authClient.ts - Auth service
src/lib/auth.ts - Auth API route
src/app/api/auth/[...all]/route.ts - Algorithm detail API
src/app/api/agent/[id]/route.ts - Postgres database
src/db/index.ts - Tables and relations
src/db/schema.ts
Shared contracts
- Algorithm and form types
src/types/schema.ts - Agent validator
src/agent/validator.ts
Other components
- Learner
Connections 23
- Learner → Algorithm search: enters request
src/components/web-component/HomeClient.tsx - Algorithm search → Agent API: submits query
src/components/web-component/HomeClient.tsx - Agent API → Rate limiting: checks limit
src/app/api/agent/route.ts - Agent API → Postgres database: looks up and saves
src/app/api/agent/route.ts - Agent API → Prompt builder: builds prompt
src/app/api/agent/route.ts - Agent API → DeepSeek API: requests generation
src/app/api/agent/route.ts - Home route → History and navigation: renders
src/app/(users)/home/page.tsx - Home route → Algorithm search: renders
src/app/(users)/home/page.tsx - Visualization route → History and navigation: renders
src/app/(users)/algorithm/[id]/page.tsx - Visualization route → Step visualizer: renders
src/app/(users)/algorithm/[id]/page.tsx - Code and explanation routes → History and navigation: renders
src/app/(users)/algorithm/[id]/[section]/page.tsx - Code and explanation routes → Code panel: renders
src/app/(users)/algorithm/[id]/[section]/page.tsx - Code and explanation routes → Explanation panel: renders
src/app/(users)/algorithm/[id]/[section]/page.tsx - Step visualizer → Visualization templates: selects template
src/components/web-component/Visualizer.tsx - Step visualizer → Tree template: renders tree
src/components/web-component/Visualizer.tsx - Sign-in and sign-up → Auth client: uses client
src/app/(auth)/signin/page.tsx - History and navigation → Auth client: signs out
src/components/web-component/AppSidebar.tsx - Auth API route → Auth service: dispatches auth
src/app/api/auth/[...all]/route.ts - Auth service → Postgres database: uses adapter
src/lib/auth.ts - Algorithm detail API → Postgres database: reads algorithm
src/app/api/agent/[id]/route.ts - Postgres database → Tables and relations: loads schema
src/db/index.ts - Tables and relations → Algorithm and form types: types steps
src/db/schema.ts - Agent validator → Algorithm and form types: validates against
src/agent/validator.ts