How tonniewalker/pawpal works
PawPal is a local-first PWA for caring for a virtual dog. The main workflow is adoption, timestamp-based status decay, daily care that earns experience, and viewing the resulting mood, growth, and care history. Settings support renaming, time simulation, and reset. The sampled code establishes the app’s state, routing, persistence, and core care logic; other subsystem links are included only where the README or source index documents them.
Main entry points: App.jsx App state and routes · dogLogic.js Dog rules and time · Home.jsx Home and care · main.jsx App entry
Components 16
App and navigation
- App entry
src/main.jsx - App state and routes
src/App.jsx - Bottom navigation
src/components/BottomNav.jsx - Service worker registration
src/sw-registration.js
Care lifecycle
- Adoption screen
src/pages/Adopt.jsx - Home and care
src/pages/Home.jsx - Care diary
src/pages/Diary.jsx - Settings
src/pages/Settings.jsx - Dog rules and time
src/dogLogic.js - Care configuration
src/config.js
Dog and interface
- Time-based scene
src/components/DogScene.jsx - Mood dog artwork
src/components/Dog.jsx - Status bars
src/components/StatBar.jsx
Local persistence
- Storage adapter
src/storage.js - Browser localStorage
Other components
- User
Connections 21
- User → App entry: opens
README.md - App entry → App state and routes: mounts
src/main.jsx - App entry → Service worker registration: registers
src/main.jsx - App state and routes → Storage adapter: loads and saves
src/App.jsx - Storage adapter → Browser localStorage: reads and writes
src/storage.js - App state and routes → Dog rules and time: calculates care state
src/App.jsx - Dog rules and time → Care configuration: uses rules
src/dogLogic.js - App state and routes → Adoption screen: shows before adoption
src/App.jsx - App state and routes → Home and care: routes care view
src/App.jsx - App state and routes → Care diary: routes diary view
src/App.jsx - App state and routes → Settings: routes settings view
src/App.jsx - App state and routes → Bottom navigation: renders navigation
src/App.jsx - Home and care → Dog rules and time: derives mood and level
src/pages/Home.jsx - Home and care → Time-based scene: renders scene
src/pages/Home.jsx - Home and care → Status bars: renders status bars
src/pages/Home.jsx - Time-based scene → Mood dog artwork: renders dog
src/components/DogScene.jsx - Time-based scene → Dog rules and time: gets time of day
src/components/DogScene.jsx - Care diary → Care configuration: uses care actions
src/pages/Diary.jsx - Care diary → Dog rules and time: uses day duration
src/pages/Diary.jsx - Settings → App state and routes: invokes settings actions
src/App.jsx - Adoption screen → App state and routes: submits adoption
README.md