Skip to content

Installation

Aman Dwivedi edited this page Aug 18, 2021 · 3 revisions

Requirements 📜

  1. Your machine should have Yarn (preferable) or Npm or Docker installed.

  2. A working FOSSology setup.

  3. Setup CORS in FOSSology

  • Open FOSSology and go to Admin > Customize.
  • Look out for "Allowed origins for REST API"
  • Set the value to "http://localhost:3000"

image

Installation Steps 🚶

1. Fork it 🍴

You can get your own fork/copy of FOSSologyUI by using the Fork button.

2. Clone it 👥

You need to clone (download) it to a local machine using

git clone https://github.com/Your_Username/FOSSologyUI.git

This makes a local copy of the repository in your machine.

Once you have cloned the FOSSologyUI repository in GitHub, move to that folder first using the change directory command.

# This will change directory to a folder FOSSologyUI
cd FOSSologyUI

Move to this folder for all other commands.

3. Set it up ⬆️

Run the following commands to see that your local copy has a reference to your forked remote repository in GitHub :octocat:

git remote -v
origin  https://github.com/Your_Username/FOSSologyUI.git (fetch)
origin  https://github.com/Your_Username/FOSSologyUI.git (push)

Now, add a reference to the original FOSSologyUI repository using

git remote add upstream https://github.com/fossology/FOSSologyUI.git

This adds a new remote named upstream.

See the changes using

git remote -v
origin    https://github.com/Your_Username/FOSSologyUI.git (fetch)
origin    https://github.com/Your_Username/FOSSologyUI.git (push)
upstream  https://github.com/fossology/FOSSologyUI.git (fetch)
upstream  https://github.com/fossology/FOSSologyUI.git (push)

4. Run it 🏁

Using Yarn (preferable)

# To install all the dependencies
yarn install

# To start the application
yarn start

OR

using NPM

# To install all the dependencies
npm install

# To start the application
npm start

The React application will start on port 3000. Go to: http://localhost:3000

OR

using Docker

FOSSology comes with a Dockerfile allowing the containerized execution.

Run the following commands inside the project directory.

docker build \
-t fossologyui:react1.0 \
--build-arg REACT_APP_SERVER_URL="localhost/repo/api/v1" \
--build-arg REACT_APP_HTTPS="false" .
docker run -p 3000:3000 fossologyui:react1.0

The UI can then be accessed at http://IP_OF_DOCKER_HOST:3000/, user fossy password fossy.