Taking risks
What did we learn about PWA?
Why PWA?
- Need for a smartphone app
- missing resources in Android team
- Desktop app
- Improve speed of webapp
Is it really an app?
- No
- It's still a website
- But
- Native App icon in the app drawer
- Android
- Windows
- Linux
- Android does actually create a APK and install the PWA
- No browser wrapper
- Forward / Back buttons
- Url input
- ...
- Native App icon in the app drawer
Desktop PWA
export const ArrowBlock = styled.span`
display: none;
flex: 0 0 auto;
@media(display-mode: standalone){
display: inline-block;
margin-top: 3px;
}
`
Steps
- Installation process
- Very critical 🔥
- Improve speed with caching
- Get cache and return
- Get data from backend
- update cache
- Send updated data to client
- update client
- Handle online / offline
- Download plan and assets
- Show downloaded plans on offline
- Insert update data in offline mode
- Sync data
- Sync overview
-
Installation processVery critical 🔥
-
Improve speed with cachingGet cache and returnGet data from backendupdate cacheSend updated data to clientupdate client
Handle online / offlineDownload plan and assets-
Show downloadedplans on offline - Insert update data in offline mode
- Sync data
- Sync overview
Architecture
- Service worker
- All self written
- Handles cache
- Works like a proxy
- Communication via messages
- Database
- IndexedDb wrapper pouchDB
- 100% nice but nearly the only option
Encryption 🔐
- Cache
- Encrypt whole responses with cryptoJS
- Generate crypto password via backend and unique browser key.
- Database
- use pouchDB plugin
- Not possible to make queries on encrypted data
- 2 databases
- 1 for queries (all ids, types, connections)
- 1 for data
Dev troubles
- Dev server with hot reload
- Update serviceworker
- PouchDb update document workflow
- Dev tools
- Cache last change
- Cannot set
- Cannot read
- Cache last change
- Testing changes
Preview desktop app
Questions?
Taking risks
By masterwendu
Taking risks
- 42