Skip to main content

Project Structure

Cesium_App/
├── .env # Local environment variables (gitignored)
├── .env.example # Template for environment variables
├── package.json # Root npm manifest (server dependencies)

├── server/
│ └── server.js # Express server — static serving + all API proxy endpoints

├── client/
│ ├── src/
│ │ └── index.html # Main app HTML (served at /)
│ └── public/
│ ├── js/
│ │ ├── app.js # All frontend application logic (~8,000 lines)
│ │ ├── landing.js # Landing page auth form logic
│ │ └── wikiLinks.js # Doc link helper (inserts ? icons)
│ ├── css/
│ │ ├── styles.css # Main UI stylesheet
│ │ ├── camera-styles.css # Camera info box and modal styles
│ │ └── event-carousel.css# Emergency event image carousel styles
│ ├── images/
│ │ ├── ucf -1.png # UCF logo
│ │ └── UDT_Logo-V01.png # Urban Digital Twin logo
│ ├── data/
│ │ ├── response.json # NY 511 camera data
│ │ ├── SVI_2022_US_county.csv # CDC Social Vulnerability Index
│ │ └── mock_flood_data_snapped.csv # Flood depth point data
│ └── login.html # Standalone login/register page

├── auth/
│ ├── supabase-auth.js # Supabase auth functions (register, login, logout, checkAuthState)
│ └── supabase-config.js # Supabase URL + anon key

├── supabase/
│ ├── schema.sql # Database schema (run once to set up Supabase project)
│ ├── migrate-data.js # Firebase → Supabase data migration script
│ ├── run-migration.js # Migration runner
│ ├── update-html.js # HTML update helper for migration
│ ├── MIGRATION_GUIDE.md # Step-by-step Supabase migration guide
│ └── README.md # Supabase setup notes

├── co2_firebase_utils/
│ ├── export_data.py # Python script to export CO₂ data from Firebase
│ └── service_key.json # Firebase Admin service account (gitignored)

└── geo-lens-docs/ # Docusaurus documentation site
├── docusaurus.config.js
├── sidebars.js
├── docs/ # All documentation markdown files
└── src/
├── css/custom.css
└── pages/index.js

Key File Notes

server/server.js

The single Express server file. It handles:

  • Serving static files from client/src and client/public
  • All API proxy endpoints (see Server API)
  • Firebase Admin initialization (for CO₂ Firestore access)

Static file middleware order matters — files in client/src take priority over client/public:

app.use('/', express.static(CLIENT_SRC)); // index.html served first
app.use('/', express.static(CLIENT_PUBLIC)); // js, css, images, data
app.use('/auth', express.static(AUTH_DIR)); // supabase-auth.js, supabase-config.js

client/public/js/app.js

The entire frontend application (~8,000 lines). All features — map initialization, sidebar logic, data fetching, entity management, drawing tools, analysis filters — live in a single window.onload closure. There is no module bundler; the file is loaded directly via a <script> tag.

auth/supabase-auth.js

Loaded as an ES module (type="module") in index.html. Exports supabase, checkAuthState, loginUser, registerUser, and resetPassword. The main app calls checkAuthState() on load and redirects unauthenticated users to /login.html.