How bradleylund/passportpalsd3react works
Project Type and Purpose
• PassportPals is a client‐side, single‐page web application built with React.
File Structure
Top‑Level Files
• package.json / package-lock.json: Node.js dependencies and build scripts.
• postcss.config.js, tailwind.config.js: CSS build pipeline.
• README.md: High‑level description.
public/
• Static assets served at runtime:
– index.html (entry point)
– countries‑land‑10km.geo.json (map geometry)
– passport-index-tidy-iso3.csv (visa data)
– manifest.json, robots.txt, CNAME
src/
• React components and styling:
– index.js → App.js → component tree
– ChoroplethMap.js, LeafLetMap.js (map rendering)
– SelectComponent.js, SelectBoxComponent.js, ParentComponentSelectAndMap.js (UI controls + state)
– VisaRequirementsTable.js (data table)
– App.css, index.css
Build & Test
• App.test.js, setupTests.js, reportWebVitals.js
Extract Additional Insights from README
• No mention of a separate backend or external API → all data is pre‐packaged in public.
• And table visualizations drive the core user experience.
Main Components and Their Interactions
a. Client / Browser
– Hosts the React application.
– Downloads HTML, JS bundle, CSS, geoJSON, CSV.
b. Static File Server / CDN
– Serves public assets (index.html, JS bundles, data files).
c. React Frontend
– App Shell (App.js)
– State container (ParentComponentSelectAndMap)
– UI Components:
• SelectComponent(s) for origin/friend country
• ChoroplethMap / LeafLetMap for map visualization
• VisaRequirementsTable for tabular display
d. Data Sources (All local assets)
– CSV (visa requirements)
e. Build Toolchain (Dev / CI)
– Node.js / npm scripts (build, test)
– PostCSS / TailwindCSS for styling
Architectural Patterns & Design Principles
• Component‐based UI: each visual or control element lives in its own React component.
• Unidirectional data flow: ParentComponent holds selected countries in state → passes props down to Map and Table → UI updates on user interaction.
• Static‐first deployment: no runtime backend; ideal for GitHub Pages or any static‐site host.