How paramsingh77/findnearme works
Project Type and Purpose
• This is a full-stack “Find Near Me” web application.
• Frontend is a React SPA (bootstrapped with Create React App) using Leaflet for maps.
• Backend is a Flask service exposing REST endpoints to fetch nearby restaurants, hospitals, gas stations, etc., based on CSV data and external APIs (e.g., Google Places).
File Structure
• Top-level:
• backend/ – Flask app.py, CSV and text data files.
• public/, src/ – React static assets, components, entry point (src/index.js).
• setupProxy.js – dev proxy forwarding /api calls to Flask.
• karrik_fonts-main/ & fonts/ – font assets (styling support).
• React source under src/components and src/subComponents follows a UI-component hierarchy (LandingPage, Map, Header, modals, lists).
• Backend data store is flat files (CSV) with no DB; Flask routes load/process them and return JSON.
README Insights
• Multiple screenshots showing pages: landing, listings, modals, map overlays.
• README confirms frontend/backend separation and working demos.
Main Components & Relationships
a. Frontend (React)
– Browser runs React SPA, renders UI, handles user input (location selection, category filters).
– Map component uses Leaflet, retrieves map tiles from an external tile service (OpenStreetMap).
– HTTP layer (fetch/axios) calls backend endpoints under /api.
b. Backend (Flask)
– Exposes REST routes (e.g., /api/restaurant, /api/hospital, /api/gas).
– Reads CSV/text data files for place IDs or coordinates.
– Optionally calls Google Places API for detailed info.
– Returns JSON payloads.
c. Data Sources
– CSV files under backend/ (e.g., Food1.csv, Hospital.csv).
– Generated data.json or data.txt from preprocessing scripts (n.py).
d. External Services
– Map tile server (e.g., https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png).
– Google Places API (for detailed place info).
Architectural Patterns & Design Principles
• Client-Server: clear separation of concerns.
• RESTful API: backend acts as stateless microservice.
• Proxy Pattern in dev: setupProxy.js to avoid CORS.
• Flat-file data service: no heavy DB layer, lightweight JSON responses.
• Component-based UI: React components & subcomponents enforce modularity.