How amr-radwan1/ecofind works
Project type and purpose
• Ecofind is a full-stack, serverless web application.
• Frontend: Next.js 13 (App Router) with React/TypeScript and Tailwind CSS.
• Backend services: AWS Amplify (for authentication and any custom Lambdas) and Supabase (Postgres) for data storage.
• External integration: Google Maps JavaScript API for mapping recycling facilities.
File structure
• Top-level: configuration files (Dockerfile, buildspec.yaml, next.config.mjs, tsconfig.json, etc.)
• amplify/…: TypeScript definitions for Auth (Cognito) and Data (Lambda/API Gateway) resources.
• src/app/…: React components and page routes (map, sign-in, sign-up, homepage).
• public/: static assets.
• populateDb.js: script to seed Supabase with facility data.
README
• Confirms required technologies: Node.js, AWS CLI, Supabase, Google Maps API.
a. Main components
• Client Browser (React UI)
• Next.js Serverless Application
• AWS Amplify –
– Authentication (Cognito)
– Custom Data Lambdas (API Gateway + Lambda)
• Supabase (Postgres Database)
• Google Maps API
b. Relationships & interactions
• User ↔ Browser: interacts with React components (Sign-in, Map, FAQ, etc.)
• Browser → Next.js: fetches pages and invokes any server-side functions in getServerSideProps or app routes.
• Next.js ⇄ Amplify Auth: uses Amplify SDK to authenticate users via Cognito.
• Next.js (or direct client-side) → Supabase: queries facility data, saves user preferences.
• Browser → Google Maps API: renders map, markers, geocoding.
• populateDb.js → Supabase: one-time data seeding.
c. Architectural patterns & design principles
• Serverless: no always-on servers, just functions (Amplify Lambdas).
• Separation of concerns:
– UI Layer (React/Next.js)
– Auth layer (Cognito)
– Data layer (Supabase, custom Lambda)
• SSR/SSG via Next.js for performance and SEO.
• Component-based React design.
d. Key technologies & frameworks
• Next.js 13 (App Router)
• React + TypeScript + Tailwind CSS
• AWS Amplify (Auth + Lambda + hosting)
• Supabase (Postgres, REST/Realtime)
• Google Maps JavaScript API
• CI/CD: AWS CodeBuild (buildspec.yaml) or Vercel
Detail
• Data flows clearly with arrowheads.
• Build/deploy pipeline: highlight buildspec.yaml feeding into AWS CodeBuild or Vercel.