# PWA (Progressive Web App) Setup {#pwa-progressive-web-app-setup}


Configure Ever Gauzy as a Progressive Web App.


## Overview {#overview}


A PWA provides:

- Offline access to cached pages
- Install to home screen
- Push notifications
- Background sync


## Angular PWA Setup {#angular-pwa-setup}



### 1. Add Service Worker {#1-add-service-worker}


```bash
ng add @angular/pwa --project=gauzy
```

This generates:

- `manifest.webmanifest`
- `ngsw-config.json`
- Service worker registration in `app.module.ts`


### 2. Configure Manifest {#2-configure-manifest}


```json
{
  "name": "Ever Gauzy",
  "short_name": "Gauzy",
  "theme_color": "#3366FF",
  "background_color": "#FFFFFF",
  "display": "standalone",
  "scope": "/",
  "start_url": "/",
  "icons": [
    {
      "src": "assets/icons/icon-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "assets/icons/icon-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ]
}
```


### 3. Cache Strategy {#3-cache-strategy}


```json
{
  "index": "/index.html",
  "assetGroups": [
    {
      "name": "app",
      "installMode": "prefetch",
      "resources": {
        "files": ["/favicon.ico", "/index.html", "/*.css", "/*.js"]
      }
    },
    {
      "name": "assets",
      "installMode": "lazy",
      "resources": {
        "files": ["/assets/**"]
      }
    }
  ],
  "dataGroups": [
    {
      "name": "api",
      "urls": ["/api/**"],
      "cacheConfig": {
        "maxSize": 100,
        "maxAge": "5m",
        "strategy": "freshness"
      }
    }
  ]
}
```


### 4. Build for Production {#4-build-for-production}


```bash
yarn build --configuration production
```


## Testing {#testing}


```bash
# Serve built app (service workers only work over HTTPS or localhost)
npx http-server dist/apps/gauzy -p 8080
```


## Related Pages {#related-pages}


- [Frontend Architecture](https://sourcey-gauzy.pages.dev/architecture/frontend-architecture/index.md) — architecture
- [Production Deployment](https://sourcey-gauzy.pages.dev/devops/production-deployment/index.md) — deployment
