Important
As of late, the list of questions appear to take very long to load, as there are over 2000 being fetched. Please wait for a minute and a half if you see no questions on the question list page. We apologise for the inconvenience, and seek your understanding.
Download the ZIP file named ay2324s1-course-assessment-g17-Assignment-2-Updated.zip
from Assignment-2-Updated.
2. Unzip the file and navigate to the folder ay2324s1-course-assessment-g17-Assignment-2-Updated
.
- 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.
- Change into each directory (
frontend
,backend/question-service
,backend/user-service
) and runnpm 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.
- 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;
- 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
npx prisma db seed
This will set up the postgresql database schema, and also seed the database with 1 ADMIN role user account, the "designated maintainer role" account, and 1 USER role user accounts, "registered users". Details for usernames and passwords below.
ADMIN role account details:
username: admin_user
password: admin_password
USER role account details:
username: regular_user
password: user_password
Other accounts signed up from the application interface are all USER role user accounts, "registered users".
npm start
the question service, user service, and frontend.
To see the user database, you can simply run the command npx prisma studio
, which will open up an interface for you to easily view the user database.