How theolalande/pin-it works
Project Type and Purpose
• Full-stack web application built with Next.js 14 and TypeScript.
• Purpose: a PWA for sharing geolocated points of interest (“Pin-It”) with interactive maps, image upload, comments, favorites, offline mode and accessibility compliance.
• Backend is provided by Supabase (Auth, PostgreSQL database, Storage) via Next.js API routes.
File Structure Analysis
• src/app – Next.js App Router:
– api/… – serverless API routes (auth, pinpoints, comments, favorites, users, upload, health).
– components/… – UI components organized by feature (Map, PinPoint, ImageUploader, FullScreenImageModal, MyPinPoints, Searchbar, Settings, Common).
– contexts/, hooks/, store/ – React Context for auth, custom hooks (useAuth, useFavorites, useImageUpload…), Zustand store for client state.
– layout.tsx, page.tsx – root layout and entry points.
• src/lib/database.ts – Supabase client initialization.
• public/ – static assets, PWA manifest, service worker, map styles.
• utils/ – helper functions (security, accessibility, image processing, map utilities).
• test/ – unit, integration and security tests (Vitest).
• Configuration & deployment – Dockerfile, .github/workflows for CI & preview, Vercel recommended, .env example.
Key README Insights
• Core tech: Next.js App Router, React Leaflet, Tailwind CSS, Supabase, PostgreSQL, Storage.
• PWA features: offline caching (service worker), manifest, install prompt.
• Security layers: rate-limiting, sanitization, OWASP best practices, server-side/client-side validation.
• Accessibility: WCAG 2.1 compliance.
• Testing: Vitest for unit, integration, security and accessibility tests.
– Client components (blue)
– Server/API (green)
– BaaS (orange)
– External services (gray)
• Related elements in zones (e.g., “Next.js Runtime”, “Supabase Platform”, “User’s Browser”).
• Notes on PWA capabilities (offline cache, install prompt) and security layers (rate-limiting, validation).