Overview
The Boilerplate - MERNBoilerplate is a project designed for NodeJS and React-based projects in TypeScript. It serves as a starting template for setting up and running applications. This README provides the necessary steps to get the application up and running.
Features
- Quickstart option to run the application with all the required dependencies using Docker Compose
- Hot reloading for both backend and frontend for easy development
- Pre-set configuration files for different environments (development, testing, staging, production)
- Support for various integrations (documentation TBD)
Installation
Pre-Requirements:
- Node (v14.17) - Download and install
- MongoDb (v5) - Download and install
Scripts:
- Install dependencies:
npm install - Build Project:
npm build - Start Application (without HotReload):
npm start - Start Application (with HotReload enabled):
npm run serve - Run Lint (JavaScript and TypeScript):
npm run lint - Run Lint (Markdown):
npm run lint:md - Run E2E tests:
npm run e2e
Configuration:
- The module uses config for loading configuration entries.
- In the config directory:
- Consult/update custom-environment-variables.yml for loading values via environment. This overrides any value set in files defined below.
- Create local.yml for local config.
- Consult/update development.yml for values at development. (The default env)
- Consult/update testing.yml for values at testing. NODE_CONFIG_ENV must be set to testing for this.
- Consult/update staging.yml for values at staging. NODE_CONFIG_ENV must be set to staging for this.
- Consult/update production.yml for values at production. NODE_CONFIG_ENV must be set to production for this.
- Consult/update default.yml for constant values only. Define entries here which will remain the same across deployments.
- INFO: default.yml config file lists all available entries which the system uses. For creating a new config entry:
- If the config value tends to change across deployments, provide undefined for the same in default.yml and the value should be provided in the respective deployment file.
- If the config value is supposed to be the same across deployments, provide the same in default.yml.
- INFO: local* files allow you to manually provide config during development and are set to be ignored by VCS. Any environment can be overridden locally via:
- local.yml - Overrides everything.
- local-{env}.yml - Overrides only specific env environment.
- INFO: Read more about in what order the config entries are loaded here.
- Each entry follows the following structure: object.notation data-type ENVIRONMENT_OVERRIDE (if available) - Description (Default - value)
Summary
The Boilerplate - MERNBoilerplate is a useful project that provides a starting point for NodeJS and React-based projects in TypeScript. It offers key features such as easy installation, hot reloading for efficient development, and integrated configuration options for different environments. It is a valuable tool for developers looking to streamline their project setup process.