How 841723/locatopedia works
Project type and purpose
• Type: Full-stack web application
• Purpose: A wiki-style article platform with geospatial tooling (“dggs”) and OAuth-based user accounts.
• Key stacks: React/Vite on the front end; Node.js/Express on the back end; a Python microservice for DGGS tools; PostgreSQL for persistence; Docker Compose for orchestration; Nginx for static hosting.
Top-level components
• Client (Browser)
• Frontend container (“www”):
• Vite dev server (dev mode) or
• Nginx + static assets (prod mode)
• Backend container (“api”): Node.js/Express
• DGGS microservice container (“dggstools”): Python/Flask
• Database container: PostgreSQL
• Data volume: DB dumps and backups
• External services: Google OAuth, Locatopedia API
Relationships & data flows
• Browser ←→ Frontend
• User navigates pages, invokes searches, submits articles.
• Frontend → Backend (REST/JSON)
• Authentication calls (Google OAuth redirect)
• Article CRUD endpoints (/routes_wiki*)
• DGGS processing requests (/routes_dggs*)
• Backend ↔ PostgreSQL
• SQL scripts and migrations (init_tables.sql, sql-examples/*)
• Persistent storage of articles, versions, users, metadata
• Backend → DGGS microservice
• HTTP calls to app.py endpoints in services/dggstools
• Backend → External OAuth
• Google OAuth flow via googleOAuth.js
• Backend → Locatopedia
• Geospatial lookups via locatopedia.js
Architectural patterns & design principles
• Layered architecture: Presentation (React) → API (Express) → Data (PostgreSQL)
• Microservice: DGGS tooling is isolated in its own service/container.
• 12-factor app + containerization: each major component in its own Docker container.
• Context + hooks in front end: global state managed via React Context (src/context/*), reusable fetch hooks (src/hooks/useFetch.jsx).
• Environment-driven configuration: .env.example in both frontend/backend; Docker Compose for orchestration (compose.yml files).
Final checklist
• [ ] Label every container/service, port, and endpoint
• [ ] External dependencies clearly separated
• [ ] Note the development vs. production variants (Vite dev server vs. Nginx)