Skip to content

shr8769/Crypto-X

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ CryptoX - Advanced Cryptocurrency Trading Platform

Live Demo React TypeScript Vite Clerk TailwindCSS

🌟 Live Application

πŸ”— View Live Demo


πŸ“‹ Table of Contents


🎯 Overview

CryptoX is a full-stack cryptocurrency trading platform that combines real-time market data, advanced machine learning predictions, and secure user authentication. Built with modern React and TypeScript, it provides traders with comprehensive tools for cryptocurrency analysis and portfolio management.

🎨 Key Highlights:

  • πŸ” Enterprise-grade authentication with Clerk
  • πŸ“Š Real-time cryptocurrency prices and market data
  • πŸ€– AI-powered price predictions using machine learning models
  • πŸ“ˆ Advanced trading analytics and portfolio tracking
  • 🌐 Responsive design for all devices
  • ⚑ Lightning-fast performance with Vite
  • 🎭 Beautiful UI/UX with Tailwind CSS and shadcn/ui

✨ Features

πŸ”’ Authentication System

  • Secure Sign Up/Sign In with email verification
  • Social Authentication (Google OAuth integration)
  • Protected Routes for authenticated users only
  • User Profile Management with avatar and settings
  • Session Management with automatic token refresh
  • Password Reset functionality
  • 🧠 Machine Learning Models Used

Crypto-X leverages multiple machine learning approaches for cryptocurrency analytics and prediction:

Purpose Model Types Used
Price Prediction Random Forest, Gradient Boosting, Linear Regression, LSTM Neural Net
Market Sentiment Random Forest, Custom Sentiment Analyzer
Trading Signals Random Forest, LSTM (details vary by implementation)

Model Details:

  • Random Forest Regressor: Used for time series price prediction and sentiment analysis.
  • Gradient Boosting Regressor: Available as an alternative for price prediction.
  • Linear Regression: Serves as a simple baseline.
  • LSTM Neural Network: Deep learning approach for advanced time series forecasting.
  • Custom Sentiment Analyzer: Combines news and social data for market sentiment scoring.

See ml-service/models/simple_ml_model.py, ml-service/models/market_sentiment_model.py, and the AI Models section for architecture details.

πŸ“Š Real-Time Market Data

  • Live Cryptocurrency Prices for major coins (BTC, ETH, ADA, SOL, MATIC)
  • 24h Price Changes with percentage indicators
  • Market Volume and market cap tracking
  • Price Charts with interactive visualizations
  • Historical Data analysis and trends

πŸ€– Machine Learning & AI Predictions

  • Price Prediction Models using LSTM neural networks
  • Market Sentiment Analysis for informed decision making
  • Trading Signal Generation (Buy/Hold/Sell recommendations)
  • Technical Analysis with multiple indicators
  • Risk Assessment algorithms

πŸ“ˆ Trading Dashboard

  • Portfolio Overview with performance metrics
  • Spending Analytics with monthly tracking
  • Market Activity monitoring
  • Personalized Recommendations based on user behavior
  • Real-time Notifications for price alerts

πŸ—žοΈ Crypto News Integration

  • Latest News from reliable cryptocurrency sources
  • Market Analysis articles and insights
  • Price Impact correlation with news events
  • Categorized Content (Bitcoin, Ethereum, DeFi, etc.)

πŸ› οΈ Tech Stack

Frontend

  • βš›οΈ React 18.3.1 - Modern UI library
  • πŸ“˜ TypeScript 5.8.3 - Type-safe development
  • ⚑ Vite 5.4.19 - Lightning-fast build tool
  • 🎨 Tailwind CSS - Utility-first styling
  • 🎭 shadcn/ui - Beautiful component library
  • 🧩 Radix UI - Accessible component primitives
  • πŸ“Š Recharts - Interactive chart library
  • πŸ”„ React Query - Data fetching and caching
  • πŸ›£οΈ React Router DOM - Client-side routing

Backend & Services

  • 🐍 Python Flask - ML model API server
  • πŸ€– scikit-learn - Machine learning models
  • πŸ“Š pandas & numpy - Data processing
  • πŸ” Clerk - Authentication and user management
  • ☁️ Vercel - Deployment and hosting

Development Tools

  • πŸ“¦ npm/Node.js - Package management
  • πŸ”§ ESLint - Code linting
  • 🎯 TypeScript - Type checking
  • 🎨 PostCSS - CSS processing
  • πŸ“± Mobile-first responsive design

πŸ” Authentication

CryptoX uses Clerk for enterprise-grade authentication:

// Protected route example
<ProtectedRoute>
  <Dashboard />
</ProtectedRoute>

// User profile access
const { user, isSignedIn } = useUser();

Authentication Features:

  • βœ… Email/Password authentication
  • βœ… Google OAuth integration
  • βœ… Email verification
  • βœ… Password reset
  • βœ… Session management
  • βœ… User profile management

πŸ€– Machine Learning

AI Models Implemented:

πŸ“ˆ Price Prediction Model

# LSTM Neural Network for price prediction
class CryptoPriceLSTM:
    def __init__(self, sequence_length=60):
        self.model = Sequential([
            LSTM(50, return_sequences=True),
            LSTM(50, return_sequences=True),
            LSTM(50),
            Dense(25),
            Dense(1)
        ])

πŸ“Š Market Sentiment Analysis

# Sentiment analysis for market trends
def analyze_market_sentiment(news_data, social_data):
    sentiment_score = sentiment_analyzer.predict(combined_data)
    return {"sentiment": sentiment_score, "confidence": confidence_level}

🎯 Trading Signal Generator

