This content originally appeared on DEV Community and was authored by Danilo Jamaal
Build a Production-Ready Crypto Alert System in 20 Minutes
Real-time price alerts, browser notifications, and professional UI with React + LunarCrush API
The 3 AM Bitcoin Alert That Changed Everything
Picture this: It’s 3 AM, Bitcoin just hit an all time high, and your phone buzzes with a push notification from an app you built yourself. While everyone else is scrambling to check their portfolio in the morning, you’ve already captured the perfect entry point thanks to your custom alert system.
-
Try the Live Demo – View the deployed version and explore the code
That’s exactly what we’re building today.
What We’re Building
We’re creating a production-ready cryptocurrency alert system that demonstrates modern frontend development skills while solving a real-world problem. Here’s what makes this project special:
Key Features
11 Different Alert Types – Price thresholds, volume spikes, sentiment changes
Real-Time Data – Live Bitcoin and Ethereum prices via LunarCrush API
Browser Notifications – Native OS integration with sound and vibration
Professional UI – Mantine 8.2.1 with glassmorphism effects and dark theme
Lightning Fast – Zustand + React Query for optimal performance
Why This Project Rocks for Your Portfolio
- Real-world application that solves actual crypto trading needs
- Modern React patterns with hooks, context, and performance optimization
- Production deployment on Cloudflare Pages with live demo
- Complex state management handling real-time data and user preferences
- Professional UI/UX that looks enterprise-grade
Tech Stack Breakdown
We’re using the latest and greatest in frontend development:
Frontend Powerhouse
- React 18 – Modern concurrent features and hooks
- Vite 5 – Lightning-fast development and optimized builds
- Mantine 8.2.1 – Professional component library with consistent theming
State & Data Management
- Zustand 4.4.7 – Lightweight, performant state management
- React Query 5 – Smart data fetching with caching and background updates
- Local Storage – Persistent alerts that survive browser restarts
Real-Time Integration
- LunarCrush API – Live cryptocurrency data and social sentiment
- 30-second polling – Balanced performance with fresh data
Get Started Instantly
Instead of copying code snippets, I’ve created a complete repository with everything you need:
Fork the Repository
Why Fork Instead of Clone?
Get your own copy to customize and deploy
Easily deploy to Vercel/Cloudflare from your fork
Showcase on your GitHub profile
Contribute improvements back if you discover bugs
Prerequisites
# Check your versions
node --version # Need 18+
npm --version # Need 8+
Quick Start Commands
# After forking to your account
git clone https://github.com/YOUR_USERNAME/crypto-alert-system
cd crypto-alert-system
npm install
# Start development server
npm run dev
# Open http://localhost:3000
Environment Configuration
# .env.local
VITE_API_BASE_URL=https://cryptoguard-api.cryptoguard-api.workers.dev
VITE_API_KEY=demo_tutorial_001
VITE_MODE=production
That’s it! Your crypto alert system should now be running with live Bitcoin and Ethereum prices.
What You Just Cloned
The repository contains 20+ production-ready files:
- Components: HeroSection, DashboardGrid, AlertModal, and 10+ more
- Hooks: useCryptoData, useNotifications, useAlertChecker
- Stores: Zustand stores for crypto data and alert management
- Styles: Complete Mantine theme and responsive design
- Config: Vite build setup, ESLint, deployment configuration
Understanding the Architecture
Now that you have the complete code running, let’s explore how everything works together:
Project Structure Overview
crypto-alert-system/
├── 📁 src/
│ ├── 🏠 App.jsx # Main app component
│ ├── 📁 components/
│ │ ├── 📁 layout/ # HeroSection, Footer
│ │ ├── 📁 dashboard/ # DashboardGrid, CryptoCard
│ │ ├── 📁 alerts/ # AlertModal, AlertsList
│ │ └── 📁 ui/ # Reusable components
│ ├── 📁 stores/
│ │ ├── 💎 useCryptoStore.js # Real-time crypto data
│ │ └── 🚨 useAlertStore.js # Alert management
│ ├── 📁 hooks/
│ │ ├── 📊 useCryptoData.js # Data fetching logic
│ │ ├── 🔔 useNotifications.js # Browser notifications
│ │ └── ⚡ useAlertChecker.js # Alert monitoring
│ └── 📁 api/
│ └── 🌐 cryptoApi.js # LunarCrush integration
Key Architecture Patterns
1. State Management with Zustand
-
useCryptoStore.js
– Manages real-time price data and connection status -
useAlertStore.js
– Handles alert creation, persistence, and notifications - Clean, performant stores without Redux boilerplate
2. Real-Time Data Flow
- React Query for smart caching and background updates
- 30-second polling strategy (more reliable than WebSockets)
- Automatic error recovery and connection management
3. Component Architecture
-
HeroSection.jsx
– Live price display with glassmorphism effects -
DashboardGrid.jsx
– Main crypto dashboard with real-time updates -
AlertModal.jsx
– Complete alert creation system with 11 alert types
4. Browser Integration
- Native notification permissions and triggering
- LocalStorage persistence for alerts
- Mobile-responsive touch interactions
Key Features to Explore
Now that you have the code running, here are the standout features to check out:
Live Price Hero Section
-
File:
src/components/layout/HeroSection.jsx
- Features: Real-time Bitcoin (~$119K) and Ethereum prices with glassmorphism cards
- Tech: Mantine NumberFormatter, responsive design, gradient backgrounds
11 Alert Types System
-
File:
src/components/alerts/AlertModal.jsx
- Alert Types: Price thresholds, volume spikes, sentiment changes, market cap, social volume, and more
- Integration: Complete browser notification system with persistence
Professional Dashboard
-
File:
src/components/dashboard/DashboardGrid.jsx
- Features: Live crypto cards, connection status, auto-refresh controls
- Design: Mobile-first responsive layout with loading states
Browser Notification System
-
File:
src/hooks/useNotifications.js
- Features: Native OS notifications with sound, permission handling
- Integration: Automatic alert triggering based on price conditions
Real-Time Data Management
-
Files:
src/hooks/useCryptoData.js
,src/stores/useCryptoStore.js
- Strategy: Smart polling every 30 seconds with React Query caching
- Features: Connection monitoring, error recovery, pause/resume functionality
Deployment to Production
Cloudflare Pages (Recommended)
Deploy your app globally in minutes:
# Build for production
npm run build
# Verify build works locally
npm run preview
Cloudflare Pages Setup:
- Go to Cloudflare Dashboard
- Navigate to Pages → Connect to Git
- Select your repository
- Configure build settings:
- Framework: Vite
-
Build command:
npm run build
-
Output directory:
dist
- Node.js version: 18
Environment Variables:
VITE_API_BASE_URL=https://cryptoguard-api.cryptoguard-api.workers.dev
VITE_API_KEY=demo_tutorial_001
VITE_MODE=production
Alternative: Vercel One-Click Deploy
Key Technical Decisions Explained
Why Zustand Over Redux?
Zustand Advantages:
75% less boilerplate code
TypeScript-friendly by default
No providers needed
Smaller bundle size (~2.5KB vs ~45KB)
Better performance for frequent updates
Example Pattern (see src/stores/useCryptoStore.js
):
// Simple Zustand store
const useStore = create((set) => ({
count: 0,
increment: () => set((state) => ({ count: state.count + 1 }))
}));
// vs Redux: actions, reducers, store setup, providers...
Polling vs WebSockets for Real-Time Data
Why We Chose Polling:
Simpler implementation and debugging
Works behind firewalls and corporate proxies
Automatic error recovery with React Query
Battery-friendly (pauses when tab hidden)
No connection state management complexity
Implementation: Check src/hooks/useCryptoData.js
for the React Query setup with smart polling.
Mantine vs Other UI Libraries
Mantine Advantages:
100+ components out of the box
Built-in dark theme support
Excellent TypeScript support
Responsive design utilities
Professional glassmorphism effects
Example: See src/components/layout/HeroSection.jsx
for advanced Mantine usage.
Browser Notifications Strategy
Our Approach:
Request permissions gracefully (not on page load)
Fallback UI indicators when notifications disabled
Persistent alerts that survive browser restarts
Sound integration with graceful failures
Files to explore: src/hooks/useNotifications.js
and src/hooks/useAlertChecker.js
Extension Ideas & AI Prompts
Ready to take this further? Here are copy-paste AI prompts:
For ChatGPT/Claude:
“Add Portfolio Tracking”
Add a portfolio tracking feature to my crypto alert system. Create a React component that:
1. Lets users add cryptocurrencies with quantity owned
2. Shows total portfolio value in real-time
3. Calculates profit/loss with color coding
4. Uses the existing Zustand store pattern
5. Integrates with the current LunarCrush API structure
Current store structure: [paste your useCryptoStore.js]
“Advanced Chart Integration”
Enhance my crypto alert system with TradingView-style charts. Create:
1. A new component using Recharts or Chart.js
2. Candlestick/line chart toggle
3. Technical indicators (SMA, RSI)
4. Price alert lines overlaid on chart
5. Mobile-responsive chart controls
Current component structure: [paste your DashboardGrid.jsx]
“Social Sentiment Analysis”
Add social sentiment analysis to my crypto dashboard using the LunarCrush social data. Create:
1. Sentiment gauge component (0-100 scale)
2. Recent social posts widget
3. Trending hashtags section
4. Influencer mentions tracker
5. Sentiment-based alert types
API response structure: [paste sample LunarCrush response]
What You’ve Built
Congratulations! You now have a production-ready cryptocurrency alert system that demonstrates:
Technical Skills Showcased
Modern React – Hooks, context, performance optimization
State Management – Complex Zustand + React Query architecture
Real-Time Systems – Polling, connection management, error recovery
Professional UI – Mantine components, responsive design, animations
Browser APIs – Notifications, local storage, permissions
Production Deployment – Cloudflare Pages, environment configuration
Business Value Demonstrated
Real-World Application – Solves actual crypto trading problems
Financial Integration – Live market data and social sentiment
User Experience – Mobile-first, accessible, performant
Engagement Features – Push notifications, persistent alerts
Scalable Architecture – Easy to extend and maintain
Next Steps
For Your Portfolio
- Deploy to production and add the live demo to your resume
- Write about the technical decisions – state management choice, polling vs WebSockets
- Create a demo video showing alert creation and notifications
- Add to LinkedIn with technical highlights and live demo link
For Learning More
- Explore LunarCrush API – Add social sentiment features
- Implement WebSockets – Compare performance with polling approach
- Add user authentication – Personal alert management
- Create mobile app – React Native version
For Contributing
Found this helpful? Star the repository and share your improvements!
Let’s Connect
Built something cool with this tutorial? I’d love to see it!
- LinkedIn: danilo-batson
- Portfolio: danilobatson.github.io
- Email: djbatson19@gmail.com
Happy coding, and may your crypto alerts always trigger at the perfect moment!
Want more tutorials like this? Follow me for modern React patterns, real-time applications, and production deployment strategies.
This content originally appeared on DEV Community and was authored by Danilo Jamaal