hackquest logo

ChainPulse

ChainPulse is a real-time blockchain event notification and visualization system that integrates smart account functionality (ERC-4337), event indexing (Envio), real-time notifications (WebSocket), an

Videos

Tech Stack

React
Next
Web3
Ethers

Description

# ChainPulse - Real-time Blockchain Event Notification & Visualization System

## ๐Ÿš€ Project Overview

**ChainPulse** is a comprehensive Web3 platform that provides real-time blockchain event monitoring, smart account integration, and data visualization. The system combines event indexing, instant notifications, and interactive dashboards to deliver seamless blockchain interaction experiences.

### ๐ŸŽฏ Core Value Proposition

- **Real-time Monitoring**: Instant notifications for on-chain events (transfers, swaps, NFT mints, etc.)
- **Smart Account Integration**: ERC-4337 Account Abstraction with automated response capabilities
- **Comprehensive Visualization**: Dynamic charts and dashboards for blockchain activity analysis
- **Multi-channel Notifications**: Web, Telegram, and Discord integration
- **Extensible Architecture**: Support for multiple chains and event types

---

## ๐Ÿ—๏ธ System Architecture

### Technology Stack

#### Frontend
- **Framework**: Next.js 15.2.4 with App Router
- **Language**: TypeScript 5.x
- **Styling**: Tailwind CSS 4.1.9 with custom animations
- **UI Components**: Shadcn/UI (50+ components) + Radix UI
- **Web3**: Wagmi + Viem + RainbowKit for wallet integration
- **Charts**: Recharts for data visualization
- **Real-time**: Socket.IO client for WebSocket connections

#### Backend
- **Runtime**: Node.js with Express.js
- **Language**: TypeScript
- **Database**: PostgreSQL with Prisma ORM
- **Authentication**: JWT with wallet signature verification
- **Real-time**: Socket.IO server for WebSocket communication
- **GraphQL**: Apollo Server for data queries
- **Rate Limiting**: Express-rate-limit for API protection

#### Blockchain & Indexing
- **Smart Contracts**: Solidity with ERC-4337 Account Abstraction
- **Indexer**: Envio for real-time event indexing
- **Networks**: Ethereum, Polygon, Arbitrum, Optimism, Base, Monad Testnet
- **Development**: Hardhat framework with comprehensive testing

#### Infrastructure
- **Database**: PostgreSQL (Local/Supabase)
- **Deployment**: Docker containerization ready
- **Monitoring**: Winston logging with structured logs

---

## โœ… Completed Features

### ๐ŸŽจ Frontend (100% Complete)
- โœ… **Complete UI/UX Design**: Modern glass-morphism design with dark/light themes
- โœ… **Wallet Integration**: RainbowKit with multi-wallet support
- โœ… **Authentication Flow**: Signature-based login with persistent sessions
- โœ… **Dashboard Components**: 
  - Smart Account Status panel
  - Event Subscriptions management
  - Notification center with filtering
  - Real-time activity feed
  - Analytics charts (4 types)
- โœ… **Responsive Design**: Mobile-first approach with adaptive layouts
- โœ… **Internationalization**: English/Chinese language support
- โœ… **Animation System**: Framer Motion with smooth transitions
- โœ… **50+ UI Components**: Complete Shadcn/UI integration

### ๐Ÿ”ง Backend (95% Complete)
- โœ… **RESTful API**: 52 endpoints across 7 modules
  - Authentication (3 endpoints)
  - User Management (4 endpoints)
  - Smart Accounts (8 endpoints)
  - Event Subscriptions (7 endpoints)
  - Notifications (6 endpoints)
  - Analytics (12 endpoints)
  - Automation Rules (6 endpoints)
  - Integrations (6 endpoints)
- โœ… **WebSocket Server**: Real-time event broadcasting
- โœ… **Database Schema**: 10 tables with proper relationships
- โœ… **Authentication System**: JWT + wallet signature verification
- โœ… **Rate Limiting**: API protection with configurable limits
- โœ… **Error Handling**: Comprehensive error management
- โœ… **Logging System**: Structured logging with Winston
- โœ… **Data Validation**: Zod schemas for all endpoints

