How armanshaikh-2001/nextincare works
Project type and purpose
• NextInCare is a browser-based clinic assistant web app. There is no traditional backend API or cloud database: all data lives in the browser (IndexedDB) and the app is served as static files (HTML/CSS/JS) from a simple static server.
File structure
• Top-level files:
• index.html, booking.html, queue.html – three entry points/pages
• css/ – styles.css (core styles), themes.css (light/dark themes)
• js/ – four ES modules:
• db.js – all IndexedDB interactions
• booking.js – logic for the appointment form
• queue.js – logic to fetch and render the live queue
• ui.js – theme toggle and general UI utilities
• assets/logo.svg – static asset
• No server-side code; deployment is “npx serve” or “live-server.”
README for additional insights
• Tech stack: HTML, CSS, JavaScript (ES Modules), IndexedDB, Static Server
• Data flow: patient fills form → auto-ID/time → saved to IndexedDB → slip displayed → queue board reads from IndexedDB
• Future: admin dashboard, PDF/print, PWA, etc.
Main components
a. Static File Server
• Serves HTML, CSS, JS, assets over HTTP(S)
b. Web Browser / Client
• UI Layer (HTML pages + CSS, themes)
• JS Module Layer: booking.js, queue.js, ui.js, db.js
• Local Storage: IndexedDB (“HealthHavenDB”)
c. User (Patient)
• Interacts via browser UI
Relationships and data flows
• Browser requests index.html/booking.html/queue.html from Static Server
• HTML loads CSS (styles.css, themes.css) and JS modules (ES import chain)
• booking.js → calls db.js → writes record to IndexedDB
• ui.js renders booking slip with appointment details
• queue.js periodically queries db.js → reads all upcoming appointments → renders live queue board
• ui.js handles theme toggles/user interactions (light/dark mode)
Architectural patterns and design principles
• Module separation: Data access (db.js) vs. business logic (booking.js, queue.js) vs. UI concerns (ui.js)
• Single-page modules per HTML entry point (lightweight MVC within each page)
• Client-side persistence via IndexedDB—no remote database or server-side logic
Technologies and frameworks
• HTML5, CSS3 (with theme switching)
• Vanilla JavaScript ES Modules
• IndexedDB API for local persistence
• serve / live-server for static hosting
• Clear, self-explanatory component labels