How davidakerlind/harpaviljongen-db-api works
Harpaviljongen API is a MongoDB-backed restaurant content and administration backend. Website and admin clients call the Express API: public reads serve menus, wine lists, hours, events, PDFs, hero slides, and site configuration; authenticated admin writes manage that content and user accounts. The graph follows server mounts and the sampled authentication and PDF routes; unsampled route-to-controller and controller-to-model wiring is not inferred. Cloudinary upload behavior and the hero settings/image service are shown where source supports them.
Main entry points: server.js Express server · cloudinaryService.js File uploads · menuPdfController.js PDF operations · menuPdfRoutes.js Menu PDF routes
Components 30
API runtime
- Express server
server.js
Restaurant content
- Menu routes
routes/menuRouter.js - Wine routes
routes/wineListRouter.js - Menu list routes
routes/menuListRouter.js - Menu PDF routes
routes/menuPdfRoutes.js - Opening hours routes
routes/openingHoursRouter.js - Event routes
routes/eventRouter.js - Hero image routes
routes/heroRouter.js - Site config routes
- Site settings routes
routes/siteSettingsRouter.js - PDF operations
controllers/menuPdfController.js - PDF records
models/MenuPdf.js - Menu list records
models/menuList.js - Hero slides/settings
services/heroService.js - Hero image records
models/heroImage.js - Site settings records
models/siteSettings.js
Administration
- Authentication routes
routes/authRouter.js - User routes
routes/userRouter.js - Authentication operations
controllers/authController.js - User management
services/userService.js - User records
models/user.js
Activity and analytics
- Activity routes
routes/activityRouter.js - Analytics routes
routes/analyticsRouter.js - Activity logging
services/activityService.js - Analytics
services/analyticsService.js
External services
- MongoDB
- Cloudinary
- Cloudflare analytics
services/cloudflareAnalytics.js - File uploads
services/cloudinaryService.js
Other components
- Website and admin
Connections 27
- Website and admin → Express server: send API requests
- Express server → Menu routes: mounts
- Express server → Wine routes: mounts
- Express server → Menu list routes: mounts
- Express server → Menu PDF routes: mounts
- Express server → Opening hours routes: mounts
- Express server → Event routes: mounts
- Express server → Hero image routes: mounts
- Express server → Site config routes: mounts
- Express server → Site settings routes: mounts
- Express server → Authentication routes: mounts
- Express server → User routes: mounts
- Express server → Activity routes: mounts
- Express server → Analytics routes: mounts
- Menu PDF routes → PDF operations: dispatches
- PDF operations → PDF records: reads/writes
- PDF operations → Menu list records: checks menu types
- Menu PDF routes → File uploads: uploads middleware
- PDF operations → File uploads: uploads/deletes files
- File uploads → Cloudinary: stores files
- Hero slides/settings → Hero image records: reads/writes
- Hero slides/settings → Site settings records: reads/writes
- Authentication routes → Authentication operations: dispatches
- Authentication operations → User management: manages accounts
- Authentication routes → File uploads: avatar upload middleware
- Authentication operations → File uploads: uploads avatars
- File uploads → Cloudinary: stores files