- You are required to develop individual microservices within separate folders within this repository.
- The teaching team should be given access to the repositories as we may require viewing the history of the repository in case of any disputes or disagreements.
- Create root
.envand add required parameters (can copy paste from telegram chat) - Prod Run with
docker-compose --profile prod up - Dev Run with
docker-compose --profile dev up - To rebuild, add
--buildflag to above command - To change between prod and dev stop the current running containers with
docker compose downand re-run the above command with the desired profile.
- go to firebase project settings > service account > generate new private key.
- rename the downloaded json file into serviceAccountKey.json and paste it the same dir as .env.
- Create a copy of
./services/question-service/.env.exampleand name it.env - Populate the file with the DEV credentials for question service
- Ensure you have docker desktop installed
- Run this command in the root directory of this repo:
This does the following
docker-compose -f ./services/question-service/docker-compose.yml up
- Start the local postgres DB
- Start the question service FastAPI server
- Runs a script that inserts one question in the form of a HTML documen. And two images (Note that the images are inserted into the dev S3 bucket and referenced using a cloundfront URL)
- View the Swagger docs at http://localhost:8000/docs
- Make API calls to the service either through the Swagger UI or using your own methods
- Run this command on root:
docker-compose -f docker-compose.collab.yml upIt should start up the 4 services required
- Go on browser (I used firefox) and open two tabs:
localhost:5173- acts as User 1localhost:5174- act as User 2 (Collaborator)
Note: if you encounter an error similar to:
Oops!
can't access property "useRef", resolveDispatcher() is null
node_modules/react/cjs/react.development.js/exports.useRef@http://localhost:5173/node_modules/.vite/deps/chunk-2WHLTL63.js?v=c5ccc1d9:949:16
useProviderColorScheme@http://localhost:5173/node_modules/.vite/deps/@mantine_core.js?v=0d551787:3925:43
...Try waiting ~30 seconds to a minute before refreshing, sometimes vite needs time to optimize the dependencies
- Click on the
Go to Collabbutton for both
Now that you are in Collab page for both users, two things are testable:
- Code editor should be fully synchronized between the two users
- End Session will (send a
console.log("Redirecting to next page...")) to both user's FE consoles. this can later be further expanded to redirect users to next pages