Skip to content

Commit

Permalink
Revamp of Running Locally For Frontend Development (#309)
Browse files Browse the repository at this point in the history
* updated config files for https, going to test now

* various scripts added to support multiple deployment environments, google authentication updated

* Changed CSS on the login page so the google login button doesn't have that weird border

* Made a separate workflow for people working on the frontend so that they can easily develop for it without being tied to the docker-compose nginx web server

* fixed weird issue where google id verifier wouldn't work with environment variables, had to specify the issuer

* Updated env example file

* updated the local-frontend docker compose file so that it starts up the nginx webserver and all the mongo databases and the user can choose which backend microservices they want up while they're testing their frontend configuration

* Update README.md

* Update README.md

* Update README.md

* Update README.md

Small stylistic change

* Defined the possible runtime environments in the readme

* Linked to the different runtime sections

* Typo fix

* Update README.md

* Update README.md

* Update README.md

* Update README.md

Small typo fix

* Update README.md

Added instructions for filling up environment variables

* Update README.md

Began final section detailing how to run each microservice individually

* redirected from http to https on the production web server

* Update README.md

Updated instructions about the JWKs to make it more clear

* added build script for apple silicon

* Updated m1 build script

* Update README.md

Added instructions for running each microservice individually

* Update README.md

* Update README.md

* changed how the Assignment Interface in the Professor Assignments microservice works by having it read the from the system properties to recognize if unix or windows is being used

* Added scripts that will run the app on M1 or M2 macs and updated the readme to include their use

* changed the local proxy yml so all one should have to do is run the build script to start up every service except the frontend and then the developer can start the frontend with npm start for quick development
  • Loading branch information
daltamur authored Feb 12, 2023
1 parent e12dea7 commit d76f73d
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 8 deletions.
142 changes: 142 additions & 0 deletions docker-compose-local-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,147 @@
version: "3.8"
services:
login:
build:
context: ./backend/login-microservice
image: cpr-login
container_name: cpr-login
restart: unless-stopped
volumes:
- ./professor-list.txt:/opt/ol/wlp/output/defaultServer/professor-list.txt:rw
environment:
JWK_ACCESS_URL: ${JWK_ACCESS_URL}
JWK_REFRESH_URL: ${JWK_REFRESH_URL}
MONGO_HOSTNAME: ${MONGO_HOSTNAME}
MONGO_PORT: ${MONGO_PORT}
MONGO2_PORT: ${MONGO2_PORT}
MONGO3_PORT: ${MONGO3_PORT}
MONGO4_PORT: ${MONGO4_PORT}
MONGO5_PORT: ${MONGO5_PORT}
MONGO_DATABASE: ${MONGO_INITDB_DATABASE}
MONGO_USERNAME: ${MONGO_USERNAME}
MONGO_PASSWORD: ${MONGO_PASSWORD}
CLIENT_ID: ${CLIENT_ID}
CLIENT_SECRET: ${CLIENT_SECRET}

course-manager:
build:
context: ./backend/course-manager-microservice
image: cpr-course-manager
container_name: cpr-course-manager
restart: unless-stopped
environment:
JWK_ACCESS_URL: ${JWK_ACCESS_URL}
JWK_REFRESH_URL: ${JWK_REFRESH_URL}
MONGO_HOSTNAME: ${MONGO_HOSTNAME}
MONGO_PORT: ${MONGO_PORT}
MONGO2_PORT: ${MONGO2_PORT}
MONGO3_PORT: ${MONGO3_PORT}
MONGO4_PORT: ${MONGO4_PORT}
MONGO5_PORT: ${MONGO5_PORT}
MONGO_DATABASE: ${MONGO_INITDB_DATABASE}
MONGO_USERNAME: ${MONGO_USERNAME}
MONGO_PASSWORD: ${MONGO_PASSWORD}

course-viewer:
build:
context: ./backend/course-viewer-microservice
image: cpr-course-viewer
container_name: cpr-course-viewer
restart: unless-stopped
environment:
JWK_ACCESS_URL: ${JWK_ACCESS_URL}
JWK_REFRESH_URL: ${JWK_REFRESH_URL}
MONGO_HOSTNAME: ${MONGO_HOSTNAME}
MONGO_PORT: ${MONGO_PORT}
MONGO2_PORT: ${MONGO2_PORT}
MONGO3_PORT: ${MONGO3_PORT}
MONGO4_PORT: ${MONGO4_PORT}
MONGO5_PORT: ${MONGO5_PORT}
MONGO_DATABASE: ${MONGO_INITDB_DATABASE}
MONGO_USERNAME: ${MONGO_USERNAME}
MONGO_PASSWORD: ${MONGO_PASSWORD}

peer-review-teams:
build:
context: ./backend/peer-review-teams-microservice
image: cpr-peer-review-teams
container_name: cpr-peer-review-teams
restart: unless-stopped
environment:
JWK_ACCESS_URL: ${JWK_ACCESS_URL}
JWK_REFRESH_URL: ${JWK_REFRESH_URL}
MONGO_HOSTNAME: ${MONGO_HOSTNAME}
MONGO_PORT: ${MONGO_PORT}
MONGO2_PORT: ${MONGO2_PORT}
MONGO3_PORT: ${MONGO3_PORT}
MONGO4_PORT: ${MONGO4_PORT}
MONGO5_PORT: ${MONGO5_PORT}
MONGO_DATABASE: ${MONGO_INITDB_DATABASE}
MONGO_USERNAME: ${MONGO_USERNAME}
MONGO_PASSWORD: ${MONGO_PASSWORD}

professor-assignment:
build:
context: ./backend/professor-assignment-microservice
image: cpr-professor-assignment
container_name: cpr-professor-assignment
restart: unless-stopped
volumes:
- ./assignments:/opt/ol/wlp/output/defaultServer/assignments
environment:
JWK_ACCESS_URL: ${JWK_ACCESS_URL}
JWK_REFRESH_URL: ${JWK_REFRESH_URL}
MONGO_HOSTNAME: ${MONGO_HOSTNAME}
MONGO_PORT: ${MONGO_PORT}
MONGO2_PORT: ${MONGO2_PORT}
MONGO3_PORT: ${MONGO3_PORT}
MONGO4_PORT: ${MONGO4_PORT}
MONGO5_PORT: ${MONGO5_PORT}
MONGO_DATABASE: ${MONGO_INITDB_DATABASE}
MONGO_USERNAME: ${MONGO_USERNAME}
MONGO_PASSWORD: ${MONGO_PASSWORD}

student-assignment:
build:
context: ./backend/student-assignment-microservice
image: cpr-student-assignment
container_name: cpr-student-assignment
restart: unless-stopped
volumes:
- ./assignments:/opt/ol/wlp/output/defaultServer/assignments
environment:
JWK_ACCESS_URL: ${JWK_ACCESS_URL}
JWK_REFRESH_URL: ${JWK_REFRESH_URL}
MONGO_HOSTNAME: ${MONGO_HOSTNAME}
MONGO_PORT: ${MONGO_PORT}
MONGO2_PORT: ${MONGO2_PORT}
MONGO3_PORT: ${MONGO3_PORT}
MONGO4_PORT: ${MONGO4_PORT}
MONGO5_PORT: ${MONGO5_PORT}
MONGO_DATABASE: ${MONGO_INITDB_DATABASE}
MONGO_USERNAME: ${MONGO_USERNAME}
MONGO_PASSWORD: ${MONGO_PASSWORD}

student-peer-review-assignment:
build:
context: ./backend/student-peer-review-assignment-microservice
image: cpr-student-peer-review-assignment
container_name: cpr-student-peer-review-assignment
restart: unless-stopped
volumes:
- ./assignments:/opt/ol/wlp/output/defaultServer/assignments
environment:
JWK_ACCESS_URL: ${JWK_ACCESS_URL}
JWK_REFRESH_URL: ${JWK_REFRESH_URL}
MONGO_HOSTNAME: ${MONGO_HOSTNAME}
MONGO_PORT: ${MONGO_PORT}
MONGO2_PORT: ${MONGO2_PORT}
MONGO3_PORT: ${MONGO3_PORT}
MONGO4_PORT: ${MONGO4_PORT}
MONGO5_PORT: ${MONGO5_PORT}
MONGO_DATABASE: ${MONGO_INITDB_DATABASE}
MONGO_USERNAME: ${MONGO_USERNAME}
MONGO_PASSWORD: ${MONGO_PASSWORD}
mongo:
image: mongo:5.0.6
command: mongod --port ${MONGO_PORT}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function LoginPage() {

useEffect(() => {
setIsLoading(true);
console.log(REACT_APP_CLIENT_ID)
setTimeout(() => setIsLoading(false), 775);
return () => {
setIsLoading(false);
Expand Down
17 changes: 9 additions & 8 deletions nginxfrontend.conf
Original file line number Diff line number Diff line change
Expand Up @@ -60,35 +60,36 @@ http {
}

location /auth {
proxy_pass http://172.17.0.1:13126;
proxy_pass http://login:13126;
}

location /jwt {
proxy_pass http://172.17.0.1:13126;
proxy_pass http://login:13126;
}

location /manage {
proxy_pass http://172.17.0.1:13127;
proxy_pass http://course-manager:13127;
}

location /view {
proxy_pass http://172.17.0.1:13128;
proxy_pass http://course-viewer:13128;
}

location /teams {
proxy_pass http://172.17.0.1:13129;
proxy_pass http://peer-review-teams:13129;
}

location /assignments/professor {
proxy_pass http://172.17.0.1:13130;
proxy_pass http://professor-assignment:13130;
}

location /assignments/student {
proxy_pass http://172.17.0.1:13131;
proxy_pass http://student-assignment:13131;
}

location /peer-review {
proxy_pass http://172.17.0.1:13132;
proxy_pass http://student-peer-review-assignment:13132;
}

}
}

0 comments on commit d76f73d

Please sign in to comment.