Skip to content

Vicent00/Trading_view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CryptoVista

Next.js TypeScript Tailwind CSS Zustand

Professional cryptocurrency analytics platform with real-time data and advanced market insights

Live Demo Deploy

🎯 What is CryptoVista?

CryptoVista is a comprehensive cryptocurrency analytics platform designed for traders, investors, and crypto enthusiasts. It provides real-time market data, professional-grade charts, and advanced analytics tools to help users make informed decisions in the volatile crypto market.

🎯 Purpose & Target Audience

  • Traders: Real-time price monitoring and technical analysis
  • Investors: Portfolio tracking and market overview
  • Developers: Learning modern web development with crypto APIs
  • Crypto Enthusiasts: Staying updated with market trends

✨ Key Features

  • πŸ”΄ Real-Time Data: WebSocket connection to Binance for instant price updates
  • πŸ“Š Professional Charts: Interactive candlestick charts with lightweight-charts v5
  • πŸ’° Multiple Cryptocurrencies: Support for BTC, ETH, SOL with instant switching
  • πŸ“ˆ Market Overview: Global market stats, top gainers/losers, and comprehensive market data
  • πŸ” Advanced Analytics: Multi-chart dashboard with customizable layouts
  • πŸ“Š Compare Mode: Side-by-side price evolution comparison
  • πŸ“± Watchlist Management: Create and manage custom cryptocurrency watchlists
  • 🎨 Modern UI: Dark theme with professional design and smooth animations
  • ⚑ Ultra Fast: Next.js 15 with Turbopack for instant development
  • πŸ”„ Smart Reconnection: Exponential backoff for reliable WebSocket connections
  • πŸ“± Fully Responsive: Perfect experience on desktop and mobile devices

πŸ› οΈ Technology Stack

Technology Version Purpose
Next.js 15.5.4 React framework with SSR/SSG
TypeScript 5.0 Static typing and better DX
Tailwind CSS 4.0 Utility-first CSS framework
Zustand 5.0.8 Lightweight state management
lightweight-charts 5.0.9 Professional financial charts
Binance API REST + WS Free market data
CoinGecko API REST Global market statistics

πŸ—οΈ Project Architecture

πŸ“ File Structure

src/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ analytics/                # Multi-chart analytics dashboard
β”‚   β”œβ”€β”€ market-overview/          # Global market overview
β”‚   β”œβ”€β”€ compare/                  # Price comparison tool
β”‚   β”œβ”€β”€ layout.tsx               # Main application layout
β”‚   └── page.tsx                 # Landing page
β”œβ”€β”€ components/                   # React components
β”‚   β”œβ”€β”€ layout/                  # Layout components
β”‚   β”‚   β”œβ”€β”€ AppLayout.tsx        # Main app wrapper
β”‚   β”‚   β”œβ”€β”€ Navbar.tsx           # Navigation bar
β”‚   β”‚   └── Sidebar.tsx          # Collapsible sidebar
β”‚   β”œβ”€β”€ analytics/               # Analytics components
β”‚   β”‚   β”œβ”€β”€ ChartCard.tsx        # Individual chart component
β”‚   β”‚   β”œβ”€β”€ GridLayout.tsx       # Chart grid layout
β”‚   β”‚   └── LayoutControls.tsx   # Layout customization
β”‚   β”œβ”€β”€ watchlist/               # Watchlist management
β”‚   β”‚   β”œβ”€β”€ WatchlistGroup.tsx   # Watchlist container
β”‚   β”‚   β”œβ”€β”€ WatchlistItem.tsx    # Individual watchlist item
β”‚   β”‚   β”œβ”€β”€ AddWatchlistModal.tsx # Create new watchlist
β”‚   β”‚   └── AddTokenModal.tsx    # Add tokens to watchlist
β”‚   β”œβ”€β”€ Chart.tsx                # Main candlestick chart
β”‚   β”œβ”€β”€ PriceTicker.tsx          # Price display component
β”‚   β”œβ”€β”€ ConnectionStatus.tsx     # WebSocket status indicator
β”‚   └── SymbolSelector.tsx       # Cryptocurrency selector
β”œβ”€β”€ hooks/                       # Custom React hooks
β”‚   β”œβ”€β”€ useBinanceWebSocket.ts   # WebSocket data management
β”‚   β”œβ”€β”€ useBinanceTicker.ts      # 24hr ticker data
β”‚   └── useBinanceChart.ts       # Historical chart data
β”œβ”€β”€ store/                       # Zustand state management
β”‚   β”œβ”€β”€ marketStore.ts           # Main market data
β”‚   β”œβ”€β”€ tickerStore.ts           # 24hr ticker data
β”‚   β”œβ”€β”€ watchlistStore.ts        # Watchlist management
β”‚   └── uiStore.ts               # UI state management
β”œβ”€β”€ types/                       # TypeScript definitions
β”‚   β”œβ”€β”€ market.ts                # Market data interfaces
β”‚   β”œβ”€β”€ ticker.ts                # Ticker data interfaces
β”‚   └── watchlist.ts             # Watchlist interfaces
└── utils/                       # Utility functions
    β”œβ”€β”€ symbolMapper.ts          # Symbol mapping utilities
    └── coingecko.ts             # CoinGecko API utilities