### ๐Ÿ—„๏ธ Database (100% Complete)
- โœ… **Schema Design**: Complete ERD with 10 tables
- โœ… **Relationships**: Proper foreign keys and constraints
- โœ… **Indexing**: Optimized queries with strategic indexes
- โœ… **Partitioning**: Monthly partitioning for large tables
- โœ… **Security**: Row Level Security (RLS) policies
- โœ… **Seed Data**: Comprehensive mock data for testing
- โœ… **Migration Scripts**: Prisma-based database migrations

### ๐Ÿ“Š Smart Contracts (90% Complete)
- โœ… **ERC-4337 Implementation**: SimpleAccount with factory pattern
- โœ… **Account Abstraction**: Gas abstraction and batch transactions
- โœ… **Security Features**: Multi-signature and social recovery
- โœ… **Testing Suite**: Comprehensive Hardhat tests
- โœ… **Deployment Scripts**: Automated deployment with verification
- โœ… **Gas Optimization**: Efficient contract design

### ๐Ÿ” Event Indexing (90% Complete)
- โœ… **Envio Configuration**: Complete schema and event handlers
- โœ… **GraphQL Schema**: Structured data queries
- โœ… **Event Processing**: Real-time blockchain event capture
- โœ… **Multi-chain Support**: Configuration for 6+ networks
- โœ… **Data Aggregation**: Event statistics and analytics

### ๐Ÿ”— Integration (85% Complete)
- โœ… **Frontend-Backend**: Complete API integration
- โœ… **Authentication Flow**: Wallet connection and session management
- โœ… **Real-time Updates**: WebSocket event streaming
- โœ… **Mock Data System**: Comprehensive test data generation
- โœ… **Development Tools**: Prisma Studio, API documentation

---

## ๐Ÿšง Pending Features

### ๐ŸŒ Deployment (0% Complete)
- โฌœ **Smart Contract Deployment**: Deploy to testnets and mainnet
- โฌœ **Envio Cloud Deployment**: Production indexer deployment
- โฌœ **Frontend Deployment**: Vercel/Netlify hosting
- โฌœ **Backend Deployment**: Railway/Heroku hosting
- โฌœ **Database Hosting**: Production PostgreSQL setup

### ๐Ÿ”ง Advanced Features (20% Complete)
- โฌœ **Automation Engine**: Smart contract interaction automation
- โฌœ **Advanced Analytics**: Complex data aggregation and insights
- โฌœ **Multi-chain Expansion**: Additional blockchain networks
- โฌœ **Mobile App**: React Native mobile application
- โฌœ **API Rate Plans**: Tiered access with usage limits

### ๐Ÿ”Œ Third-party Integrations (30% Complete)
- โฌœ **Telegram Bot**: Automated notification bot
- โฌœ **Discord Webhook**: Server notification integration
- โฌœ **Email Notifications**: SMTP-based email alerts
- โฌœ **Slack Integration**: Workspace notification system

### ๐Ÿงช Testing & Quality (60% Complete)
- โœ… **Unit Tests**: Backend service layer testing
- โœ… **Smart Contract Tests**: Comprehensive Hardhat test suite
- โฌœ **Integration Tests**: End-to-end API testing
- โฌœ **Frontend Tests**: React component testing
- โฌœ **Performance Tests**: Load testing and optimization

---

## ๐Ÿ“Š Development Progress

```
Overall Progress: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘ 85%

Frontend:         โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 100% โœ…
Backend:          โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘ 95%  โœ…
Database:         โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 100% โœ…
Smart Contracts:  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘ 90%  โœ…
Event Indexing:   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘ 90%  โœ…
Integration:      โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘ 85%  โœ…
Deployment:       โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 0%   โฌœ
Testing:          โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 60%  ๐Ÿ”„
```

### Key Achievements
- **52 REST API endpoints** implemented and tested
- **50+ UI components** with modern design system
- **Complete database schema** with 10 tables and relationships
- **ERC-4337 smart contracts** with factory pattern
- **Real-time WebSocket** communication system
- **Comprehensive mock data** for development and testing
- **Multi-language support** (English/Chinese)
- **Responsive design** for all screen sizes

---

## ๐Ÿš€ Quick Start

### Prerequisites
- Node.js 20+
- PostgreSQL 14+
- Git

