How karanunique/cryptohub works
Project type and purpose
• CryptoHub is a modern, single-page, full-stack web application built with React and Vite.
• It has no custom backend server code; instead it relies on serverless services (Firebase Authentication, Firestore or Realtime DB) and a third-party market data API (CoinGecko).
• Its purpose is to provide users with real-time cryptocurrency prices, interactive charts, user authentication, a personalized dashboard (portfolio, leaderboard), educational blogs, and subscription-based pricing plans.
File structure
• Top level:
• Dockerfile/docker-compose.yml & DOCKER_SETUP.md – containerized development environment.
• vite.config.js, index.html – Vite build config & HTML template.
• README.md, docs/ – documentation and design guides.
• /public – static assets (logo, favicon).
• /src – core application code:
• /components – reusable UI components (Navbar, Footer, charts, forms, PrivateRoute).
• /pages – route-level views (Home, Coin detail, Dashboard) organized in subfolders.
• /context – React Context providers (AuthContext, CoinContext, ThemeContext, ActivityContext, LeaderboardContext).
• /utils – helper modules (api calls, storage, notifications).
• firebase.js – Firebase initialization.
• Configuration files (.env.example, .nvmrc, tailwind.config.js, postcss.config.js, eslint.config.js) confirm a front-end-centric tech stack.
Elements
• Clear labels: “User Browser,” “React SPA (Vite),” “Firebase Auth,” “Firestore,” “CoinGecko API,” “Vercel Hosting,” “GitHub Actions.”
• Asset fetch (Browser ← Vercel)
• API calls (SPA → CoinGecko; SPA → Firebase Auth/DB)
• Auth token flow (Firebase → SPA)
• CI/CD flow (GitHub → Actions → Vercel).
• Blue rectangles for client-side (SPA, components, contexts).
Details
• Context Provider as a sub-component of the SPA.
• Related UI pages under the SPA block.
• Which utils handle which API calls (e.g., newsService.js → CoinGecko).
• Protected routes (PrivateRoute) and where JWT/session tokens are stored (storageManager.js).
• Don’t over-segment. Focus on logical layers: UI, state, API, services, hosting & CI/CD.