Cancer Epidemiology Descriptive Cohort Database
Run the following commands in Terminal. Copy and paste with Ctrl + C and Ctrl + Shift + V.
-
Clone the git repository 1.1. Navigate terminal to where you want to save the project and run the following command (If you are using Windows, git bash works fine)
git clone https://github.com/CBIIT/nci-webtools-dccps-cedcd.git -
Go to the root directory
cd nci-webtools-dccps-cedcd/ -
Install the packages needed for the project
npm install -
Go to the client directory
cd client -
Install the packages needed for the client
npm install -
Now we need to do some setup in the backend side! If you don't have mysql installed, then perform the following steps First, return to the directory where you cloned the project
cd .. cd ..
-
Clone the portable-wamp from the following git repository
git clone https://github.com/park-brian/portable-wamp -
Enter the folder
cd portable-wamp -
run the setup scripts
./setup.sh -
Open a new terminal (or Git Bash) and navigate to your current location
-
In this terminal, run the sql server script
./start_mysqld.sh -
Go back to the first terminal and first copy some files that we will need later on into this folder So, go back to the directory with the two cloned repositories in it
cd ..Copy some sql files over
cp nci-webtools-dccps-cedcd/database/Schema/cedcd_Tables.sql portable-wamp/cedcd-dev-20190627.sql cp nci-webtools-dccps-cedcd/database/Schema/cedcd_StoredProcedures.sql portable-wamp/cedcd_StoredProcedures.sql
-
Now navigate back into the portable-wamp folder
cd portable-wampAnd run the mysql script
./start_mysql.shThis should lead to a prompt that looks like the following
mysql> -
We need to create a new user by typing in the following
CREATE USER 'username'@'%' IDENTIFIED BY 'password';Replace username and password with the username and password given to you by someone with access to the servers We give this user rights by doing the following
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%'; -
Awesome! Now we need to create the database that we will be using We will create a new database using the following command
CREATE DATABASE cedcd;Now enter the database by using the following command
USE cedcd;We need to import the tables and procedures from the two files we copied over into the database
SOURCE cedcd-dev-20190627.sql; SOURCE cedcd_StoredProccedures.sql;
Congratulations! The sql server is ready to go! Exit the mysql prompt with the following command
\q -
Now, we need to create the configuration file. Go back into nci-webtools-dccps-cedcd folder
cd .. cd nci-webtools-dccps-cedcd
We need to go into the config folder and add a configuration file
cd config nano cedcd.settings
Copy and paste the following into the file
```console 'use strict'; module.exports = { mysql:{ connectionLimit: 100, host: 'localhost', port: 3306, user: 'username', password: 'password', db: 'cedcd' }, logDir: 'Logs', file_path: 'Uploads', mail:{ host:'', port:8000, from:'', to:'' }, env: 'dev' }; ```Make sure that the username and password are replaced by the username and password you used earlier Use the following commands to save and exit if you are using nano
Ctrl-x y Enter
-
You're almost there! Now we have to build the client. First, we go to client folder.
cd .. cd client
To build, run the following command.
npm start-script buildWe need to copy the build files into a www folder, so do this by using the following commands
mkdir www cp -r build/* www/
-
Now, we can run the client. Use the following commands to go to the webtool's root folder and run index.js.
cd .. cd .. node index.js
The terminal should display something along the lines of the following
$ cd .. $ cd .. $ node index.js Project CEDCD listening on port:9221
-
Everything should be working now, and you can just open up your browser of choice and go to the following link