Integrate NextJS, fastify, Emotion and other basic configurations.
- Use fastify as custom server in NextJS.
- Platform routing instead of file system routing, it only works with custom server.
- Use emotion as css-in-js framework, it support both client and server side.
- Basic setup of Prometheus metrics.
- Add RTL support.
Execute yarn ci
to install packages and make lerna scoped packages work.
If you want to have SSL in local, please generate certification by yourself and put cert.pem and key.pem in folder src/packages/server/certs
.
You can refer and change the code here https://github.com/timoyan/nextjs_fastify_boilerplate/blob/master/src/packages/server/index.ts#L19
- Dev mode
yarn app-dev
- Normal start
yarn app-start
- Dev mode
yarn server-dev
- Normal start
yarn server-start
- Build app and server
yarn build
- Build docker image
docker build .
- Run docker image as container
docker run -d -p 3000:80 -e PORT=80 [DOCKER_IMAGE]
It only works in server code now.
- Give
Command + Shift + P
- Choose
Debug: Select and Start Debugging
- Choose
Next: full
Chrome should be opened and will refresh once nodeJS setup is ready.
- Add jest
- Add redux hydration sample