A React-based web application for viewing and analyzing blockchain data, specifically focused on MEV (Maximal Extractable Value) extraction data. This project visualizes MEV analysis data stored in ClickHouse, including Timeboost protocol performance metrics, revenue, real-time bids, and Express Lane controller profits.
This project uses npm workspaces with three packages:
- shared (
@mevscan/shared): Common TypeScript type definitions - server (
@mevscan/server): Express.js backend server - client (
@mevscan/client): React frontend application
- Install dependencies (from project root):
npm installThis installs dependencies for all workspaces.
- Start the React development server:
npm run devThis starts the client dev server with HMR at http://localhost:5173.
- Start the API server (in a separate terminal):
npm run dev:serverOr use watch mode for auto-reload:
npm run dev:watchThe app will be available at http://localhost:5173 and the API at http://localhost:3001.
-
Set your production API URL (see Environment Variables below)
-
Build all workspaces:
npm run buildOr build individually:
npm run build:client # Build React app
npm run build:server # Build Express server- The built files will be in:
client/dist/- React application (ready for static hosting)server/dist/- Express server (ready to run withnpm start)
For containerized deployment, see DEPLOY.md for detailed instructions.
Quick start with Docker Compose:
docker-compose up --buildServices:
- API:
localhost:3001(health:/health) - Web:
localhost:8080(nginx proxies API requests)
This project uses environment variables to configure the API URL for different environments.
For local development, create a .env.local file:
VITE_API_BASE_URL=http://localhost:3001For production, create a .env.production file:
VITE_API_BASE_URL=https://api.yourdomain.comSee ENV_SETUP.md for detailed instructions on configuring environment variables for different deployment scenarios.
- React 19.1.1 - UI library
- Vite 7.1.7 - Build tool and dev server
- React Router DOM 7.9.5 - Client-side routing
- TanStack Query - Data fetching and caching
- Axios - HTTP client
- Material UI - Component library
- ECharts - Charting library
- Express.js - Web framework
- TypeScript - Type safety
- ClickHouse Client - Database client
- Node.js - Runtime
- Docker & Docker Compose - Containerization
- Nginx - Reverse proxy and static file server
mevscan/
├── client/ # @mevscan/client - React frontend application
│ ├── src/
│ │ ├── components/ # React components (charts, details, navbar)
│ │ ├── pages/ # Page components (Dashboard, Home, Address, Block, Transaction)
│ │ ├── hooks/ # React hooks (useApi)
│ │ ├── services/ # API client service
│ │ └── styles/ # Global styles
│ ├── public/ # Static assets
│ ├── dist/ # Production build output
│ ├── Dockerfile # Client Docker image
│ └── package.json
├── server/ # @mevscan/server - Express.js API server
│ ├── index.ts # Main server file
│ ├── middleware/ # Express middleware (cache)
│ ├── dist/ # Compiled TypeScript output
│ ├── Dockerfile # Server Docker image
│ └── package.json
├── shared/ # @mevscan/shared - Shared TypeScript types
│ ├── types.ts # Type definitions for API communication
│ └── package.json
├── schema/ # ClickHouse database schemas
│ ├── blocks.sql
│ ├── mev_blocks.sql
│ ├── atomic_arbs.sql
│ ├── liquidations.sql
│ └── ... # Other schema files
├── docker-compose.yml # Docker Compose configuration
├── nginx.conf # Nginx configuration for web service
├── package.json # Root workspace configuration
└── README.md
npm run dev- Start React development server (client)npm run dev:server- Start API development servernpm run dev:watch- Start API server with watch mode (auto-reload)npm run build- Build all workspacesnpm run build:client- Build React application onlynpm run build:server- Build Express server onlynpm run lint- Run ESLint across all workspaces
npm run dev- Start Vite dev servernpm run build- Build for productionnpm run preview- Preview production build locallynpm run lint- Run ESLint
npm run dev- Start development server (ts-node)npm run dev:watch- Start with nodemon (auto-reload)npm run build- Compile TypeScriptnpm start- Run production build
- Server (
server/): Express.js API server that queries ClickHouse database and returns JSON responses - Client (
client/): React application that consumes the API and visualizes MEV data - Shared (
shared/): Type definitions/interfaces for frontend-backend communication - Schema (
schema/): ClickHouse database schema definitions
For each visualization:
- Define an interface in
shared/types.ts - Create an endpoint in
server/index.ts - Add a method in
client/src/services/apiClient.ts - Add the visualization to the Dashboard page
- Time Range: SQL queries should default to the last 15 minutes. API endpoints support time range parameters:
5min,15min,30min,1hour - Database Schema: Located under
./schemadirectory - Type Definitions: All API interfaces should be defined in
shared/types.ts