How marubharuch/vodir works
Project Type and Purpose
• This is a single‐page, Progressive Web App built with React, Vite and Tailwind.
• It manages authentication and user profile entirely in the browser using React Context + localForage (IndexedDB).
• No external backend/API—offline first with persisted state.
File Structure
• Top‐level config files: vite.config.js, package.json, eslint.config.js.
• public/: PWA manifest.json (installable web app).
• src/
• main.jsx, index.html: app entry & shell
• src/context/: AuthContext.jsx & ProfileContext.jsx (state management)
• src/hooks/useLocalDb.js + src/localDb.js: persistence abstraction
• src/pages/: route targets (Home, Login, Registration, FamilyTree, etc.)
• src/components/: reusable UI (Navbar, Carousel, SyncButton, etc.)
• src/data/: static assets (carouselData, fa.json)
• src/housie/: game admin/user UI
README
• Confirms core concepts:
• AuthContext: login/logout via localForage (IndexedDB)
• ProfileContext: profile persistence
• Protected routing with PrivateRoute
• Hooks mandatory, contexts wrap App routes
Main Components & Boundaries
a. Browser Environment
• Service Worker / PWA Host (caching static assets)
• IndexedDB (via localForage)
b. Application Shell
• index.html + manifest.json + JS bundles served by Vite
c. React SPA
• App.jsx: root component
• React Router: route definitions & PrivateRoute
d. State Management
• AuthContext Provider
• ProfileContext Provider
• Hooks layer (useAuth, useProfile, useLocalDb)
e. UI Layer
• Pages (LoginPage, HomePage, FamilyPage, FamilyTree, Boards, RegistrationPage, HousieAdmin, HousieUser)
• Shared Components (Navbar, BottomNav, Carousel, CardList, SyncButton, InstallButton, etc.)
f. Persistence Layer
• localDb.js abstraction → localForage → IndexedDB
Relationships & Data Flows
• User interacts with UI Components → triggers React state updates or context actions (login, logout, updateProfile).
• Context actions call useLocalDb → localDb.js → localForage API → IndexedDB.
• React Router enforces protected routes via PrivateRoute (reads AuthContext).
• PWA “Install” uses InstallButton hooking into browser beforeinstallprompt.
• Static assets (favicon, manifest.json) served by Vite dev-server / production host.
Architectural Patterns & Principles
• Single‐page component hierarchy (container/pages vs. presentational/components).
• Context + custom hooks for state & side‐effect encapsulation.
• PWA caching & installability.
• Separation of concerns: UI, state, persistence.