[Deprecated] NextJS + Apollo + PassportJS
[WIP] NextJS/ApolloJS/PassportJS Build in Next JS for SSR, Apollo Client for GraphQL, Passport JS for authentication, Docker for development and production.
○ 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
Redis
.GraphQL
types from Mongoose
with resolvers.node_modules
.email
/password
login.Copy from
.env.example
template and.env
as you wish
cp .env.example .env
# 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
VSCode
and press F5 to attach
with nodejsChrome Dev Tool
# Will kill all and tear down
npm run down
# Will dive into container
npm run in
# Will pull image and run with docker compose (won't build)
npm run up
# 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
Facebook
from React Native.Facebook
from NextJS.facebook-token
with auth/facebook
user.facebook-token
with auth/email
user.Facebook
via React
web.README
as github page.Redis
fail test.MongoDB
fail test.graphql-compose
.Passport
test.MongoDB
replication docker exec -it node1 mongo --eval "rs.initiate()"
docker-compose -f docker-compose.yml -f production.yml up -d
lvm-direct
Redis
session store.SSH
.Nginx
TLS container : https://github.com/rabbotio/nginx-certbot