How davidakerlind/harpaviljongen-admin-service works
Harpaviljongen Admin is a staff-facing React app for managing restaurant content and accounts on the public website. Staff sign in, then use routed admin pages to read or change menus and PDFs, opening hours, page visibility, homepage photos, users, and profile settings; they can also review activity and analytics. Pages call the shared API layer, which sends requests to the Harpaviljongen API; authentication supplies and refreshes the login token. The README documents the major capabilities, while sampled page code is incomplete, so uncertain page-to-API wiring is omitted.
Main entry points: index.js API operations · App.jsx Routes and access · AppLayout.jsx Navigation layout · AuthContext.jsx Auth context
Components 22
App and access
- Routes and access
src/App.jsx - Navigation layout
src/components/AppLayout.jsx - Auth context
src/auth/AuthContext.jsx - Login
src/pages/LoginPage.jsx
Website content
- Menus and PDFs
src/pages/MenusPage.jsx - Shared menu lists
src/menus/MenuListsContext.jsx - Opening hours
src/pages/OpeningHoursPage.jsx - Site page settings
src/pages/PagesPage.jsx - Homepage photos
src/pages/HeroPage.jsx - Image preparation
src/utils/hero.js
Insights and overview
- Overview widgets
src/pages/OverviewPage.jsx - Widget registry
src/components/dashboard/registry.js - Statistics
src/pages/StatisticsPage.jsx
Accounts and activity
- Change log
src/pages/ActivityPage.jsx - User administration
src/pages/UsersPage.jsx - Profile settings
src/pages/ProfilePage.jsx
API integration
- API operations
src/api/index.js - HTTP client and token
src/api/client.js - Harpaviljongen API
- Restaurant website
- Cloudflare traffic data
Other components
- Restaurant staff
Connections 24
- Restaurant staff → Routes and access: opens admin
- Routes and access → Auth context: checks access
- Routes and access → Navigation layout: routes signed-in
- Navigation layout → Restaurant staff: presents navigation
- Navigation layout → Shared menu lists: provides shared lists
- Overview widgets → Widget registry: uses widget definitions
- Menus and PDFs → Shared menu lists: reads and reloads
- Login → Auth context: submits credentials
- Auth context → API operations: verifies and updates session
- Overview widgets → API operations: loads and saves widgets
- Statistics → API operations: requests analytics
- Change log → API operations: loads and clears log
- Menus and PDFs → API operations: manages menus and PDFs
- Shared menu lists → API operations: loads menu lists
- Opening hours → API operations: reads and saves hours
- Site page settings → API operations: reads and saves settings
- Homepage photos → Image preparation: prepares uploads
- Homepage photos → API operations: manages photos and settings
- User administration → API operations: manages user accounts
- Profile settings → API operations: updates account
- API operations → HTTP client and token: issues requests
- HTTP client and token → Harpaviljongen API: sends authenticated requests
- API operations → Restaurant website: checks site response
- Cloudflare traffic data → Harpaviljongen API: provides traffic data