-
Notifications
You must be signed in to change notification settings - Fork 13
Getting Started with Developing
Tip
You may add -d
to most yarn docker:
scripts to start up the docker images in detached mode.
You will not see the output of every container, but just the startup status.
This might be of value if you use another service to monitor docker.
- Next.js
Before you begin, ensure you have the following tools installed on your system:
-
Node.js
-
Yarn
-
Docker: Docker is required to create and run the application containers.
-
Docker Compose: Docker Compose is a tool for defining and running multi-container Docker applications.
Windows users may use WSL for their docker instance.
The easiest way to get Mnestix up and running is by using the prepared development environment. This setup includes:
- Mnestix Browser (This repository)
- Mnestix Backend
- BaSyx Repository
- BaSyx Discovery Service
- BaSyx Registry
- BaSyx Submodel Registry
To start all mentioned services together, run the following command:
yarn docker:dev
This will build the Mnestix Browser and start all mentioned services with a default configuration, to adapt this setup have a look at configuration. The Mnestix Browser is now running on http://localhost:3000.
Install all packages for the frontend.
yarn install
If you want to start the browser through your IDE separately start BaSyx and the backend with
yarn docker:backend
In your IDE you can then simply start the dev environment with hot reloading by running
yarn dev
The Mnestix Browser is now running on http://localhost:3000 and will update on changed files.
If you want to activate debug breakpoints in the code, you may have to open the website through a debug environment:
- In
JetBrains WebStorm
you can run a debug browser with theJS Debug
run configuration. - In
Visual Studio Code
you can set up a debug browser by creating alaunch.json
file in theRun and Debug
tab and create a run configuration for your preferred browser.
You may need to set the initial URL to http://localhost:3000.
To check what other options exist to run the Mnestix Browser, see the yarn scripts in package.json
. Highlights are:
-
yarn dev
to start the browser in a hot reloading dev environment. -
yarn prettier
,yarn format
andyarn lint
to apply code formatting and linting. -
yarn test
andyarn test:headless
to run cypress tests locally. -
yarn docker:prod
will build everything with the production flag. -
yarn docker:test
will run all tests in the docker environment. -
yarn docker:prune
will stop all docker containers, remove them from the list and prune all volumes. Start with a blank slate :) -
yarn docker:keycloak
will setup a local keycloak instance and start Mnestix with keycloak support enabled -
yarn docker:rbac
will start Mnestix with dynamic RBAC support. -
yarn docker:proxy
will start Mnestix with a proxy configuration.