Demo Nextjs application that includes:
- nextjs (server-side rendering single-page application)
- styled-components
- storybook component previewing: http://docs.mf.swhurl.com/
- linting with eslint
- jest snapshot testing
- prettier formatting
- lighthouse performance testing
- chrome browser testing (wdio)
- greenkeeper (automatic PRs for upgrading dependencies)
- kustomize (k8s deployment configuration)
The application is deployed to a k8s cluster that includes:
- cert-manager (automatic TLS certificate provisioning from LetsEncript)
- oauth2-proxy (authentication against github)
- prometheus (infrastructure and applicaiton monitoring)
- fluentbit / loggly integration (log aggregation)
npm install
You will need an API key and set it as an environment variable (API_KEY
) for local development:
npm run dev
npm run build
npm start
docker build -t swhurl/mf-website-test-base:node-10-chrome-stable -f Dockerfile.test-base .
docker push swhurl/mf-website-test-base:node-10-chrome-stable
docker build -t swhurl/mf-website .
docker run -d --init --restart always --net swhurl --name website swhurl/mf-website
Replace placeholder secrets values for oauth with base64 encoded values:
github_client_id
github_client_secret
cookie_secret
Replace placeholder secrets values for web with base64 encoded values:
apiKey
Install via kustomize
- https://github.com/kubernetes-sigs/kustomize
kustomize build kustomize/web/overlays/staging | kubectl apply -f -
kustomize build kustomize/web/overlays/production | kubectl apply -f -
kustomize build kustomize/oauth2 | kubectl apply -f -