πŸ”„ Data Flow Architecture

graph TD
    A[Binance WebSocket] --> B[useBinanceWebSocket Hook]
    B --> C[Zustand Store]
    C --> D[React Components]
    
    E[Binance REST API] --> F[Historical Data]
    F --> C
    
    G[CoinGecko API] --> H[Global Market Data]
    H --> I[Market Overview]
    
    C --> J[Chart Component]
    C --> K[PriceTicker]
    C --> L[Watchlist Items]
    C --> M[ConnectionStatus]
Loading

πŸš€ Quick Start

# Clone the repository
git clone https://github.com/Vicent00/crypto-tracker.git
cd crypto-tracker

# Install dependencies
npm install

# Start development server
npm run dev

Open http://localhost:3000 in your browser πŸŽ‰

πŸ“‹ Available Scripts

# Development with Turbopack (ultra fast)
npm run dev

# Production build
npm run build

# Production server
npm start

# Linting and type checking
npm run lint
npx tsc --noEmit

πŸ“Š API Integration

Binance WebSocket (Real-Time)

  • URL: wss://stream.binance.com:9443/stream
  • Streams: {symbol}@trade and {symbol}@kline_1m
  • Data: Real-time prices, trades, and candlesticks

Binance REST (Historical)

  • Endpoint: https://api.binance.com/api/v3/klines
  • Parameters: symbol, interval=1m, limit=500
  • Data: 500 historical candlesticks (8+ hours)

CoinGecko API (Market Data)

  • Endpoint: https://api.coingecko.com/api/v3
  • Data: Global market statistics, top cryptocurrencies
  • Rate Limit: 10-50 calls/minute (free tier)

🎨 Core Components

πŸ“ˆ Chart Component

  • Professional candlestick charts with lightweight-charts
  • Zoom, pan, and interactive tools
  • Custom color schemes (green/red)
  • Responsive and optimized for performance

πŸ’° PriceTicker

  • Large price display with animations
  • Color-coded price change indicators
  • Automatic currency formatting
  • Real-time updates

πŸ“Š Market Overview

  • Global cryptocurrency market statistics
  • Top gainers and losers
  • Sortable market cap table
  • Real-time data updates every 60 seconds

πŸ” Analytics Dashboard

  • Multi-chart layout with customizable grids
  • Individual chart management
  • Real-time WebSocket connections per chart
  • Professional trading interface

πŸ“‹ Watchlist Management

  • Create custom cryptocurrency watchlists
  • Add/remove tokens dynamically
  • Real-time price tracking
  • Persistent storage with localStorage

βš™οΈ Configuration

Environment Variables

No API keys required. The project uses public endpoints from Binance and CoinGecko.

Customization Options

  • Symbols: Modify supported cryptocurrencies in components
  • Colors: Adjust color palette in tailwind.config.js
  • Limits: Change data limits in store configurations
  • Intervals: Modify chart update frequencies

πŸš€ Deployment

Vercel (Recommended)

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

Docker

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]

πŸ”§ Development Features

State Management

  • Zustand: Lightweight state management
  • Modular Stores: Separate stores for different data types
  • TypeScript: Full type safety throughout the application

Performance Optimizations

  • Next.js 15: Latest framework with Turbopack
  • Image Optimization: Next.js Image component
  • Code Splitting: Automatic route-based splitting
  • WebSocket Efficiency: Smart reconnection and data management

Developer Experience

  • TypeScript: Full type safety
  • ESLint: Code quality enforcement
  • Hot Reload: Instant development feedback
  • Responsive Design: Mobile-first approach

🀝 Contributing

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License. See LICENSE for more details.

πŸ™ Acknowledgments


Built with ❀️ by Vicente Aguilar

About

A professional analytics platform providing real-time cryptocurrency market data, advanced charting, and custom insights. It is designed to help traders and investors make informed decisions in the volatile digital asset market with features like multi-chart dashboards.

Resources

Stars

Watchers

Forks

Contributors