Development Environments
This project utilizes npm
scripts to manage various development stages, including development, production, and testing environments.
Development
npm run dev
: This script runs a development server with Hot Module Replacement (HMR). HMR enables changes in the code to be reflected in the browser without a full page reload, significantly speeding up the development process.- Example:
$ npm run dev
- Note: Refer to the CLI Readme for a more detailed explanation.
- Example:
Production
npm run serve
: This script runs a production-like server, simulating the environment of a deployed application.- Example:
$ npm run serve
- Note: Refer to the CLI Readme for a more detailed explanation.
- Example:
npm run build
: This script creates a production-ready build, optimized for performance and deployment.- Example:
$ npm run build
- Note: Refer to the CLI Readme for a more detailed explanation.
- Example:
Testing
npm run test
: This script runs Jest and Enzyme withenzyme-adapter-preact-pure
for your tests.- Example:
$ npm run test
- Note: Refer to the CLI Readme for a more detailed explanation.
- Example:
Linting
npm run lint
: This script passes TypeScript files through ESLint for code style and quality checks.- Example:
$ npm run lint
- Note: Refer to the CLI Readme for a more detailed explanation.
- Example:
Dependencies
npm install
: Installs all project dependencies, including development tools and libraries.- Example:
$ npm install
- Note: Refer to the CLI Readme for a more detailed explanation.
- Example:
Note: This project uses Preact
and Preact CLI
for development and testing purposes. The tsconfig.json
file configures TypeScript compilation options, including the use of Preact/compat
for React compatibility.
Deployment
npm run deploy
: Deploys the application to a hosting environment, such as Firebase.- Example:
$ npm run deploy
- Note: Make sure you have
firebase-tools
installed. To install them run:$ npm install -g firebase-tools
- Example:
Audience-Specific Development Environment
npm start
: Starts the audience app.- Example:
$ npm start
- Note: The audience app runs on
http://localhost:5000/
. This project does not have any dependencies sonpm install
is not required.
- Example:
Top-Level Directory Explanations
audience-app/ - This directory contains the files for the audience-facing part of the application. It includes HTML files for different pages, static assets like images, and configuration files for Firebase and npm.
audience-app/public/ - This subdirectory holds the publicly accessible files of the audience app. It includes HTML files for specific pages, images, and other static assets.
presenter-app/ - This directory contains the files for the presenter-facing part of the application. It includes source code, static assets, and configuration files.
presenter-app/build/ - This subdirectory holds the compiled and bundled files for the presenter app. It includes HTML, CSS, JavaScript, and image files.
presenter-app/src/ - This subdirectory contains the source code for the presenter app. It includes components, controllers, routes, styles, and utility functions.
presenter-app/tests/ - This subdirectory contains test files for the presenter app. It includes mocks, controllers, and declarations.