How sooluh/kodepos works
Main Components
a) API Layer
• REST API endpoints (/search and /detect)
• Fastify server framework (evident from types/fastify)
b) Controller Layer
• Search Controller
• Detect Controller
• Home Controller
c) Data Layer
• Static JSON Data Store (data/kodepos.json)
d) Helper Layer
• Kodepos Helper
• Specification Helper
┌─────────────────────────────────────────────────────┐
• Client Requests │
• ┬─────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────┐
• API Gateway │
• (Vercel/Koyeb/Render Deployment) │
• ┬─────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────┐
• Fastify Server │
• ┌───────────────┬──────────────┬───────────┐ │
• Routes │ Core │ Types │ │
• ┬───────┴──────────────┴───────────┘ │
• ┼───────────────────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────┐
• Controllers │
• ┌──────────┐ ┌─────────┐ ┌──────────┐ │
• Search │ │ Detect │ │ Home │ │
• ┬─────┘ └────┬────┘ └────┬─────┘ │
• ┼───────────────┼───────────────┼────────────┘
• ↓ ↓ ↓
┌─────────────────────────────────────────────────────┐
• Helpers │
• ┌────────────┐ ┌─────────────┐ │
• Kodepos │ │ Spec │ │
• ┬──────┘ └──────┬──────┘ │
• ┼─────────────────┬┼─────────────────┘
• ↓ ↓│
┌─────────────────────────────────────────────────────┐
• Data Store │
• (kodepos.json) │
• ┘
Important Elements to Highlight
a) Request Flow:
• How requests flow from client through API gateway
• Routing to appropriate controllers
• Demonstrate data access patterns
b) Deployment Options:
• Supported deployment platforms (Vercel, Koyeb, Render)
• How they interact with the core application
c) Data Flow:
• How search queries are processed
• How coordinate-based detection works
• Demonstrate response formatting
Technical Details
• Node.js runtime requirement (>= 20.x)
• TypeScript compilation flow
• Development vs Production modes
• Static file serving mechanism