Repositories:
Frontend: https://github.com/teamforus/forus-frontend
Backend: https://github.com/teamforus/forus-backend
First, you need to clone the project from GitHub:
git clone [email protected]:teamforus/forus-frontend.git forus-frontend
Go to the newly created folder forus-frontend
and checkout to the branch you want to test:
cd forus-frontend
git checkout <BRANCH_NAME>
Same as the backend, after you build and start the container you can edit project files (or switch to another branch for example).
Next, you can run a bash script, to perform the next operations:
- Create the .env file from .env.example (if it doesn't already exist).
- Start the containers.
- Install node modules.
- Compile the assets.
- Connect your project directory as container volume.
By default this script will build the project and watch for the changes.
But if you only want to build the project without watching add -compile
or -c
flag.
./docker/cmd/start-docker-compose.sh
If everything fine - the front-ends will be available at following urls:
http://localhost:3000 - Webshop
http://localhost:3001 - Provider dashboard
http://localhost:3002 - Sponsor dashboard
http://localhost:3003 - Validator dashboard
To stop containers run:
docker-compose down
To start again existing container, without npm install
and full rebuild
run:
docker-compose up -d
But to be able to edit the code and see the changes you made, you will have to manually run the builder (see: Build the assets
section)
To install/reinstall node module:
docker-compose exec app sh -c "cd src && npm install"
To build the project use:
docker-compose exec app sh -c "cd src && gulp compile"
To build the project and watch for the change use:
docker-compose exec app sh -c "cd src && gulp"
Another way to run the project, is to use a prebuilt docker image.
You can either build the forus-frontend image yourself locally or download the image from docker-hub (will be available later).
First build docker image:
docker build -t forus-io/forus-frontend .
The next command will start the containers (node
, apache2
)
After you can run command to start docker containers (for node, apache2)
./docker/cmd/start.sh
If everything fine - the front-ends will be available at following urls:
http://localhost:3000 - Webshop
http://localhost:3001 - Provider dashboard
http://localhost:3002 - Sponsor dashboard
http://localhost:3003 - Validator dashboard
To stop the containers use:
docker stop forus-frontend