Skip to content

Commit

Permalink
Merge pull request #172 from CS3219-AY2324S1/finalise-submission
Browse files Browse the repository at this point in the history
assignment 2 instructions finalization
  • Loading branch information
chloeelim authored Nov 18, 2023
2 parents f38f80c + 05ee0d1 commit 0b21c58
Showing 1 changed file with 6 additions and 34 deletions.
40 changes: 6 additions & 34 deletions Assignment2.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,25 @@
## To set up and execute

### Download
Download the ZIP file named `ay2324s1-course-assessment-g17-Assignment-2.zip` from [Assignment-2-Updated](https://github.com/CS3219-AY2324S1/ay2324s1-course-assessment-g17/releases/tag/Assignment-2-Updated).
2. Unzip the file and navigate to the folder `ay2324s1-course-assessment-g17-Assignment-2`.
Download the ZIP file named `ay2324s1-course-assessment-g17-Assignment-2-Updated.zip` from [Assignment-2-Updated](https://github.com/CS3219-AY2324S1/ay2324s1-course-assessment-g17/releases/tag/Assignment-2-Updated).
2. Unzip the file and navigate to the folder `ay2324s1-course-assessment-g17-Assignment-2-Updated`.

### Include .env files
3. Set up the environment for the question service, user service, and frontend by including the `.env` files for each, which have been submitted as:
`Assignment2-QuestionServiceEnv.txt`,
`Assignment2-UserServiceEnv.txt`,
`Assignment2-FrontendEnv.txt` respectively.
Make sure they are `.env` files within the question service, user service, and frontend directories.

For convenience, they have been placed here:

`Assignment2-QuestionServiceEnv.txt`
```
MONGO_CONNECTION_STRING=mongodb+srv://sherylhci:[email protected]/peerprep_app?retryWrites=true&w=majority
PORT=8080
ACCESS_TOKEN_SECRET="access_secret"
REFRESH_TOKEN_SECRET="refresh_secret"
FRONTEND_URL="http://localhost:3000"
```

`Assignment2-UserServiceEnv.txt`
```
DATABASE_URL="postgresql://postgres@localhost:5432/postgres?schema=public"
PORT=8000
ACCESS_TOKEN_SECRET="access_secret"
REFRESH_TOKEN_SECRET="refresh_secret"
FRONTEND_URL="http://localhost:3000"
```

`Assignment2-FrontendEnv.txt`
```
REACT_APP_BACKEND_URL=http://localhost:8080/api
REACT_APP_USER_SERVICE_BACKEND_URL=http://localhost:8000/
```
3. Set up the environment for the question service, user service, and frontend by including the `.env` files for each, which have been submitted separately on CANVAS. Make sure they are `.env` files within the question service, user service, and frontend directories.

### Install dependencies
4. Change into each directory (`frontend`, `backend/question-service`, `backend/user-service`) and run `npm install` to install the dependencies for the question service, user service, and frontend.

Note: You may need to run `npm i --save-dev @types/cors` and `npm i --save-dev @types/express` should you encounter any errors.

### Set up postgresql
5. Start the postgresql used by the frontend by running below on another terminal window.

```
docker run --rm -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust postgres;
```

6. Then navigate to the user service directory (i.e. `ay2324s1-course-assessment-g17-Assignment-2/ay2324s1-course-assessment-g17-Assignment-2/backend/user-service`) and run the following commands:
6. Then navigate to the user service directory (i.e. `ay2324s1-course-assessment-g17-Assignment-2-Updated/ay2324s1-course-assessment-g17-Assignment-2-Updated/backend/user-service`) and run the following commands:

```
npx prisma db push
Expand Down

0 comments on commit 0b21c58

Please sign in to comment.