How guinetik/exoplanets-review works
Project Type and Purpose
• Full-stack Single Page Application (SPA)
• Purpose: Display TESS exoplanet data, allow users to browse and leave reviews
• Frontend built with React/Vite, styling via TailwindCSS/Flowbite
• Backend and real-time data store via Firebase
• Data ingestion scripts process NASA API data into JSON
File Structure
Top-Level:
• data/ – ETL scripts & raw/out datasets
• build.js, deploy.js – custom build & deployment scripts
• index.html – SPA entry point
• package.json, vite.config.js, tailwind.config.js – build & styling configs
• src/ – React app: components/, routes/, data/
– components/ – UI building blocks (PlanetCard, StarSystem, modals, etc.)
– routes/ – React Router pages (home, planets, stars, about, apod)
– data/ – client-side data layer (db.js, context.jsx, factories, type definitions)
– App.jsx, main.jsx – root component & bootstrap
– styles/ – global and component CSS
README for Key Insights
• Technologies: Vite, React, TailwindCSS, Flowbite, Firebase
• Data source: NASA Exoplanet Archive + NASA Open API
• Dev flow: npm install + npm run dev
Main Components
a. Data Ingestion Pipeline (offline/pre-build)
– data/raw/*.json & CSV (source files)
– data/exploration.js (transforms & filters)
– data/out/*.json (processed exoplanet data)
– build.js (bundles or automates data processing)
b. Build & Deployment Pipeline
– Vite (module bundler) + TailwindCSS compiler
– deploy.js (uploads build artifacts to hosting, e.g. Firebase Hosting or static server)
c. Frontend SPA
– React Components & Routes
– Context API layer (src/data/context.jsx) provides state and hooks
– UI Library (Flowbite components styled with TailwindCSS)
– CSS (src/styles + tailwind.config.js + postcss.config.js)
d. Backend / Data Store
– Firebase (Authentication? Firestore or Realtime Database)
– src/data/db.js manages read/write of reviews and any user data
e. External Services
– NASA Open API (APOD, additional exoplanet metadata)
– (Optional) Authentication providers if used
Relationships and Data Flows
• Offline Data Flow: raw data → exploration.js → out/*.json → bundled into client
• Build Flow: src/ + out/*.json → Vite → bundle → deploy.js → Hosting
• Runtime Flow:
1. User accesses SPA via browser
2. React Router navigates to a route (e.g. /planets)
3. Component fetches processed data (bundled JSON or on-demand via Firebase Cloud Function if implemented)
4. Component invokes Firebase SDK (src/data/db.js) to:
– Read existing reviews
– Write new user reviews
5. If APOD or other NASA endpoints are requested at runtime, SPA calls NASA Open API directly
• Authentication (if implemented): Users sign in via Firebase Auth
Architectural Patterns and Design Principles
• SPA pattern with client-side routing (src/routes)
• Component-based UI (src/components)
• Context API for global state management
• Separation of concerns: data ingestion (offline), build, runtime
• Infrastructure as code: build.js and deploy.js scripts