How dumbwareio/dumbassets works
Project type and purpose
• DumbAssets is a self-contained, full-stack web application:
• Backend: Node.js + Express monolith
• Frontend: Vanilla JavaScript SPA served as static assets
• Data store: JSON files + local filesystem for images/receipts
• Additional behavior: scheduled maintenance & warranty notifications via Apprise
Main components
• Client (Browser/PWA)
– public/index.html + login.html + script.js + service-worker.js
– UI managers (charts, dashboardManager, modalManager, etc.)
– Helper modules (paths, utils, serviceWorkerHelper)
• Server (Node.js/Express)
– Entry point: server.js
– Middleware layer:
· cors.js (CORS)
· demo.js (read-only/demo mode)
· express-rate-limit, helmet, compression, cookie-parser, express-session
– Routing & Controllers: static hosting (public/), API endpoints (assets, auth, file uploads, notifications)
– Service layer (src/services):
· fileUpload: Multer-based upload handling, image/receipt storage, UUID naming
· notifications: Apprise HTTP integration, notificationQueue, warrantyCron (node-cron scheduler)
· render: assetRenderer, listRenderer, previewRenderer (generate HTML snippets or JSON payloads)
• Data Storage
– /data/*.json: Assets.json, SubAssets.json, config.json
– /data/Images, /data/Receipts on disk
• External Services
– Apprise server (via APPRISE_URL) for sending Discord/Telegram/ntfy notifications
• DevOps & Deployment
– Dockerfile + docker-compose.yml for containerization
– .env + .env.example for config
– scripts for PWA manifest and maintenance tests
Relationships & interactions
1. Browser ←→ HTTP(S) → Express server:
• Static assets (HTML/JS/CSS)
• API calls for CRUD on assets, components, tags
• File upload endpoints → fileUpload service → writes to /data/Images or /data/Receipts
2. Server
• Middleware chain processes requests (CORS, sessions, rate-limit, demo mode)
• Routes dispatch to service layer
• Service layer reads/writes JSON files via fs-extra
• Render services build dynamic fragments or data views
3. Scheduler
• node-cron (warrantyCron) triggers at configured intervals
• notificationQueue enqueues notifications → appriseNotifier sends via HTTP
4. Container
• Docker encapsulates server + data volume mount
Architectural patterns & design principles
• Layered architecture: Presentation (static SPA), API, Services, Data
• Modular service separation (fileUpload, notifications, render)
• Middleware pipeline for cross-cutting concerns
• Single-process monolith inside Docker
• Use of JSON files as “lightweight DB”