-
Notifications
You must be signed in to change notification settings - Fork 14
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:devThis 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 installIf you want to start the browser through your IDE separately start BaSyx and the backend with
yarn docker:backendIn your IDE you can then simply start the dev environment with hot reloading by running
yarn devThe 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 WebStormyou can run a debug browser with theJS Debugrun configuration. - In
Visual Studio Codeyou can set up a debug browser by creating alaunch.jsonfile in theRun and Debugtab 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 devto start the browser in a hot reloading dev environment. -
yarn prettier,yarn formatandyarn lintto apply code formatting and linting. -
yarn testandyarn test:headlessto run cypress tests locally. -
yarn docker:prodwill build everything with the production flag. -
yarn docker:testwill run all tests in the docker environment. -
yarn docker:prunewill stop all docker containers, remove them from the list and prune all volumes. Start with a blank slate :) -
yarn docker:keycloakwill setup a local keycloak instance and start Mnestix with keycloak support enabled -
yarn docker:rbacwill start Mnestix with dynamic RBAC support. -
yarn docker:proxywill start Mnestix with a proxy configuration.