.
βββ 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