### Installation

```bash
# Clone repository
git clone https://github.com/gerrardLT/ChainPulse.git
cd ChainPulse

# Install dependencies
npm install

# Setup database
cd backend
npm run prisma:migrate
npm run db:seed

# Start development servers
npm run dev  # Backend (port 4000)

# In new terminal
cd frontend
npm run dev  # Frontend (port 3000)
```
---

## ๐Ÿ“ Project Structure

```
ChainPulse/
โ”œโ”€โ”€ frontend/           # Next.js application
โ”‚   โ”œโ”€โ”€ app/           # App Router pages
โ”‚   โ”œโ”€โ”€ components/    # React components
โ”‚   โ”œโ”€โ”€ hooks/         # Custom React hooks
โ”‚   โ”œโ”€โ”€ lib/           # Utilities and API clients
โ”‚   โ””โ”€โ”€ public/        # Static assets
โ”œโ”€โ”€ backend/           # Node.js API server
โ”‚   โ”œโ”€โ”€ src/           # Source code
โ”‚   โ”œโ”€โ”€ prisma/        # Database schema and migrations
โ”‚   โ””โ”€โ”€ tests/         # Test suites
โ”œโ”€โ”€ contracts/         # Smart contracts
โ”‚   โ”œโ”€โ”€ contracts/     # Solidity contracts
โ”‚   โ”œโ”€โ”€ scripts/       # Deployment scripts
โ”‚   โ””โ”€โ”€ test/          # Contract tests
โ”œโ”€โ”€ indexer/          # Envio indexer
โ”‚   โ”œโ”€โ”€ config.yaml   # Indexer configuration
โ”‚   โ”œโ”€โ”€ schema.graphql # GraphQL schema
โ”‚   โ””โ”€โ”€ src/          # Event handlers
โ”œโ”€โ”€ database/         # SQL scripts
โ””โ”€โ”€ docs/             # Documentation
```

---

## ๐ŸŽฏ Next Steps

### Immediate Priorities (Next 2 weeks)
1. **Smart Contract Deployment**: Deploy to Monad Testnet and Ethereum Sepolia
2. **Envio Indexer Deployment**: Set up production event indexing
3. **Integration Testing**: End-to-end functionality verification
4. **Performance Optimization**: Database query optimization and caching

### Medium-term Goals (1-2 months)
1. **Production Deployment**: Full system deployment to cloud platforms
2. **Advanced Analytics**: Complex data visualization and insights
3. **Mobile Application**: React Native app development
4. **Third-party Integrations**: Telegram and Discord bots

### Long-term Vision (3-6 months)
1. **Multi-chain Expansion**: Support for additional blockchain networks
2. **Enterprise Features**: Advanced automation and workflow management
3. **API Monetization**: Tiered access plans and usage-based pricing
4. **Community Features**: User-generated content and social features

---


### Development Guidelines
- **Code Quality**: TypeScript strict mode, ESLint, Prettier
- **Testing**: Unit tests for all business logic
- **Documentation**: Comprehensive inline and external documentation
- **Git Workflow**: Feature branches with detailed commit messages

### Key Documentation
- [Product Requirements](docs/ไบงๅ“้œ€ๆฑ‚ๆ–‡ๆกฃ.md)
- [Technical Architecture](docs/็ณป็ปŸๆŠ€ๆœฏๆžถๆž„.md)
- [Database Design](docs/ๆ•ฐๆฎๅบ“่ฎพ่ฎก.md)
- [API Documentation](docs/API่ฎพ่ฎก.md)
- [Development Tasks](docs/ๅผ€ๅ‘ไปปๅŠกๆธ…ๅ•.md)

---

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

Progress During Hackathon

- **Real-time Monitoring**: Instant notifications for on-chain events (transfers, swaps, NFT mints, etc.) - **Smart Account Integration**: ERC-4337 Account Abstraction with automated response capabilities - **Comprehensive Visualization**: Dynamic charts and dashboards for blockchain activity analysis - **Multi-channel Notifications**: Web, Telegram, and Discord integration - **Extensible Architecture**: Support for multiple chains and event types
Team Leader
HhumanityFighting gerrard
Project Link
Sector
SocialFi