Add web platform with PWA support via universal adapter architecture #1
+3,489
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ports Dyad to run as a Progressive Web App while maintaining full Electron desktop compatibility. Same codebase, dual deployment targets.
Architecture
Universal Adapter Pattern: Platform-agnostic interfaces abstract Electron vs. web differences.
Platform Detection:
src/lib/platform.ts-isElectron()/isWeb()runtime detectionImplementation
Adapters (711 LOC)
Backend (230 lines)
src/server/index.ts): REST endpoints at/api/:method, WebSocket at/ws/:channelPWA (193 lines)
src/web/service-worker.ts): Network-first caching, auto-updatespublic/manifest.json): App metadata, icons, install configsrc/components/PWAInstallPrompt.tsx): Native install promptDeployment
Four deployment modes configured:
docker-compose.web.yml(includes PostgreSQL, Nginx)vercel.json(serverless functions)nginx.conf(reverse proxy, SSL)Browser Support
Files Added
Core: 8 implementation files (711 LOC)
Config: 9 deployment configs
PWA: 3 asset files
Docs: 5 guides (847 LOC)
Key:
vite.config.web.ts,Dockerfile.web,src/adapters/*,src/server/*,src/web/*Breaking Changes
None. Desktop Electron app unchanged and fully compatible.
Dependencies Added
Backend:
express,ws,helmet,cors,compressionBuild:
vite-plugin-pwa,tsxOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.