Skip to content

Commit f812fa0

Browse files
node readme
1 parent ad843d0 commit f812fa0

File tree

1 file changed

+50
-7
lines changed

1 file changed

+50
-7
lines changed

node-masterclass.md

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ Arrange Directory in Server like this :
376376

377377
### [[ Assignments ]]
378378

379-
- **Assignment 1** : Read More about Model View Controller online
379+
- **Assignment 1** : Read More about Model View Controller online, link given below.
380380

381381
### Related Links/Videos
382382

@@ -605,6 +605,10 @@ e.g. {name:1, age:1, id:0} - only show **name** and **age** and don't show **id*
605605
- just have use `.env` file in your root directory
606606
- and call `require('dotenv').config()`
607607

608+
609+
### Related Links/Videos
610+
611+
[Mongo Atlas Setup Detailed Video](https://youtu.be/4vtFY_ijpKs)
608612

609613

610614
## Chapter 7 - Mongoose and REST APIs
@@ -1115,12 +1119,12 @@ ejs.renderFile(path.resolve(__dirname,'../pages/index.ejs'), {products:products}
11151119

11161120
### [[ Assignments ]]
11171121

1118-
- **Assignment 1** : Create Server rendered page
1122+
- **Assignment 1** : Create Server rendered page for `quotes` collection created in 1 of previous assignment. Use a very simple HTML template to display each quote in a list format. You can use other render method of EJS for this task. (**not renderFile**)
11191123

11201124

11211125
### Related Links/Videos
11221126

1123-
1. DOM Series
1127+
1. [DOM Series](https://bit.ly/35nMKB7)
11241128

11251129
## Chapter 11 - Authentication with JWT
11261130

@@ -1170,9 +1174,8 @@ return `true` of `false` based on verification of password
11701174
1. [Localstorage](https://youtu.be/OTkQVPVYW7w)
11711175

11721176

1173-
### SPECIAL READ
11741177

1175-
#### SESSION MIDDLEWARE
1178+
#### SESSION MIDDLEWARE [Optional]
11761179

11771180
[Check Video on Session](https://www.youtube.com/watch?v=v_Ewns3n_Ow) :
11781181

@@ -1248,6 +1251,35 @@ find().**limit**(pageSize).**skip**( pageSize*(pageNumber-1)) // where **pageSiz
12481251

12491252
**Population**
12501253

1254+
Populate() lets you reference documents in other collections.
1255+
1256+
```js
1257+
const userSchema = new Schema({
1258+
firstName: { type: String, required: true },
1259+
lastName: String,
1260+
cart:[{ type: Schema.Types.ObjectId, ref: 'Product' }],
1261+
email: {
1262+
type: String,
1263+
unique: true,
1264+
validate: {
1265+
validator: function (v) {
1266+
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(v);
1267+
},
1268+
message: (props) => `${props.value} is not a valid email!`,
1269+
},
1270+
required: true,
1271+
},
1272+
password: { type: String, minLength: 6, required: true },
1273+
token: String,
1274+
});
1275+
1276+
//cart populated example
1277+
const user = await User.findById(id).populate('cart');
1278+
1279+
```
1280+
**For More details :**
1281+
[Detailed Population Video](https://youtu.be/VuSt5-AwL8Y)
1282+
12511283

12521284

12531285
#### Node Events and Event Emitter
@@ -1322,14 +1354,25 @@ socket.on('serverMsg',(data)=>{ // listener to server-side events 'serverMsg'
13221354
```
13231355
13241356
### Uploading a file on NodeJS
1325-
- [Uploading a file using Multer middleware](https://www.youtube.com/watch?v=qfN6c5FEAQQ)
1357+
- [Uploading a file using Multer middleware Video](https://www.youtube.com/watch?v=qfN6c5FEAQQ)
13261358
13271359
13281360
1361+
### [[ Assignments ]]
1362+
1363+
- **Assignment 1** :
1364+
- Make a **simple group chat application** using **Socket.io** library.
1365+
- You need to have a user enter their name in textbox (you can store that in localstorage)
1366+
- After user enters the name : they can see a text box where they can start entering the text messages.
1367+
- Display messages from user and others in a simple html list format.
1368+
- You can align incoming messages from other users to **left** and your own messages to **right** side.
1369+
- Optionally, you can use database to store the old text messages in case you want old chat to be reloaded.
13291370
1330-
**THANKS**
13311371
1372+
-----
1373+
**------------END OF COURSE---------------------**
13321374
1375+
----
13331376
13341377
13351378

0 commit comments

Comments
 (0)