This starter provide ready to dev react-app with typescript.
Project prerequists are to install globally Node.js or Docker.
Clone this repository.
git clone https://github.com/seeren/react-starter.git
Change directory.
cd react-starter
VScode is sugested with the provided configuration.
The file .vscode/extensions.json
recommand installing folowing extensions:
- dbaeumer.vscode-eslint to enforce code quality.
- esbenp.prettier-vscode to enforce code style.
- mrmlnc.vscode-remark to enforce markdown style.
- csstools.postcss to allow custom at rules.
The file .vscode/settings.json
contain recommanded settings.
Execute the project on local environement
- Install dependencies.
npm install
- Serve the project.
npm start
- Build then run image for developement stage.
Port can be configured in .env
file with the PORT
variable
docker-compose up dev
- Build then run image for production stage.
Port can be configured in .env
file with the PORT_NGINX
variable.
Production rely on nginx with the nginx.conf
file to serve build/index.html
whatever the url path is.
docker-compose up prod
You can execute commands for react-starter containers with zsh
docker exec -it react-starter_dev zsh
Enforce code quality and style
Fix lint rules and save file.
npm run lint
Lint stack is specific to react typescript and opiniated. There is few rules for encourage to adding them as needed.
Learn react practices
Explore project directories README:
This section describe how to build the project.
- Build the project
npm run build
- Build then run image for build stage.
docker-compose up build