<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          nap[Deprecated] NextJS + Apollo + PassportJS

          聯(lián)合創(chuàng)作 · 2023-09-19 00:16

          Commitizen friendly

          nap

          [WIP] NextJS/ApolloJS/PassportJS Build in Next JS for SSR, Apollo Client for GraphQL, Passport JS for authentication, Docker for development and production.

          Overview

          ○ Docker
          ├─ ○ NodeJS
          │  ├─ ○ NextJS
          │  │  ├─ ./pages      : /usr/app/pages
          │  │  ├─ ./components : /usr/app/components
          │  │  ├─ ./lib        : /usr/app/lib
          │  │  ├─ ./routes     : /usr/app/routes
          │  │  └─ ./server     : /usr/app/server
          │  │
          │  ├─ ○ Apollo
          │  │  └─ ./graphql    : /usr/app/graphql
          │  │
          │  └─ ○ PassportJS
          │     └─ ./providers  : /usr/app/providers
          │
          ├─ ○ Redis            : redis://redis
          │  └─ data            : /data
          │
          └─ ○ MongoDB          : mongodb://mongo/graphql
             └─ data            : /data/db
          

          Stacks

          Extras


          Configurations

          Copy from .env.example template and .env as you wish

          cp .env.example .env

          Develop

          # Will build and run then attach with docker compose (it take sometime for first build)
          npm run up-dev
          
          # Try modify files and see the HMR result
          open http://localhost:3000
          
          # Try modify file in ./graphql and see the result via GraphiQL
          open http://localhost:3000/graphql

          Debug

          • Server side : Use VSCode and press F5 to attach with nodejs
          • Client side : Use Chrome Dev Tool

          Addition

          # Will kill all and tear down
          npm run down
          
          # Will dive into container
          npm run in

          Production

          # Will pull image and run with docker compose (won't build)
          npm run up

          Test

          # Will need to run server for integration test (WIP)
          npm run up-dev
          
          # To test all with Jest
          npm run test
          
          # To see coverage
          npm run cover

          Passport (cookie)

          Passport (token via GraphQL)


          Client example

          DOING

          • Optional asking for user from facebook graph query.
          • Link facebook-token with auth/facebook user.
          • Link facebook-token with auth/email user.
          • Unlink Facebook via React web.
          • Handle cookies via React Native

          TODO

          TOTEST

          • Redis fail test.
          • MongoDB fail test.
          • HTTP fail test.
          • HTTPS fail test.
          • Unit test graphql-compose.
          • Basic signin test.
          • Passport test.
          • Sessions expire test.
          • Chaos testing with pumba

          TOCUSTOM

          TOHAVE

          瀏覽 13
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  91福利免费观看 | 麻豆成人久久精品二区三区91 | 久草大香蕉网 | 国产精品成人7777777 | 亚洲精品人妻系列 |