How zeuidon/blocktrance works
Project type and purpose
• Block Trance is a full-stack, single-page web application for tracking Ethereum wallet activity.
• The README describes real-time wallet tracking, transaction history, market-style analytics, filtering, infinite scroll, error handling, dark-themed UI.
File structure
• Top-level:
• client/ – React + Vite front end
• server/ – Node.js + Express back end
• assets/ – static images (banners, previews)
• README.md, package.json at root
• client/ breakdown:
• index.html, Vite & Tailwind config
• src/ – App.jsx, pages (Home), components (Dashboard, Navbar, TokenChart, TransactionList), theme.js, main.jsx, index.css
• server/ breakdown:
• index.js – Express app entry
• routes/transactions.js – REST endpoints
• .env – Etherscan API key
• No database directory—server fetches directly from Etherscan API (no persistent storage).
README for additional insights
• Tech stack: React.js, TailwindCSS, Recharts, Zustand for state on front end; Node.js, Express on back end; Ethereum API via Etherscan + ethers.js.
• Features: real-time fetch, analytics charts, filtering, infinite scroll, error handling with ethers.js validation.
a. Client (SPA)
– React app (pages & components)
– State management (Zustand)
– Charting (Recharts)
– Validation library (ethers.js)
b. API Server
– Express.js application (server/index.js)
– Routes module (routes/transactions.js)
– Env config (.env with Etherscan key)
c. External Service
– Etherscan REST API (blockchain data provider)
d. (Optional future component) Smart Contract or database for logging custom transactions
Relationships and interactions
• Client ↔ Server: HTTP/HTTPS calls (e.g., GET /transactions?address=…)
• Server ↔ Etherscan API: HTTP calls using API key from .env
• Client ↔ ethers.js: in-browser Ethereum address validation
• Client renders charts using data returned from Server
Architectural patterns and design principles
• Clear separation of concerns: UI vs. business/API layer
• Modular component hierarchy in React (reusable components)
• Stateless back end (no DB)—pure proxy to external API
• Single page application routing (Home, Dashboard views)
• Theming via TailwindCSS + custom palette
1. Sketch three tiers horizontally: Browser (left), Server (middle), External API (right).
2. In Browser tier, group React components, state manager, chart library, validation library.
3. In Server tier, show Express app, route handler module, env config.
• From React’s data-fetching layer to Server’s /transactions endpoint.
• From Server to Etherscan (annotate “API key from .env”).
5. Important flows: filtering & pagination, error handling paths.
7. Labels are clear and all components from the file tree (client/src, server/routes) are represented.