This is the type-safe frontend SSR boilerplate using nextjs, preact, typescript and firebase.
- support refreshing token on server when token is expired.
- serving on serverless platform because we use firestore as a session store.
using preact for minimizing a bundle size// I will fix bug currently- support monorepo and we use nest.js as backend framework
- support ionic react for PWA and native app using capacitor
-
prepare firebase project
-
save client key as
firebase.client.key.json
in packages/web and packages/web-graphql and packages/app/src/firebase -
save admin key as
firebase.admin.key.json
in packages/web and packages/web-graphql and packages/backend -
prepare dotenv in packages/web and packages/backend and packages/web-graphql
> cp .env.tmpl .env
- replace a value of
FIREBASE_CLIENT_API_KEY
to active key.
Package | Localhost | Prodction |
---|---|---|
[next.js] web | http://localhost:3000 | web.* |
[nestjs] backend | http://localhost:3001 | backend.* |
[ionic] app | http://localhost:3002 | app.* |
[nestjs] gql-server | http://localhost:3003 | backend-graphql.* |
[electron] electron | http://localhost:3004 | native app |
[next.js] web-graphQL | http://localhost:3005 | graphQL supported web app |
[next.js] web-swr | http://localhost:3006 | swr supported web app |
[next.js] web-antd | http://localhost:3007 | antd supported web app |
# install npm packages
$ yarn
# build deps
$ yarn build
# run web and backend by a commnad
$ yarn start
# web run
$ yarn workspace @abyssparanoia/web start:dev
# backend run
$ yarn workspace @abyssparanoia/backend start:dev
# ionic run
$ yarn workspace @abyssparanoia/app start:dev
# electron run
$ yarn workspace @abyssparanoia/electron start:dev