To run:
-
Have npm and node installed
-
Run
npm install
to download all the dependencies. You'll probably have to do this twice:- cd into \server directory, then
npm install
for all server-side dependencies - cd into \client directory, and
npm install
again for client-side dependencies. this might take a while since it's a whole REACT project.
- cd into \server directory, then
-
Communication between our Oracle Remote DB and oracledb dependency:
- Install an Oracle Instant Client. This is the client-side software that the
oracledb
node dependency talks to in order to establish connections with our remote db. Installations found here: https://www.oracle.com/database/technologies/instant-client/downloads.html - Make sure it's a version which would be compatible with Oracle 11g or 12c. You could probably just download any Instant Client version 12.1.x.x or above.
- Un-zip and extract the folder in your PC's C drive or equivalent. Add this directory to your machine's PATH (ex: C:\instantclient_21_12) and create a new variable
LD_LIBRARY_PATH
that points to that same directory (ex: C:\instantclient_21_12); for safety, create a new variableOCI_LIB64
that points to the same dir.
- Install an Oracle Instant Client. This is the client-side software that the
-
Create a
.env
file and store your oracle username and passwords and place it in the \server directory. note that when you merge branches, the.env
file might disappear since it's ignored by git once you add it to your.gitignore
file (which you should create).- ORACLE_USERNAME=your_usrname // quotes (' ') not needed
- ORACLE_PASSWORD=your_password // quotes (' ') not needed
-
Connect to Ryerson SCS-Student VPN.
-
Make sure you populate your Oracle DB before running any of the front-end or back-end scripts
-
Verify the connection string corresponds to the Oracle DB version you used. In the current configuration in
server.js
, it is corresponding to oracle 12c by default asconst dbConnectString = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=oracle12c.scs.ryerson.ca)(Port=1521))(CONNECT_DATA=(SID=orcl12c)))';
. If you used 11g, change to:dbConnectString = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=oracle.scs.ryerson.ca)(Port=1521))(CONNECT_DATA=(SID=orcl1)))'
. But I recommend you use Oracle 12c. -
Open two terminals:
- In the first terminal, go into \server dir, then run
npm run dev
. this should start 'nodemon', allowing the server to reset automatically when you make changes toserver.js
. The terminal should says "Server listening on port 5000". - In the second terminal, go into \client dir and run
npm start
. this will launch the REACT deployment environment. keep the terminal running. might automatically open localhost:3000 in your default browser.
- In the first terminal, go into \server dir, then run
-
Open in browser:
http://localhost:5000/api
to see server-side (probably not much to see as it's just raw data in JSON)http://localhost:3000/
to see the REACT project if it hasn't auto-opened already. You can see either the current sample data rendered or go to browser console -> Network -> api (Name column) -> here you should see the data being fetched by client-side.