Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix question number bug #119

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@

2. Start docker

3. Run `docker-compose up --build` to build and run images and containers
3. For `frontend`, `ai-service`, `email-service`, `mongodb-database`, `user-service`, there is an `.env` file that is required.
Follow the respective `README.md` located in those folders.

4. Note: this does not start the api-gateway. Follow the relevant `./gateway/README.md`
4. Run `docker-compose up --build` to build and run images and containers

## Developer guide

As of the last update of this README, only the user-service and question-service have been dockerized. A respective `Dockerfile` has been created within each of their folders. This `Dockerfile` specifies the instructions in order to build the container, install the necessary node modules etc.
As of the last update of this README, all backend services, frontend and gateway have been dockerized. A respective `Dockerfile` has been created within each of folders. This `Dockerfile` specifies the instructions in order to build the container, install the necessary node modules etc.

To simplify the container building, a `docker-compose.yml` has been created in order to start both containers at once. This is achieved through running `docker compose build` and `docker compose up` to call both dockerfiles.
To simplify the container building, a `docker-compose.yml` has been created in order to start both containers at once. This is achieved through running `docker-compose up --build` to call all the dockerfiles.

The api-gateway requires more work, see https://dev.to/naseef012/create-a-microservices-app-with-dockerized-express-api-gateway-1kf9 for more information.
Note that user-service requires a Supabase database and question-service requires a MongoDB database. The respective `README.md` should aid you in creating your own databases.

Also, the ai-service requires your own OpenAi key and email-service requires an SMTP_PASSWORD to run locally. For ease of testing, do so on peerprep.ryanchuahj.com
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenAI*


## Finishing Development

Expand Down
10 changes: 10 additions & 0 deletions backend/ai-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Getting Started with Ai-service

1. Run `npm install` to install all the dependencies

2. Duplicate `.env.example` and rename the new file to `.env`. Add your own OpenAI API key.

3. To run development server, do `npm run dev`

4. Do `npm run build` to compile for production before running `npm start`

4 changes: 3 additions & 1 deletion backend/email-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

2. Duplicate `.env.example` and rename the new file `.env`

3. Retrieve secrets from group chat. Search `EMAILSECRETS`.
3. IMPORTANT: the SMTP_PASSWORD uses a secret key only available to developers.
For testing, please contact the developers.
Optionally, you can also test the email functionality on peerprep.ryanchuahj.com.

4. Run `npm start` to start the service.

Expand Down
3 changes: 3 additions & 0 deletions gateway/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
USER_SERVICE_URL="http://localhost:3001"
QUESTION_SERVICE_URL="http://localhost:3002"
RABBITMQ_URL="amqp://user:password@localhost:5672"
2 changes: 1 addition & 1 deletion gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

1. Use command `npm install -g express-gateway` to install express gateway on your system.

2. For deployment, edit the `serviceEndpoints` in `./config/gateway.config.yml` to accept env vars.
2. Duplicate `.env.example` and rename the new file to `.env`.

3. Enter the gateway directory and run `npm start` to start the api gateway server.