How worldfishcenter/tracks-explorer works
Project type and purpose
• This is a full-stack, single-page web application (“PESKAS Tracks Explorer”) for viewing and analyzing vessel-tracking data on an interactive map.
• The frontend is built with React (TypeScript), Vite, and Mapbox GL. The backend is an Express.js server (for local/dev) and a set of Vercel Serverless Functions (for production), persisting data in MongoDB.
File structure
• Top-level:
• src/ – React app source
• public/ – static assets (favicon, manifest, service worker)
• server/ – Express server entry point for local development
• api/ – Vercel Serverless Function handlers (e.g. api/auth/login.js)
• scripts/, docs/, config files (tsconfig, vite.config, eslint.config, .env.example)
• Patterns:
• src/api – client-side API service wrappers
• src/components, src/pages, src/layouts – React component hierarchy (map, dashboard, login)
• src/hooks, src/contexts – state management (AuthContext, custom hooks)
• src/i18n – localization support
• Configuration: package.json scripts to run dev:all (Vite + Express concurrently), dev:server (Express only), and deploy via Vercel.
README insights
• Confirms two servers: Vite frontend (port 5173) + Express backend (port 3001) in dev.
• Production uses Vercel Hosting: static build for frontend, Serverless for API.
• MongoDB authentication (using IMEI as username), Mapbox token for maps.
Final recommendations
• Don’t omit details like environment‐variable configuration or build process (Vite build → static bundle).