|
| 1 | +# Sarafu Network Visualizer |
| 2 | + |
| 3 | +A Next.js application that visualizes blockchain transaction data from the Sarafu Network using interactive 2D and 3D force-directed graphs. |
| 4 | + |
| 5 | +## AI Team Configuration (autogenerated by team-configurator, 2025-12-05) |
| 6 | + |
| 7 | +**Important: YOU MUST USE subagents when available for the task.** |
| 8 | + |
| 9 | +### Detected Tech Stack |
| 10 | + |
| 11 | +- **Frontend Framework**: Next.js 13.4 (Pages Router) with React 18.2 |
| 12 | +- **UI Styling**: Tailwind CSS 3.3 (JIT mode) with HeadlessUI and Framer Motion |
| 13 | +- **Visualization**: |
| 14 | + - 3D Force Graph 1.71 |
| 15 | + - React Force Graph 2D/3D (1.25/1.23) |
| 16 | + - Three.js 0.153 with three-forcegraph |
| 17 | +- **Database**: PostgreSQL with Kysely 0.25 (type-safe SQL query builder) |
| 18 | + - Multiple databases: Graph DB and Federated DB |
| 19 | + - Type generation via kysely-codegen |
| 20 | +- **Caching**: Upstash Redis 1.35 |
| 21 | +- **Blockchain**: viem 2.41, web3 4.0, multicoin-address-validator |
| 22 | +- **Data Fetching**: SWR 2.2 |
| 23 | +- **Language**: TypeScript 5.4 (strict mode disabled) |
| 24 | +- **Testing**: Jest 29.5 |
| 25 | +- **Build Tools**: ESBuild 0.18, PostCSS, Autoprefixer |
| 26 | +- **Deployment**: Vercel (@vercel/node 2.7) |
| 27 | + |
| 28 | +### Specialist Agents for This Project |
| 29 | + |
| 30 | +Use these specialists based on the task at hand: |
| 31 | + |
| 32 | +| Task | Agent | Notes | |
| 33 | +|------|-------|-------| |
| 34 | +| **Next.js SSR/SSG/API Routes** | `@react-nextjs-expert` | Primary specialist for Next.js features, pages, API routes, data fetching patterns, and optimization. Always check latest Next.js docs before implementing. | |
| 35 | +| **UI Components & Tailwind Styling** | `@tailwind-frontend-expert` | Utility-first styling, responsive design, container queries. Use for all component styling work. | |
| 36 | +| **Frontend Components (General)** | `@frontend-developer` | Alternative for React components when Next.js-specific features not needed. Use for client-side logic and state management. | |
| 37 | +| **API Design & Contracts** | `@api-architect` | Design REST endpoints, define request/response schemas, pagination strategies, error handling patterns. | |
| 38 | +| **Backend/Database Logic** | `@backend-developer` | PostgreSQL queries with Kysely, database migrations, data processing, caching strategies with Redis. | |
| 39 | +| **Code Reviews & Quality** | `@code-reviewer` | MUST USE before merging features or PRs. Provides security, maintainability, and performance reviews. | |
| 40 | +| **Performance Optimization** | `@performance-optimizer` | MUST USE for graph rendering performance, data processing optimization, bundle size reduction, caching strategies. | |
| 41 | +| **Documentation** | `@documentation-specialist` | Update README, API docs, architecture guides. Use after major features or when onboarding. | |
| 42 | +| **Codebase Analysis** | `@code-archaeologist` | Deep exploration of unfamiliar code, legacy analysis, architecture documentation, risk assessment. | |
| 43 | + |
| 44 | +### Project-Specific Guidance |
| 45 | + |
| 46 | +#### Graph Visualization Work |
| 47 | +- **Primary concerns**: Performance with large datasets, rendering optimization, user interactivity |
| 48 | +- **Key files**: |
| 49 | + - `/Users/chui/Dev/grassroots/vis/components/network-graph/` - Graph components |
| 50 | + - `/Users/chui/Dev/grassroots/vis/utils/render_graph.ts` - Graph data generation logic |
| 51 | +- **Recommended agents**: `@performance-optimizer` for rendering performance, `@react-nextjs-expert` for component architecture, `@frontend-developer` for Three.js/D3 integration |
| 52 | + |
| 53 | +#### Database & Data Processing |
| 54 | +- **Stack**: PostgreSQL with Kysely ORM, multiple database connections (graphDB, federatedDB) |
| 55 | +- **Key files**: |
| 56 | + - `/Users/chui/Dev/grassroots/vis/db/db.ts` - Database connections |
| 57 | + - `/Users/chui/Dev/grassroots/vis/db/graph-db.d.ts` - Auto-generated types (regenerate with `npm run generate:graph`) |
| 58 | + - `/Users/chui/Dev/grassroots/vis/db/federated-db.d.ts` - Auto-generated types |
| 59 | +- **Recommended agents**: `@backend-developer` for query optimization and data layer work, `@api-architect` for API contract design |
| 60 | + |
| 61 | +#### API Routes |
| 62 | +- **Pattern**: Next.js API routes in `/Users/chui/Dev/grassroots/vis/pages/api/` |
| 63 | +- **Current routes**: |
| 64 | + - `/api/data` - Main graph data endpoint with caching |
| 65 | +- **Recommended agents**: `@react-nextjs-expert` for Next.js-specific API features, `@api-architect` for endpoint design, `@backend-developer` for data processing |
| 66 | + |
| 67 | +#### Styling & Components |
| 68 | +- **Style system**: Tailwind CSS with JIT mode, HeadlessUI for accessible components |
| 69 | +- **Animation**: Framer Motion for transitions |
| 70 | +- **Key files**: `/Users/chui/Dev/grassroots/vis/tailwind.config.js` |
| 71 | +- **Recommended agents**: `@tailwind-frontend-expert` for all styling work, `@frontend-developer` for component logic |
| 72 | + |
| 73 | +#### Performance Considerations |
| 74 | +- Large dataset visualization (blockchain transactions) |
| 75 | +- Redis caching with 24-hour TTL |
| 76 | +- Graph data processing optimization (using Maps for O(1) lookups) |
| 77 | +- Dynamic imports for heavy visualization libraries |
| 78 | +- **Recommended agent**: `@performance-optimizer` for any performance work |
| 79 | + |
| 80 | +#### Blockchain Integration |
| 81 | +- Multiple blockchain libraries (viem, web3.js) |
| 82 | +- Address validation with multicoin-address-validator |
| 83 | +- Token transfer tracking and voucher system |
| 84 | +- **Recommended agents**: `@backend-developer` for blockchain data processing, `@code-reviewer` for security review of blockchain interactions |
| 85 | + |
| 86 | +### Workflow Recommendations |
| 87 | + |
| 88 | +1. **New Features**: Start with `@react-nextjs-expert` or `@api-architect` depending on frontend vs backend |
| 89 | +2. **Performance Issues**: Always consult `@performance-optimizer` for graph rendering or data processing bottlenecks |
| 90 | +3. **Before Merging**: ALWAYS run `@code-reviewer` for security and quality checks |
| 91 | +4. **Complex Queries**: Use `@backend-developer` for Kysely query optimization |
| 92 | +5. **UI/UX Work**: Use `@tailwind-frontend-expert` for styling, `@frontend-developer` for component logic |
| 93 | +6. **Documentation**: After major changes, use `@documentation-specialist` to update docs |
| 94 | + |
| 95 | +### Example Commands |
| 96 | + |
| 97 | +```bash |
| 98 | +# Next.js feature development |
| 99 | +"@react-nextjs-expert Build a new API route for filtering graph data by date range" |
| 100 | + |
| 101 | +# Performance optimization |
| 102 | +"@performance-optimizer Analyze and optimize the graph rendering performance in network-graph-3d.tsx" |
| 103 | + |
| 104 | +# Styling work |
| 105 | +"@tailwind-frontend-expert Create a responsive header component with dark mode support" |
| 106 | + |
| 107 | +# Code review before PR |
| 108 | +"@code-reviewer Review the changes in pages/api/data.ts and utils/cache.ts for security and performance" |
| 109 | + |
| 110 | +# Database optimization |
| 111 | +"@backend-developer Optimize the transaction query in pages/api/data.ts to reduce load time" |
| 112 | + |
| 113 | +# Architecture analysis |
| 114 | +"@code-archaeologist Analyze the graph data processing pipeline and document the architecture" |
| 115 | +``` |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +**Last Updated**: 2025-12-05 |
| 120 | +**Configured By**: team-configurator agent |
0 commit comments