Skip to content

Commit 0943c26

Browse files
authored
Took out console logs and modified read me (#587)
* got rid of console logs, jsut commented them out for now the next team can uncomment them where needed * modified readme and added a deployment information and tips document to keep readme from getting any longer
1 parent 0de5c4c commit 0943c26

File tree

8 files changed

+42
-30
lines changed

8 files changed

+42
-30
lines changed

README.md

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ A highly scalable web application that assists the process of coordinating and e
44

55
**Before contributing, see our [Contribution Guidelines](#Contributing).**
66

7+
**NOTE: The purpose of this ReadMe is to get you started with running the application. It does not provide specific information
8+
about how the deployment process of this application works. For deeper information on deployment of this application, read the
9+
PDF found in the `startUpDocumentation` folder.**
10+
711
## Running the Project
812

913
First things, first, **clone this repository**.
1014

1115
There are multiple conifigurations for running the application in different environments to make the application
1216
machine and OS agnostic. The possible configurations are:
1317
- [Production](#Running-In-a-Production-Environment): For when you want the app out for full use
14-
- [Local Development](#Running-In-a-Local-Development-Environment): The production app but running only on a localhost network for testing
18+
- [Local](#Running-In-a-Local-Environment): The production app but running only on a localhost network for testing
1519
- [Run Each Backend Microservice Individually](#Running-Backend-Microservices-Individually): Run each backend service independently of eachother for testing on specific microservices
1620
- [Run The Frontend Microservice Individually](#Running-Frontend-Microservice-Individually): Test the frontend service with a subset of the backend microservices
1721

@@ -53,9 +57,12 @@ All environments will need Google Cloud Console Credentials.
5357

5458
**Step 1:** Clone the repository.
5559

56-
**Step 2:** Go the the `docker-compose.yml` file found in root. At the bottom of the file under the **nginx** container, make the docker host port equal to whatever port you have listed in the URL environment variable. So if I was running the app with the URL **https://example.com:443**, the configuration at the bottom of the file would look like this:
60+
**Step 2a:** Go to the `docker-compose.yml` file found in root. At the bottom of the file under the **nginx** container, make the docker host port equal to whatever port you have listed in the URL environment variable. So if I was running the app with the URL **https://example.com:443**, the configuration at the bottom of the file would look like this:
5761
![image](https://user-images.githubusercontent.com/60359581/216736629-d31a2768-4b55-41c3-9997-08f983ea7dcc.png)
5862

63+
**Step 2b:** Copy the location of the PEM keys to the **nginx** container found here:
64+
![img.png](img.png)
65+
5966
**Step 3:** In the `.env` file, make the **JWK_ACCESS_URL** equal to whatever your URL variable is followed by **/jwt/ibm/api/cpr_access/jwk**. So if the URL is **https://example.com:443**, **JWK_ACCESS_URL** should be `https://example.com:443/jwt/ibm/api/cpr_access/jwk`
6067

6168
**Step 4:** In the `.env` file, make the **JWK_REFRESH_URL** equal to whatever your URL variable is followed by **/jwt/ibm/api/cpr_refresh/jwk**. So if the URL is **https://example.com:443**, **JWK_ACCESS_URL** should be `https://example.com:443/jwt/ibm/api/cpr_refresh/jwk`
@@ -66,11 +73,13 @@ All environments will need Google Cloud Console Credentials.
6673

6774
The web application should be running on the specified domain in your `.env` file.
6875

69-
**Step 7:** To add users with elevated privileges (a.k.a professors), include the user's email on separate lines in `professor-list.txt`.
76+
**Step 7:** To add users with elevated privileges (a.k.a professors), an Admin must add their email handle and name in the list
77+
of users in the admin interface. Note that the first person who ever logs into the application
78+
is granted admin privileges and can demote and promote other users as needed.
7079

7180

7281

73-
### Running In a Local Development Environment
82+
### Running In a Local Environment
7483
**Step 1:** Clone the repository.
7584

7685
**Step 2:** Go the the `docker-compose-local.yml` file found in root. If running on an Apple Silicon Mac (M1 or M2) go to the docker-compose-local-m1.yml file instead. At the bottom of the file under the **nginx** container, make the docker host port equal to whatever port you have listed in the URL environment variable. So if I was running the app with the URL **http://localhost.com:443**, the configuration at the bottom of the file would look like this:
@@ -90,7 +99,9 @@ The web application should be running on the specified domain in your `.env` fil
9099

91100
The web application should be running on the specified domain in your `.env` file.
92101

93-
**Step 7:** To add users with elevated privileges (a.k.a professors), include the user's email on separate lines in `professor-list.txt`.
102+
**Step 7:** To add users with elevated privileges (a.k.a professors), an Admin must add their email handle and name in the list
103+
of users in the admin interface. Note that the first person who ever logs into the application
104+
is granted admin privileges and can demote and promote other users as needed.
94105

95106
### Running Backend Microservices Individually
96107
**Before running anything individually, you will need:**
@@ -116,6 +127,7 @@ The web application should be running on the specified domain in your `.env` fil
116127
**Step 2:** Go to the `scripts` folder in the root directory and run the `independently-run-db.sh` shell script. If running on an Apple Silicon Mac (M1 or M2) run the `independently-run-db-m1.sh` shell script. If you haven't already, also run the `mongo-init.sh` shell script afterwards.
117128

118129
**Step 3:** You can now run the backend microservices separately. Simply go to the root of each microservice where the `pom.xml` file is located and run `mvn liberty:dev` to start the microservice. The web app should be running on http://localhost:xxxxx - the port depends on which microservice you are running as following:
130+
119131
| Microservice | Port |
120132
|----------------------------------|---------|
121133
| `login` | `13126` |
@@ -128,7 +140,7 @@ The web application should be running on the specified domain in your `.env` fil
128140

129141
### Running Frontend Microservice Individually
130142

131-
To run the frontend outside of the docker-compose network, we will only run the databases and nginx webserver with docker such that the webserver reroutes any traffic to the microservices that will be running outside of the docker-compose network.
143+
To run the frontend outside of the docker-compose network, we will only run the databases and nginx webserver with docker.
132144

133145
**Before running anything individually, you will need:**
134146
- [Maven](https://maven.apache.org/install.html) >= 3.8.4
@@ -138,17 +150,17 @@ To run the frontend outside of the docker-compose network, we will only run the
138150

139151
| Variable | Value |
140152
|-------------------|------------------------------------------------------|
141-
| `LOCALHOST` | `true` |
142-
| `MONGO_PORT` | `27037` |
143-
| `MONGO2_PORT` | `27038` |
144-
| `MONGO3_PORT` | `27039` |
145-
| `MONGO4_PORT` | `27040` |
146-
| `MONGO5_PORT` | `27041` |
147-
| `MONGO5_DATABASE`| `cpr` |
148-
| `MONGO_USERNAME` | <whatever you set it to in the .env file> |
149-
| `MONGO_PASSWORD` | <whatever you set it to in the .env file> |
150-
|`JWK_ACCESS_URL` | `http://localhost:13126/jwt/ibm/api/cpr_access/jwk` |
151-
|`JWK_REFRESH_URL` | `http://localhost:13126/jwt/ibm/api/cpr_refresh/jwk`|
153+
| `LOCALHOST` | `false` |
154+
| `MONGO_PORT` | `27037` |
155+
| `MONGO2_PORT` | `27038` |
156+
| `MONGO3_PORT` | `27039` |
157+
| `MONGO4_PORT` | `27040` |
158+
| `MONGO5_PORT` | `27041` |
159+
| `MONGO5_DATABASE`| `cpr` |
160+
| `MONGO_USERNAME` | <whatever you set it to in the .env file> |
161+
| `MONGO_PASSWORD` | <whatever you set it to in the .env file> |
162+
|`JWK_ACCESS_URL` | `http://172.17.0.1:3000/jwt/ibm/api/cpr_refresh/jwk` |
163+
|`JWK_REFRESH_URL` | `http://172.17.0.1:3000/jwt/ibm/api/cpr_refresh/jwk` |
152164

153165
**Step 2:** Go inside the folder `CSC480-22S/frontend/src/main/frontend` and create a .env file. Add the following lines to the file:
154166
`export REACT_APP_URL=http://localhost:3000/`
@@ -160,9 +172,10 @@ To run the frontend outside of the docker-compose network, we will only run the
160172

161173
**Step 4:** Go to the `scripts` folder in the root directory and run the `run-frontend-proxy.sh` shell script. If running on an Apple Silicon Mac, run the `run-frontend-proxy-m1.sh` script instead. If you haven't already, also run the `mongo-init.sh` shell script afterwards.
162174

163-
**Step 5:** You can now run microservices independently. Simply go to the root of each backend microservice where the `pom.xml` file is located and run `mvn liberty:dev` to start the microservice. To run the frontend service, go to the folder located at `CSC480-22S/frontend` and run `mvn process-resources liberty:dev` to start the frontend service. You will be able to reach the front end at `http://localhost:3000`.
175+
**Step 5:** You can now run microservices independently. Simply go to the root of each backend microservice where the `pom.xml` file is located and run `mvn liberty:dev` to start the microservice. To run the frontend service, go to the folder located at `CSC480-22S/frontend/src/main/frontend` and run `PORT=<whatever port you want> npm run start` to start the frontend service. Ensure the port you pick does not conflict with any other applications. You will be able to reach the front end at `http://localhost:<The port you specified>`.
176+
177+
The backend microservices should be running on http://localhost:xxxxx - the port depends on which microservice you are running:
164178

165-
The backend microservices should be running on http://localhost:xxxxx - the port depends on which microservice you are running as following:
166179
| Microservice | Port |
167180
|----------------------------------|---------|
168181
| `login` | `13126` |

frontend/src/main/frontend/src/components/ProfessorComponents/AssignmentPage/ProfessorEditAssignmentComponent.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const ProfessorEditAssignmentComponent = () => {
2727
return checked
2828
}
2929
if (currentAssignmentLoaded) {
30-
console.log(currentAssignment)
30+
// console.log(currentAssignment)
3131
setChecked(currentAssignment.has_peer_review)
3232
if (!alreadySetInitialCheckState) {
3333
setAlreadySetInitialCheckState(true)
@@ -55,7 +55,7 @@ const ProfessorEditAssignmentComponent = () => {
5555

5656
useEffect(() => {
5757
dispatch(getAssignmentDetailsAsync({ courseId, assignmentId }))
58-
console.log(checked)
58+
// console.log(checked)
5959
}, [courseId, assignmentId, dispatch])
6060

6161
const confirmDelete = async () => {
@@ -145,14 +145,14 @@ const ProfessorEditAssignmentComponent = () => {
145145
delete formObj['peer_review_instructions']
146146
delete formObj['peer_review_due_date']
147147
delete formObj['peer_review_points']
148-
console.log(formObj)
148+
// console.log(formObj)
149149
//update the assignment data
150150
await axios.put(editUrl, { ...formObj, course_id: courseId }).catch((e) => {
151151
console.error(e.response)
152152
})
153153
//only submit the assignment instruction file (if any changes were even made)
154154
if (assignmentFileFormData.get(assignmentFileName)) {
155-
console.log(assignmentFileFormData.get('file'))
155+
// console.log(assignmentFileFormData.get('file'))
156156
await axios.post(assignmentFileUrl, assignmentFileFormData).catch((e) => {
157157
console.error(e)
158158
alert('Error uploading assignment file.')
@@ -187,7 +187,7 @@ const ProfessorEditAssignmentComponent = () => {
187187
})
188188
//only submit the assignment instruction file (if any changes were even made)
189189
if (assignmentFileFormData.get(assignmentFileName)) {
190-
console.log(assignmentFileFormData.get('file'))
190+
// console.log(assignmentFileFormData.get('file'))
191191
await axios.post(assignmentFileUrl, assignmentFileFormData).catch((e) => {
192192
console.error(e)
193193
alert('Error uploading assignment file.')
@@ -223,7 +223,7 @@ const ProfessorEditAssignmentComponent = () => {
223223
const templateUrl = `${getAssUrl}/${assignmentId}/peer-review/template/upload`
224224

225225
if (assignmentFileFormData.get(assignmentFileName)) {
226-
console.log(assignmentFileFormData.get('file'))
226+
// console.log(assignmentFileFormData.get('file'))
227227
await axios.post(assignmentFileUrl, assignmentFileFormData).catch((e) => {
228228
console.error(e)
229229
alert('Error uploading assignment file.')

frontend/src/main/frontend/src/components/StudentComponents/CoursePage/StudentTeamComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ const StudentTeamComponent = () => {
224224
}}>
225225
<svg className="cross" style={{}} onClick={async () => {
226226
setShowJoinTeamSuccessModal(false)
227-
console.log("X clicked, leaving to teams page...")
227+
// console.log("X clicked, leaving to teams page...")
228228
//setBackToTeams()
229229
navigate(-1)
230230
await dispatch(getCurrentCourseTeamAsync({ courseId, lakerId }))

frontend/src/main/frontend/src/pages/AuthPages/LoginPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ function LoginPage() {
1717
}
1818

1919
const handleLogin = async (googleData) => {
20-
console.log(googleData.credential)
20+
// console.log(googleData.credential)
2121
localStorage.setItem('google_token', googleData.credential);
2222
dispatch(getTokenAsync());
2323
};
2424

2525
useEffect(() => {
2626
setIsLoading(true);
27-
console.log(REACT_APP_CLIENT_ID)
27+
// console.log(REACT_APP_CLIENT_ID)
2828
setTimeout(() => setIsLoading(false), 775);
2929
return () => {
3030
setIsLoading(false);

frontend/src/main/frontend/src/redux/features/authSlice.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const getTokenAsync = createAsyncThunk(
99
'auth/getTokenAsync',
1010
async () => {
1111
const url = `${authURL}/token/generate`;
12-
console.log(url);
12+
// console.log(url);
1313
const google_token = localStorage.getItem('google_token');
1414
const axiosAuthInstance = axios.create({
1515
headers: {

img.png

23.9 KB
Loading

professor-list.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
322 KB
Binary file not shown.

0 commit comments

Comments
 (0)