How dumbwareio/dumbpad works
Main Components
• Client (Frontend): Represented by the files in the “public” directory. This includes HTML pages (index.html, login.html), CSS (styles.css), vanilla JavaScript (app.js and various manager scripts like operations.js, cursor-manager.js, etc.), and the service-worker.js for PWA support.
• Server (Backend): The central Node.js/Express application defined in server.js. This component handles routing, API endpoints, auto-saving logic, PIN verification, and middleware for CORS, cookie parsing, and rate limiting.
• File-based Storage: The "data" directory (mentioned in the README) where notes’ content (stored in .txt files) and metadata (notepads.json) are persisted. Emphasize that this is critical for data persistence and must not be deleted during updates.
• Docker & Deployment Infrastructure: Incorporate Dockerfile, docker-compose.yml, and related configuration files (e.g., .env.example, nodemon.json) indicating containerized deployment and environment-specific configurations.
• Supplemental Scripts: Include additional scripts (found in the “scripts” directory) that are used for tasks such as generating PNGs, creating a PWA manifest, and managing CORS settings.
Relationships and Interactions
• If using Docker, illustrate the containerization: a Docker container running the Node.js application, with a volume mapping to the “data” directory to persist notes.
• Optionally, represent external services such as rate limiting middleware and security (e.g., Express security middleware) within the backend component.
Architectural Patterns and Design Principles
• Separation of Concerns: Emphasize that the client (static assets and browser-side logic) is kept distinctly separate from the server’s API logic.
• Service Containerization: Illustrate how Docker encapsulates the entire application and ensures environment consistency across deployments.
• File-based Persistence: Unlike traditional relational databases, the architecture relies on simple file I/O for note storage, which should be clearly noted.