A comprehensive, production-ready Ethereum blockchain explorer built with Next.js, MongoDB, and Web3.js. This industrial-grade explorer provides real-time blockchain indexing, comprehensive transaction tracking, address analytics, and a modern, professional user interface.
π Live Demo: https://nextjs-ethereum-explorer.vercel.app/
Note: The live demo has sync disabled to manage database costs. For full functionality, run the explorer locally or deploy with your own database.
- Node.js (v18 or higher)
- MongoDB (local or Atlas)
- Ethereum RPC Endpoint (public RPC or your own node)
-
Clone and install:
git clone https://github.com/aakash4dev/nextjs-ethereum-explorer.git cd nextjs-ethereum-explorer npm install -
Configure environment:
cp .example.env .env
Edit
.envwith your settings:ETHEREUM_RPC_URL=https://ethereum-rpc.publicnode.com MONGODB_URI=mongodb://localhost:27017/ethereum_indexer START_BLOCK=23756000 # Recent block for faster sync INDEXER_BATCH_SIZE=10 SYNC_INTERVAL=5000
-
Setup MongoDB:
Ubuntu/Debian:
curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list sudo apt-get update && sudo apt-get install -y mongodb-org sudo systemctl start mongod && sudo systemctl enable mongod
macOS:
brew tap mongodb/brew brew install mongodb-community brew services start mongodb-community
Windows: Download from MongoDB Download Center
Or use MongoDB Atlas: See MongoDB Atlas setup guide
-
Run the application:
Terminal 1 - Frontend:
npm run dev
Terminal 2 - Indexer:
npm run sync
-
Verify it's working:
curl http://localhost:3000/api/indexer curl http://localhost:3000/api/stats
Visit http://localhost:3000 to see the explorer!
- Real-time Blockchain Indexing - Continuous synchronization with configurable start block
- Comprehensive Data Tracking - Blocks, transactions, addresses, and contract interactions
- Advanced Search - Search by block number, transaction hash, or Ethereum address
- Address Analytics - Balance tracking, transaction history, and statistics
- Modern UI - Professional, dark-themed interface with real-time stats
- Production Ready - Robust error handling, batch processing, and database optimization
See ROADMAP.md for detailed features and future plans.
| Variable | Description | Default |
|---|---|---|
START_BLOCK |
Block number to start indexing from | 0 |
INDEXER_BATCH_SIZE |
Blocks processed per sync cycle | 10 |
SYNC_INTERVAL |
Milliseconds between sync cycles | 5000 |
ETHEREUM_RPC_URL |
Ethereum RPC endpoint | Required |
MONGODB_URI |
MongoDB connection string | Required |
- Push code to GitHub
- Import project in Vercel
- Add environment variables in Settings β Environment Variables:
MONGODB_URI(MongoDB Atlas connection string)ETHEREUM_RPC_URLSTART_BLOCKINDEXER_BATCH_SIZESYNC_INTERVAL
- Deploy
Note: Vercel uses environment variables from its dashboard, not from .env file.
Deploy the sync service separately (VPS, AWS EC2, etc.):
pm2 start src/lib/sync-service.js --name ethereum-indexer
pm2 logs ethereum-indexer
pm2 save
pm2 startup# Check MongoDB
sudo systemctl status mongod
mongosh mongodb://localhost:27017/ethereum_indexer --eval "db.stats()"
# Check sync status
curl http://localhost:3000/api/indexernpm run reset-db
# Or manually:
mongosh mongodb://localhost:27017/ethereum_indexer --eval "db.dropDatabase()"mongosh mongodb://localhost:27017/ethereum_indexer --eval "db.indexerstates.updateOne({ key: 'sync_state' }, { \$set: { isSyncing: false } })"
npm run syncFor detailed troubleshooting, see ARCHITECTURE.md.
- ARCHITECTURE.md - Detailed architecture, API endpoints, database schema
- ROADMAP.md - Current features and future roadmap
- CONTRIBUTING.md - Contribution guidelines
- VERIFY_SYNC.md - Sync verification guide
- SYNC_CHECK.md - Sync monitoring guide
- Frontend: Next.js 15 (App Router), React 19, Tailwind CSS
- Backend: Next.js API Routes
- Database: MongoDB with Mongoose
- Blockchain: Web3.js v4
- Icons: React Icons
This project demonstrates industrial-grade blockchain indexing and exploration.
Note: While this repository provides a robust and functional foundation, it is intended as a showcase of core capabilities. It is not a fully-fledged, enterprise-ready production deployment out of the box.
I am available for paid engagement to develop fully customized, production-grade blockchain explorers and indexers tailored to your specific requirements, including:
- Custom EVM-compatible chains (Polygon, BSC, Avalanche, etc.)
- Layer 2 solutions and validiums
- Private permissioned blockchain networks
- Enterprise-grade security and infrastructure setup
- Email: aakash4dev.me@gmail.com
This project is licensed under the MIT License.
Copyright (c) 2024 Aakash Singh Rajput
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
We welcome contributions! Please see CONTRIBUTING.md for guidelines on how to contribute to this project.






