How mhmdsami/globetrotter works
Project type and purpose
• This is a full‑stack web application called “globetrotter”—a trivia game where users sign up, answer location challenges, and see fun facts.
• The repo splits into two clearly delineated parts:
• server/ – a Hono‑based REST API in TypeScript with Prisma (ODM) backed by MongoDB
• www/ – a Next.js 13 (App Router) React frontend with built‑in API routes
File structure
Top level:
• server/
– prisma/schema.prisma → DB schema
– src/index.ts → Hono app entrypoint
– src/routes/{user,challenge,game}.ts → REST endpoints
– src/middlewares → auth & validation
– src/utils → config, db client, seed data loader, transformers
– .env.example → DATABASE_URL, JWT secrets
• www/
– next.config.ts, .env.example → FRONTEND_API_URL, etc.
– src/app → App‑Router pages, layouts, auth vs main sections
– src/app/api/generate‑challenge‑card/route.ts → edge function for card generation
– src/api/*.ts → client wrappers for calling server REST API
– src/components, src/contexts, src/utils → UI building blocks, global styles, context providers
Key insights from README
• Frontend: React + Next.js + TailwindCSS
• Backend: Hono (lightweight, type-safe), Prisma (ODM), MongoDB
• Two processes: npm run dev in server/ and www/
• API documented in Postman
Final advice
• Both runtime flows (HTTP requests) and build/dev tooling (Prisma migrations, seed scripts) if relevant to your audience
• Don’t overthink—maximally decompose into logical layers and services to give a comprehensive yet readable overview