How dayschedule/dayschedule-widget works
Project Type and Purpose
• This is an open-source embeddable JavaScript/CSS widget library (published on NPM and CDN).
• It provides two UI modes (popup and inline) for embedding a scheduling calendar on any website.
• It delegates actual booking logic to a remote Dayschedule.com backend and bridges third-party meeting integrations (Google Meet, Zoom, MS Teams).
Main Architectural Components
a. Developer & CI Environment
• Source Repository (GitHub)
• CI Workflows (.github/workflows/playwright.yml) running Playwright tests
• Local tests (tests/popup.spec.ts)
b. Build & Distribution
• Build tool (driven via package.json scripts) compiles/transpiles TS → JS & CSS
• Output artifacts in /dist (dayschedule-widget.js, dayschedule-popup.css, dayschedule-widget.css)
• Published to NPM registry and mirrored on CDNs (jsDelivr, unpkg)
c. Consumer Integration (Host Website)
• HTML page includes <script src=".../dayschedule-widget.js"> and optional <link href=".../dayschedule-popup.css">
• Calls daySchedule.initPopupWidget(...) or uses <dayschedule-widget> custom element to render inline
d. Browser-Side Widget Logic
• Initializes on button click or DOM element detection
• Renders iframe or DOM widgets, applies CSS, listens to user events
• Makes REST/WebSocket calls to Dayschedule backend
e. Remote Scheduling Service
• Dayschedule.com API endpoints for availability, booking, user data
• Integrations with Google Meet, Zoom, MS Teams (OAuth and API calls)
f. CDN / Hosting Infrastructure
• Static assets served from Cloudflare/AWS CloudFront (250+ regions) for low-latency
• Gzip/br compression, WebP images for performance
Relationships & Data Flows
• Developer → Build System: commits trigger CI → runs tests → publishes artifacts
• Build System → NPM/CDN: dist artifacts are published & cached
• Consumer Website → CDN: browser fetches JS & CSS assets
• Browser Widget → Dayschedule API: data flow for schedule lookup and booking
• Dayschedule Backend → Third-Party Services: API calls to calendar/meeting providers
• Feedback loops: error logging or analytics can flow back to Dayschedule backend
Architectural Patterns & Design Principles
• Modular widget: host-agnostic, deferred initialization (lazy loading)
• Separation of concerns: UI rendering in widget, business logic on backend
• Continuous integration: Playwright E2E tests automate cross-browser validation
• Edge-caching: multi-region CDN for global performance
Element Checklist
• Versioning & publishing flow from dev → NPM/CDN → browser
• External dependencies (Google Meet, Zoom, MS Teams)