How chanleeip/koinx-submission works
Main Components
a. External Components:
• CoinGecko API (indicated by CRYPTO_LISTING_ENDPOINT in .env)
• MongoDB Database (indicated by MONGODB_URI)
• Client Applications (API consumers)
b. Internal Components:
• API Layer (Express.js Server)
• Controllers Layer
• Services Layer (including CRON jobs)
• Models Layer
• Utils Layer
Component Organization
[Client Applications] → [API Gateway]
• ↑ ↓
[CoinGecko API] ← [Express.js Server] → [MongoDB]
• ↓
• [Routes Layer]
• ↓
• [Controllers Layer]
• ↓
• [Services Layer]
• ↓
• [Models Layer]
Specific Implementation Details
a. API Routes (from /src/routes/api/v1):
• Version them under /api/v1/
b. Controllers (from /src/controllers):
• GetDeviationdata and getLatestdata controllers
• Them to their respective routes
c. Services:
• Cron_job service separately
• Interaction with external APIs and database
Additional Elements
• Environment configurations
• Supported cryptocurrencies (Bitcoin, MATIC, Ethereum)
• API versioning structure
Specific Notes for This Project
• CRON job component as it appears to be a crucial service
• How the utils layer supports other components
• TypeScript compilation process
• API versioning structure (/api/v1/)