mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
Add project documentation for AI assistants with: - Architecture overview and directory structure - Essential development commands - Key technologies (Next.js, Chakra UI, wagmi) - Chain configuration (Lux/Zoo mainnet/testnet) - Development workflow and upstream sync process - Lux-specific branding locations
5.3 KiB
5.3 KiB
Lux Network Explorer - AI Knowledge Base
Last Updated: 2024-12-24
Project: explore
Organization: luxfi
Upstream: blockscout/frontend
Project Overview
Lux Network Explorer is a fork of Blockscout Frontend, customized for the Lux blockchain ecosystem. It provides a web-based interface for exploring blocks, transactions, addresses, tokens, and smart contracts on Lux Network chains (C-Chain, Zoo chains).
Essential Commands
# Development
yarn dev # Start dev server (runs tools/scripts/dev.sh)
yarn dev:preset # Start with preset configuration
yarn build # Production build
yarn build:docker # Build Docker image
yarn start # Start production server
# Linting & Testing
yarn lint:eslint # Run ESLint
yarn lint:tsc # TypeScript check
yarn test:pw # Playwright tests
yarn test:pw:local # Playwright tests locally
# Docker
docker compose up # Dev environment
docker compose -f compose.prod.yml up # Production
Architecture
explore/
├── pages/ # Next.js pages (file-based routing)
├── ui/ # UI components by feature
│ ├── address/ # Address page components
│ ├── block/ # Block page components
│ ├── tx/ # Transaction page components
│ ├── token/ # Token page components
│ ├── shared/ # Shared components
│ └── snippets/ # Header, footer, navigation
├── lib/ # Core business logic
│ ├── api/ # API client & services
│ ├── hooks/ # React hooks
│ ├── contexts/ # React contexts
│ └── web3/ # Web3 integration
├── toolkit/ # UI toolkit (Chakra-based)
│ ├── components/ # Reusable components
│ ├── theme/ # Theme configuration
│ └── chakra/ # Chakra UI customization
├── configs/ # Configuration files
│ ├── app/ # App features config
│ └── envs/ # Environment presets
├── deploy/ # Deployment tools
│ ├── scripts/ # Build scripts
│ └── tools/ # Deployment utilities
├── mocks/ # Mock data for testing
├── stubs/ # API type stubs
├── types/ # TypeScript types
└── nextjs/ # Next.js configuration
Key Technologies
| Category | Technology |
|---|---|
| Framework | Next.js 14 (Pages Router) |
| Language | TypeScript |
| UI Library | Chakra UI v3 |
| State | React Query (TanStack) |
| Web3 | wagmi, viem, RainbowKit |
| Testing | Playwright, Vitest |
| Styling | Emotion CSS-in-JS |
| Build | Turbopack |
Configuration
Environment Variables
Key environment variables (see docs/ENVS.md for full list):
NEXT_PUBLIC_NETWORK_NAME=Lux Network
NEXT_PUBLIC_NETWORK_ID=96369
NEXT_PUBLIC_NETWORK_RPC_URL=https://api.lux.network/ext/bc/C/rpc
NEXT_PUBLIC_API_HOST=https://explore.lux.network
NEXT_PUBLIC_APP_HOST=https://explore.lux.network
Lux Branding
Lux-specific branding is configured in:
configs/app/ui/- UI customizationpublic/logos/- Logo assetstoolkit/theme/- Theme colors
Development Workflow
Syncing with Upstream
# Fetch upstream changes
git fetch upstream
# Merge upstream into main
git merge upstream/main
# Resolve conflicts, preserving Lux branding
git add . && git commit
Adding New Features
- Check if feature exists in upstream Blockscout
- If not, implement in
ui/orlib/directories - Add TypeScript types in
types/ - Add mock data in
mocks/for testing - Test with Playwright
Lux-Specific Changes
Key Lux customizations:
ui/snippets/networkLogo/- Lux logo componenttoolkit/theme/foundations/- Lux color palettepublic/logos/- Lux brand assetsDockerfile.lux- Lux-specific Docker build
Chain Configuration
| Chain | Chain ID | Explorer URL |
|---|---|---|
| Lux Mainnet (C-Chain) | 96369 | explore.lux.network |
| Lux Testnet | 96368 | testnet.explore.lux.network |
| Zoo Mainnet | 200200 | zoo.explore.lux.network |
| Zoo Testnet | 200201 | zoo-testnet.explore.lux.network |
API Integration
The explorer connects to:
- Blockscout API: Block/tx/address data
- Stats API: Chain statistics
- RPC Node: Direct chain queries
API services are in lib/api/services/.
Context for AI Assistants
This file (LLM.md) is symlinked as:
AGENTS.mdCLAUDE.mdQWEN.mdGEMINI.md
All symlinks reference this single source of truth.
Rules for AI Assistants
- ALWAYS update LLM.md with significant discoveries
- PRESERVE Lux branding when merging upstream changes
- DO NOT modify Blockscout-specific CI workflows
- USE
yarnfor package management (not npm/pnpm) - TEST UI changes with Playwright before committing
Recent Changes
2024-12-24
- Merged upstream blockscout/frontend (up to commit 5a49ad8b1)
- Updated branding from Blockscout to Lux Network
- Added logo assets
Note: This file is tracked in git. Update it when making significant architectural changes or discoveries about the codebase.