CryptoPulse is a comprehensive cryptocurrency tracking and notification platform built with Next.js, MongoDB, CoinGecko API, and Kestra for automated notifications.
- Real-time cryptocurrency price tracking
- Personalized price threshold alerts
- User authentication
- Detailed crypto insights
- Email notifications for price changes
- Frontend: Next.js 14
- Database: MongoDB
- Authentication: NextAuth.js
- Price Data: CoinGecko API
- Notification Workflow: Kestra
- Styling: Tailwind CSS
- Node.js (v18+)
- MongoDB
- CoinGecko API Key
- SMTP Email Service
- Clone the repository
git clone /~https://github.com/yourusername/cryptopulse.git
cd cryptopulse
- Install dependencies
npm install
- Create
.env.local
file
# MongoDB Connection
MONGODB_URI=your_mongodb_connection_string
# NextAuth Configuration
NEXTAUTH_SECRET=your_nextauth_secret
NEXTAUTH_URL=http://localhost:3000
# CoinGecko API
COINGECKO_API_URL=https://api.coingecko.com/api/v3
# Email Service
EMAIL_SERVICE_USER=your_email
EMAIL_SERVICE_PASS=your_email_password
# Kestra Configuration
KESTRA_API_ENDPOINT=your_kestra_endpoint
cryptopulse/
├── components/
│ ├── Layout/
│ ├── Crypto/
│ └── Animations/
├── pages/
│ ├── api/
│ │ ├── auth/
│ │ └── crypto/
│ ├── dashboard/
│ ├── explore/
│ └── crypto/
├── lib/
│ ├── mongodb.js
│ ├── coingecko.js
│ └── kestra-workflow.js
├── models/
│ ├── User.js
│ └── Watchlist.js
└── workflows/
└── crypto-notification.yml
- Google, Email providers
- Custom login/signup flows
// lib/coingecko.js
export async function fetchCryptoData(cryptoId) {
const response = await fetch(`https://api.coingecko.com/api/v3/coins/${cryptoId}`);
return response.json();
}
export async function fetchMarketData() {
const response = await fetch('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=100');
return response.json();
}
id: crypto-price-monitor
namespace: crypto.alerts
tasks:
- id: fetch-crypto-prices
type: io.kestra.core.tasks.scripts.Python
script: |
# Fetch prices and check thresholds
def monitor_crypto_prices():
# MongoDB connection
# Fetch user watchlists
# Compare current prices with thresholds
# Trigger notifications
pass
triggers:
- id: every-5-minutes
type: io.kestra.core.triggers.Cron
config:
cron: "*/5 * * * *"
// models/Watchlist.js
const watchlistSchema = new mongoose.Schema({
user: { type: mongoose.Schema.Types.ObjectId, ref: 'User' },
cryptoId: String,
thresholdType: {
type: String,
enum: ['above', 'below', 'between']
},
thresholdValue: Number,
notificationMethod: ['email', 'sms']
});
# Development Mode
npm run dev
# Production Build
npm run build
npm start
- Environment variable protection
- Secure API key management
- Rate limiting on crypto data fetching
- Crypto-themed background animations
- Project introduction
- Technology stack overview
- Cryptocurrency market data
- Comprehensive crypto statistics
- Price history graphs
- Market sentiment indicators
- User's crypto watchlist
- Threshold management
- Notification preferences
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Happy HackFrost 2024