An example project that demonstrates the principles and practices described in the Enterprise JavaScript: Build and Testing for Production talk at the 2023 Esri Dev Summit
This project makes use of the following:
- The Create React App set up the basic framework of the web client. It is also used to create a production build of the web code via webpack.
- Jest is the testing framework.
- Testing Library provides some helper functions for testing.
- ExpressJS sets up a simple REST interface.
- node-config controls the REST interface configuration (i.e. the text that gets returned).
Most of the recordings are uploaded to 2023 Esri Developer Summit in "mediaspace.esri.com" and slides are made available at Esri Events > Proceedings.
NodeJS is required to run this project. It was developed using v18, but it may work on other versions.
To install the necessary dependencies, run the following at the command prompt:
npm install
To start up the project, run the following in a command prompt:
npm start
Open http:https://localhost:3000 to view it in your browser. It may take a few moments to start up.
The project has a "production" mode that demonstrates node-config's hierarchical configuration management. Run the following at the command prompt:
npm start:production
Run the project's unit tests by entering the following at the command prompt:
npm test
This runs the unit tests in interactive watch mode. Enter a
at the prompt to re-run all the tests. Enter q
to exit the test runner. See this section for more information.
Run the following at a command prompt:
npm run build
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.