The CrossCloud Administrator console uses Docker for its development environment.
Please install Docker CE for Mac.
To install Docker on Linux use instructions for your distribution from
https://docs.docker.com/engine/installation/.
Don't use packages available in the default repositiory of your
distribution - they are outdated.
After installing the main docker package install also docker compose
according to https://docs.docker.com/compose/install/.
Please remember that docker
and docker-compose
commands should be run
as a superuser or alternativelly additional configuration is required
(https://docs.docker.com/engine/installation/linux/ubuntulinux/#/manage-docker-as-a-non-root-user).
To install Docker on Windows download the installation package from https://docs.docker.com/docker-for-windows/ and run it. After installation, if you don't have Hyper-V enabled, agree to enable it and restart the machine. Then right-click on the docker icon in the taskbar, and click settings. In the settings window go to Shared Drives, select drives where the source code of the Administator Console is, and click Apply.
In order to make autoreloaders to work on windows please run the following command:
cp .env.sample.windows .env
WARNING: file system events on mounted volumes don't work on Windows. Autoreloaders use pooling instead which could be slow and cpu hungry.
Run the following command before you run the app the first time:
docker network create crosscloud-dev
To run the CrossCloud Administrator console use the following command:
docker-compose up
The first run takes some time because base images are downloaded and dependencies are installed. Autoreloaders are configured for both api and react part of the app so usually, there is no need to do manual restarts after changes in the source code.
The app is available on 127.0.0.1 (port 8000).
To stop the app press CTRL-C in the terminal. You should see messages similar to the following:
Stopping crosscloudadminconsole_frontend_1 ... done
Stopping crosscloudadminconsole_api_1 ... done
Stopping crosscloudadminconsole_db_1 ... done
In some cases they don't appear - then another command is needed:
docker-compose stop
- Please remove folders api/node_modules and react/node_modules if you used a non-dockerized version before.
Run yarn install
in the root folder of the repository to install packages
required for linting. This command also install precommit hook which formats
the code using Prettier and checks it using
Eslint.
You can also run yarn run prettier
to format code in the whole repository
and yarn run eslint
to check all .js files before commit.