-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into question-spa-frontend
- Loading branch information
Showing
37 changed files
with
4,177 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
# This is a sample environment configuration file. | ||
# Copy this file to .env and replace the placeholder values with your own. | ||
|
||
# Question Service | ||
QUESTION_DB_CLOUD_URI=<FILL-THIS-IN> | ||
QUESTION_DB_LOCAL_URI=mongodb://question-db:27017/question | ||
QUESTION_DB_USERNAME=user | ||
QUESTION_DB_PASSWORD=password | ||
|
||
NODE_ENV=development | ||
# User Service | ||
USER_SERVICE_CLOUD_URI=mongodb+srv://admin:<db_password>@cluster0.uo0vu.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0 | ||
USER_SERVICE_LOCAL_URI=mongodb://127.0.0.1:27017/peerprepUserServiceDB | ||
|
||
# Will use cloud MongoDB Atlas database | ||
ENV=PROD | ||
|
||
# Secret for creating JWT signature | ||
JWT_SECRET=you-can-replace-this-with-your-own-secret | ||
|
||
NODE_ENV=development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# Ignore IntelliJ IDEA project files | ||
.idea/ | ||
.env | ||
**/node_modules | ||
**/.env | ||
**/.idea | ||
# Vim temp files | ||
*~ | ||
*.swp | ||
*.swo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# User Service | ||
USER_SERVICE_CLOUD_URI=<cloud_uri> | ||
USER_SERVICE_LOCAL_URI=mongodb://127.0.0.1:27017/peerprepUserServiceDB | ||
PORT=3001 | ||
|
||
# Will use cloud MongoDB Atlas database | ||
ENV=PROD | ||
|
||
# Secret for creating JWT signature | ||
JWT_SECRET=you-can-replace-this-with-your-own-secret | ||
|
||
NODE_ENV=development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM node:20-alpine | ||
|
||
WORKDIR /app | ||
COPY package.json package-lock.json ./ | ||
RUN npm install | ||
COPY . . | ||
EXPOSE 3001 | ||
|
||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Setting up MongoDB Instance for User Service | ||
|
||
1. Visit the MongoDB Atlas Site [https://www.mongodb.com/atlas](https://www.mongodb.com/atlas) and click on "Try Free" | ||
|
||
2. Sign Up/Sign In with your preferred method. | ||
|
||
3. You will be greeted with welcome screens. Feel free to skip them till you reach the Dashboard page. | ||
|
||
4. Create a Database Deployment by clicking on the green `+ Create` Button: | ||
|
||
![alt text](./GuideAssets/Creation.png) | ||
|
||
5. Make selections as followings: | ||
|
||
- Select Shared Cluster | ||
- Select `aws` as Provider | ||
|
||
![alt text](./GuideAssets/Selection1.png) | ||
|
||
- Select `Singapore` for Region | ||
|
||
![alt text](./GuideAssets/Selection2.png) | ||
|
||
- Select `M0 Sandbox` Cluster (Free Forever - No Card Required) | ||
|
||
> Ensure to select M0 Sandbox, else you may be prompted to enter card details and may be charged! | ||
![alt text](./GuideAssets/Selection3.png) | ||
|
||
- Leave `Additional Settings` as it is | ||
|
||
- Provide a suitable name to the Cluster | ||
|
||
![alt text](./GuideAssets/Selection4.png) | ||
|
||
6. You will be prompted to set up Security for the database by providing `Username and Password`. Select that option and enter `Username` and `Password`. Please keep this safe as it will be used in User Service later on. | ||
|
||
![alt text](./GuideAssets/Security.png) | ||
|
||
7. Next, click on `Add my Current IP Address`. This will whiteliste your IP address and allow you to connect to the MongoDB Database. | ||
|
||
![alt text](./GuideAssets/Network.png) | ||
|
||
8. Click `Finish and Close` and the MongoDB Instance should be up and running. | ||
|
||
## Whitelisting All IP's | ||
|
||
1. Select `Network Access` from the left side pane on Dashboard. | ||
|
||
![alt text](./GuideAssets/SidePane.png) | ||
|
||
2. Click on the `Add IP Address` Button | ||
|
||
![alt text](./GuideAssets/AddIPAddress.png) | ||
|
||
3. Select the `ALLOW ACCESS FROM ANYWHERE` Button and Click `Confirm` | ||
|
||
![alt text](./GuideAssets/IPWhitelisting.png) | ||
|
||
Now, any IP Address can access this Database. |
Oops, something went wrong.