How krithik-m-codes/tripmate works
Project type and purpose
• TripMate is a full-stack web application built with Next.js (App Router), TypeScript, and MongoDB.
• It provides users with trip planning features: authentication, itinerary generation, saved places, maps, weather, and attractions via external APIs (Gemini, OpenWeather, MapBox, TripAdvisor, Pixabay).
File structure
• Top-level config and metadata: next.config.mjs, tsconfig.json, tailwind.config.ts, package.json, .eslintrc.json
• Public assets: public/assets/... (images, logos, SVGs)
• src/app: Next.js App Router pages, layouts, loading states, dynamic API route handlers under /src/app/api
• src/components: UI and website components broken into subfolders (ui primitives, website, skeleton) plus feature-specific cards and panels
• src/context: React context for AuthProvider
• src/hooks, src/lib: client and server utilities (dbConnect, external API wrappers, fetchers, utils)
• src/models & src/schemas: Mongoose models and Zod or Joi schemas for validation
• src/middleware.ts: global middleware
• src/types & src/utils: shared type definitions and helper functions
Extract architectural insights from the README
• NextAuth for authentication, using [...nextauth] route handlers under /src/app/api/auth
• REST-style API endpoints in Next.js route handlers under /src/app/api
• Mongoose connection logic in lib/dbConnect.ts
• External API calls abstracted in lib/weatherService.ts, fetchTravelData.ts, etc.