-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add account creation feature and page
Showing
35 changed files
with
2,959 additions
and
23 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
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 |
---|---|---|
|
@@ -14,4 +14,5 @@ export class HomeComponent { | |
goToLoginPage() { | ||
this.router.navigate(['/login']); | ||
} | ||
} | ||
|
||
} |
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,7 +1,44 @@ | ||
<div class="login-button"> | ||
<div | ||
id="google-login-button" | ||
class="login-button btn btn-primary" | ||
(click)="signInWithGoogle()" | ||
></div> | ||
<div class="container"> | ||
|
||
<div class="form-container"> | ||
<h2> Create Account</h2> | ||
<form id="userForm" [formGroup]="createAccountForm"> | ||
|
||
<!-- Username --> | ||
<label for="name">Name:</label> | ||
<div *ngIf="createAccountForm.get('username')?.invalid && createAccountForm.get('username')?.touched" | ||
class="error-message"> | ||
<small *ngIf="createAccountForm.get('username')?.hasError('required')">Username is required</small> | ||
</div> | ||
<input type="text" id="name" formControlName="username"> | ||
|
||
|
||
<!-- Email --> | ||
<label for="email">Email:</label> | ||
<div *ngIf="createAccountForm.get('email')?.invalid && createAccountForm.get('email')?.touched" class="error-message"> | ||
<small *ngIf="createAccountForm.get('email')?.hasError('required')">Email is required</small> | ||
<small *ngIf="createAccountForm.get('email')?.hasError('email')">Invalid email address</small> | ||
</div> | ||
|
||
<input type="email" id="email" formControlName="email"> | ||
|
||
<!-- Password --> | ||
<label for="password">Password:</label> | ||
<div *ngIf="createAccountForm.get('password')?.invalid && createAccountForm.get('password')?.touched" | ||
class="error-message"> | ||
<small *ngIf="createAccountForm.get('password')?.hasError('required')">Password is required</small> | ||
<small *ngIf="createAccountForm.get('password')?.hasError('minlength')">Minimum 6 characters</small> | ||
</div> | ||
<input type="password" id="password" formControlName="password"> | ||
|
||
<button class="submit" type="submit" (click)="createAccount()" [disabled]="createAccountForm.invalid">Submit</button> | ||
</form> | ||
|
||
</div> | ||
<!-- <div class="button"> | ||
<div id="google-login-button" class="login-button btn btn-primary" (click)="signInWithGoogle()"></div> | ||
</div> --> | ||
</div> | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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,3 @@ | ||
**/node_modules | ||
**/.env | ||
**/.idea |
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,14 @@ | ||
# CS3219 project: PeerPrep | ||
|
||
## User Service | ||
|
||
### Quick Start | ||
|
||
1. In the `user-service` directory, create a copy of the `.env.sample` file and name it `.env`. | ||
2. Create a MongoDB Atlas Cluster and obtain the connection string. | ||
3. Add the connection string to the `.env` file under the variable `DB_CLOUD_URI`. | ||
4. Ensure you are in the `user-service` directory, then install project dependencies with `npm install`. | ||
5. Start the User Service with `npm start` or `npm run dev`. | ||
6. If the server starts successfully, you will see a "User service server listening on ..." message. | ||
|
||
### Complete User Service Guide: [User Service Guide](./user-service/README.md) |
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 @@ | ||
DB_CLOUD_URI=<CONNECTION_STRING> | ||
DB_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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.