Project setup
Installing dependencies
The project requires NodeJS and Docker. If you are on Windows, you will also need to install Git, as it is not pre-installed.
Setting up Yarn:
We use yarn
for managing Node packages.
Check that you have it by opening the command line (or Powershell on Windows) and run the following command:
yarn -v
If the command is invalid, then Yarn is not installed yet. You may run the installation command in the same terminal window using:
npm install -g yarn
First Time Project Setup:
- Clone the GitHub repository:
Using the Terminal:
Ensure that you are inside of the directory where you want to close the Repository in a terminal or Powershell window. Enter in the following Git command:
git clone --depth=1 https://github.com/csse-uoft/SNM-I
Using GitHub Desktop:
If you have the GitHub Desktop app:
- Click the “Current Repository” section on the top left of the window.
- On the drop-down menu, click “Add”.
- Click “Clone Repository”.
- Under “csee-uoft”, select the “csse-uoft/SNM-I” repository.
- Edit the path where you would like to clone the repository and click “Clone”.
- Install Node dependencies in both the
frontend/
andbackend/
directories: In a terminal or Powershell window, navigate to the repository directory. Enter the following commands:
cd SNM-I/frontend
yarn install
cd ../backend
yarn install
-
Server Credentials: You should receive a
.env
file with the server credentials. Place it inside ofbackend/
. -
Allow self-signed localhost certificates on your browser and restart the browser:
- Google Chrome: enable
chrome://flags/#temporary-unexpire-flags-m118
and thenchrome://flags/#allow-insecure-localhost
- Mozilla Firefox: Go to Preferences → Privacy & Security → View certificates →
Servers → Add Exception → add
localhost:5000
- If the
#allow-insecure-localhost
flag is not available to you, please follow the instructions here
- Create the mongoDB and graphDB Docker containers:
First, start the docker daemon.
Using the Docker Desktop App:
If you installed Docker Desktop (eg. brew install --cask docker
, or through the installer),
open the Docker app to start the daemon.
Using the Terminal (Linux and MacOS):
Alternatively, you can start it in the command line by running dockerd
as root
or through your service manager:
sudo dockerd # keep this running, or
systemctl start docker # if you use systemd, or
sudo service docker start # if you use open-rc
Create the Docker containers with the following commands:
Using the Terminal (Linux and MacOS and Windows):
docker run -p 127.0.0.1:7200:7200 --name graphdb --restart unless-stopped -t ontotext/graphdb:10.6.4 --GDB_HEAP_SIZE=6G -Dgraphdb.workbench.maxUploadSize=2097152000
docker run --name mongo -p 127.0.0.1:27017:27017 ––restart unless-stopped -d mongo:latest
Note that the only difference between the Linux/MacOS and Windows installation in the command line is that the second command uses docker run
instead of docker create
. Windows Powershell does not recognize the -d
flag for the docker create
command.
Running in production
Backend
- Start the Docker daemon (see above).
- Start the Docker containers, either through the Docker Desktop App or by running
docker start graphdb mongo
in the terminal/Powershell (use the names from earlier). The graphdb interface should start on port 7200. - Run
yarn start
in thebackend/
directory using the terminal/powershell. The server should start on port 8080.
Frontend
- Run
yarn start
in thefrontend/
directory using the terminal/Powershell. The site should served at port 3000. - Visit
localhost:3000
in your browser and log in with the following credentials:
Field | Value |
---|---|
admin@snmi.ca | |
Password | admin |
What university is CSSE associated with? | UofT |
What is CSSE’s home department? | MIE |
What is CSSE’s purpose? | research |
Next steps
Congratulations! You have finished setting up the project for development! 🥳🥳
Below are other resources that you may want to consult:
- Project goals: Learn more about the business and functional requirements of the project.
- User’s manual: See how to use the project as an end-user.
- Project dependencies: Learn the external dependencies of the project.
- Understand the codebase: Take a look at the project structure and browse through some code.