Tech stack:
- Docker (two separate containers App and MongoDB)
- Webpack 5
- Express
- React Hooks/Redux
- Server-side rendering (SSR)
- Bootstrap 5
- Sass
- Winston logger
- PWA
- Tuned with Lighthouse
- CSP (// TODO - CspHtmlWebpackPlugin)
- Jest testing (// TODO)
docker-compose up -d
docker-compose stop
Check you have enough watchers - https://webpack.js.org/configuration/watch/#not-enough-watchers:
cat /proc/sys/fs/inotify/max_user_watches
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
Open two terminals with
docker exec -it project1_webapp_container bash
Install packages
npm install --also=dev
Run in each terminal, separately, server and webpack
npm run server-dev
npm run webpack-dev
npm run server-dev-ssr
docker exec -u root -it project1_webapp_container bash
npm run webpack-build
To skip devDependencies installation:
npm install --production
To start server in production mode (***TODO pm2***):
npm run server-production