# Technical analysis for trading signals
def generate_trading_signals(price_data, volume_data):
    signals = technical_analyzer.analyze(price_data, volume_data)
    return {"signal": "BUY/HOLD/SELL", "strength": confidence}

ML Features:

  • 🧠 LSTM Neural Networks for price prediction
  • πŸ“Š Sentiment Analysis using NLP
  • πŸ“ˆ Technical Indicators (RSI, MACD, Bollinger Bands)
  • 🎯 Trading Signals with confidence scores
  • πŸ“‰ Risk Assessment algorithms

πŸš€ Installation

Prerequisites

  • Node.js 18+
  • Python 3.8+ (for ML service)
  • Git

Frontend Setup

# Clone the repository
git clone https://github.com/shr8769/Crypto-X.git
cd Crypto-X

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Add your Clerk keys to .env

# Start development server
npm run dev

ML Service Setup

# Navigate to ML service
cd ml-service

# Create virtual environment
python -m venv ml_env
source ml_env/bin/activate  # On Windows: ml_env\Scripts\activate

# Install Python dependencies
pip install -r requirements.txt

# Train models
python train_all_models.py

# Start ML API server
python api_server.py

πŸ”‘ Environment Variables

Create a .env file in the root directory:

# Clerk Authentication
VITE_CLERK_PUBLISHABLE_KEY=pk_test_your_key_here
CLERK_SECRET_KEY=sk_test_your_secret_key_here

# Optional: Custom URLs
VITE_CLERK_SIGN_IN_URL=/sign-in
VITE_CLERK_SIGN_UP_URL=/sign-up
VITE_CLERK_AFTER_SIGN_IN_URL=/dashboard
VITE_CLERK_AFTER_SIGN_UP_URL=/dashboard

Getting Clerk Keys:

  1. Go to dashboard.clerk.com
  2. Create a new application
  3. Copy your publishable key and secret key
  4. Add them to your .env file

🌐 Deployment

Vercel Deployment (Recommended)

# Build the project
npm run build

# Deploy to Vercel
npx vercel --prod

# Or use Vercel dashboard:
# 1. Connect your GitHub repository
# 2. Add environment variables
# 3. Deploy automatically

Other Deployment Options

  • Netlify: Drag and drop dist folder
  • GitHub Pages: Static site deployment
  • AWS S3: Static website hosting
  • Docker: Containerized deployment

πŸ”Œ API Endpoints

ML Service API

# Health check
GET /health

# Get price prediction
POST /predict
{
  "symbol": "BTC",
  "days": 7
}

# Get trading signals
POST /signals
{
  "symbol": "ETH",
  "timeframe": "1h"
}

# Market sentiment
GET /sentiment/{symbol}

External APIs Used

  • CoinGecko API: Real-time cryptocurrency data
  • News APIs: Latest crypto news and analysis
  • Technical Analysis APIs: Chart data and indicators

πŸ“Š Project Structure

Crypto-X/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ ui/             # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ AuthModal.tsx   # Authentication modal
β”‚   β”‚   β”œβ”€β”€ CryptoTicker.tsx # Price ticker
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx   # Main dashboard
β”‚   β”‚   └── Navigation.tsx  # Navigation bar
β”‚   β”œβ”€β”€ contexts/           # React contexts
β”‚   β”‚   └── AuthContext.tsx # Authentication context
β”‚   β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useCryptoPrices.ts
β”‚   β”‚   β”œβ”€β”€ useMLService.ts
β”‚   β”‚   └── useScrollToSection.ts
β”‚   β”œβ”€β”€ pages/              # Route components
β”‚   β”‚   β”œβ”€β”€ Auth.tsx       # Authentication page
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx  # User dashboard
β”‚   β”‚   └── Index.tsx      # Homepage
β”‚   β”œβ”€β”€ services/          # API services
β”‚   β”‚   └── aiPrediction.ts
β”‚   └── types/             # TypeScript type definitions
β”œβ”€β”€ ml-service/            # Python ML backend
β”‚   β”œβ”€β”€ models/           # Trained ML models
β”‚   β”œβ”€β”€ data/            # Historical crypto data
β”‚   β”œβ”€β”€ api_server.py    # Flask API server
β”‚   └── train_models.py  # Model training scripts
β”œβ”€β”€ public/              # Static assets
└── docs/               # Documentation

🀝 Contributing

Contributions are welcome! Here's how you can help:

πŸ› Bug Reports

  • Use the issue template
  • Provide detailed reproduction steps
  • Include screenshots if applicable

✨ Feature Requests

  • Check existing issues first
  • Provide clear use cases
  • Explain the expected behavior

πŸ”§ Development

# Fork the repository
# Create a feature branch
git checkout -b feature/amazing-feature

# Make your changes
git commit -m "Add amazing feature"

# Push to the branch
git push origin feature/amazing-feature

# Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

shr8769


πŸ™ Acknowledgments

  • Clerk for authentication services
  • Vercel for hosting and deployment
  • CoinGecko for cryptocurrency data
  • shadcn/ui for beautiful components
  • React Team for the amazing framework
  • Open Source Community for inspiration and tools

⭐ Show Your Support

If you found this project helpful, please consider:

  • ⭐ Starring the repository
  • 🍴 Forking for your own projects
  • πŸ› Reporting issues and bugs
  • πŸ’‘ Suggesting new features
  • πŸ“’ Sharing with others

πŸš€ Launch CryptoX Platform πŸš€

Built with ❀️ by shr8769

About

Crypto-X uses Random Forest, Gradient Boosting, Linear Crypto-X uses Random Forest, Gradient Boosting, Linear Regression, and LSTM neural networks for price prediction and sentiment analysis in cryptocurrency markets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors