Let's start development

WESEEK Rule

Developers who are not used to Git functionality (branches, reset, rebase) should use a GUI client. GUI clients make it easy to develop while keeping in mind the tree structure of the Git repository and related considerations.

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

  1. cd packages/app
  2. 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

  1. cd packages/app
  2. 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

List of npm Commands

Here are the main commands used in development.
Check also the script section of packages/app/package.json to see all commands you can use.

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.

Production Build and Execution

TIP

Execute the following command under the root directory of the repository.

  1. Install dependencies

    npx lerna bootstrap
    
  2. Build the frontend client for production

    yarn app:build
    
  3. Launch the backend server

    yarn app:server