Launch System
First Time
Perform the following steps in a terminal inside your GROWI-Dev devcontainer.
Install Dependencies
Execute with npx because lerna package is not installed.
npx lerna bootstrap
WARNING
DO NOT USE npm install
or yarn
Launch Frontend and Backend Server
In 2 separate terminals, run the frontend client and backend server.
Either process can be terminated with Ctrl-C
.
Server for developing frontend
cd packages/app
- Use
yarn dev:client
to:- Build client assets and launch webpack-dev-server.
- Detect changes in client-side files and auto-rebuild the client assets.
Server for developing backend
cd packages/app
- Use
yarn dev:server
to:- Launch the Express server.
- Detect changes in server-side files and auto-restart the Express server.
Additional Launches
Each time the application is launched, repeat the steps under First Time.
Section Install Dependencies can be executed with yarn if the lerna package is installed in node_modules.
yarn lerna bootstrap
Production Build and Execution
Execute the following steps from the First Time section.
Install dependencies
Build the frontend client for production and activate the backend server
yarn start
List of npm Commands
Here are the main commands used in development.
TIP
Execute the following command under the packages / app
directory.
command | desc |
---|---|
dev:client | Build client and launch webpack-dev-server for development. Watching file chages and rebuild automatically. |
dev:server | Launch Express server for development. Watching file chages and restart automatically. |
test | Run unit/integration tests. |
lint | Run code linting. |
migrate:create | Create a new migration file. |
migrate:status | Check which migrations are applied (or not. |
migrate:up | Apply all pending migrations. |
migrate:down | Revert (only) the last applied migration. |
migrate | [Alias] Invoke migrate:up . |