The React Express Vite Boilerplate is a starting point for building a full stack Express JS application with a React front-end. It uses Vite as the framework to build, run and serve the application.
npm installInstall only what is needed for the web application.
Vite exposes env variables on the special import.meta.env object. To find out mores see Env Variables and Modes for Vite.
A new environment variable was added to handle https for local development. It needs to be set to true for local development and false for when you deploy to the pipeline.
VITE_LOCAL_DEV = truenpm run devBuilds and starts a web server for your web application. It provide hot mdule reloading on both the React front-end and the ExpressJS back-end. When launched in local development mode the entire application is available at https://localhost:3000 Local SSL will be needed in order to run the MyID authentication locally.
For deployments, the build file will run and install, build, and start. You can also run this in local development to ensure everything is working.
npm run buildnpm run startIf you are running Docker Desktop locally, you can also build this into a container.
FROM node:20Run the included docker-compose file in a terminal to spin up a container of this locally.
docker-compose up -dnpm run testRuns tests for all included files within the project.
npm run lintRuns linting for all included files within the project.
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptionsproperty like this:
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist
- Material UI
- For Data tables use MUI X Data Grind
- For date and time pickers use MUI X Date and Time Pickers
- Charts - MUI X Charts
- A tree view widget presents a hierarchical list useMUI X Tree View
- Tailwind CSS