Skip to content

digithun/jamplay-nap

 
 

Repository files navigation

Commitizen friendly

Maintainer

Clogii Start Server

npm run import-seed
npm run up

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

# Ping service
open http://localhost:3000/ping

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

  • Login/Logout with Facebook from React Native.
  • Login/Logout with Facebook from NextJS.
  • Link/Unlink with Facebook from NextJS

DOING

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

About

[WIP] NextJS + Apollo + PassportJS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 53.0%
  • JavaScript 44.9%
  • Shell 1.4%
  • Dockerfile 0.7%