next.js with amazon-cognito-auth-js, Redux, redux-form, material-ui
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
credentials initial commit Nov 11, 2017
forms [upgrade] replace part of material-ui components to v1 Aug 9, 2018
hoc [refactor] apply eslint rules Aug 9, 2018
pages [design] add header for the token display Aug 9, 2018
store initial commit Nov 11, 2017
util initial commit Nov 11, 2017
.dockerignore initial commit Nov 11, 2017
.eslintrc.json [refactor] apply eslint rules Aug 9, 2018
.gitignore initial commit Nov 11, 2017
Dockerfile [upgrade] bump up node verision Aug 5, 2018
LICENSE Initial commit Nov 11, 2017
Readme.md [refactor] simplify Dockerfiles Aug 5, 2018
package-lock.json [upgrade] dependencies to fix the security issues Feb 13, 2019
package.json [upgrade] dependencies to fix the security issues Feb 13, 2019
routes.js
server.js initial commit Nov 11, 2017

Readme.md

next-js-cognito-frontend

a SPA exmaple by Next.js with amazon-cognito-auth-js

this example illustrates

  • how to use next.js with cognito
  • sign up with the login page that is hosted by AWS
  • sign in as existing user
  • fetch id-token in a JWT
  • submit user's inputs with id-token via redux-form

key technologies

  • next.js
  • amazon-cognito-auth-js
  • Redux
  • Redux-form
  • next-router
  • material-ui
  • eslint
  • docker

usage

remove .sample from credential/cognito.json.sample, and modify it

development

$ docker build --target dev -t next-cognito-dev .
$ docker run -it -v $(pwd):/app -p 3111:3000 next-cognito-dev

access http://localhost:3111/

production

$ docker build -t next-cognito-prod .
$ docker run -p 3000:3000 next-cognito-prod