.
βββ README.md
βββ config
β βββ default.example.json
βββ css
β βββ common.css
βββ index.html
βββ login.html
βββ package.json
βββ src
β βββ π» server
β β βββ constants.ts
β β βββ logger.ts
β β βββ middlewares.ts
β β βββ server.ts
β β βββ types.ts
β βββ π web
β βββ index.ts
β βββ service-worker.ts
βββ tsconfig.json
βββ tsconfig.server.json
βββ tsconfig.web.json
βββ yarn.lock
- Server
- src/server/server.ts: server entry code
- Web page
- src/web/index.ts: page script
- src/web/service-worker.ts: service worker script
- Pre-requirements
-
= Node 16
- yarn
npm i -g yarn
-
- create vapid key pairs
yarn generate-vapid-keys
- create
config/default.json
(check config/default.example.json){ "gcmKey": "GCM API Key HERE", "subject": "mailto:your@domain.com", "vapid": { "public": "PUBLIC KEY HERE", "private": "PRIVATE KEY HERE" } }
- How to get GCM API key?
- Visit Google Firebase Console and create project
- Open Project > Project settings > Cloud Messaging
- Cloud Messaging API >
Server Key
- How to get GCM API key?
- setup project
# Install dependencies yarn # Build scripts (TS -> JS) yarn build # Start demo server yarn start
Done! visit http://localhost:8080