Learning Full Stack (MERN) Web App Development through Free Online Tutorials – Organized Notes and Log
This post is an organized version of my somewhat less organized post: Learning web app development through free online tutorials – Detailed Log . This post is closely associated with my post: Roadmap to Learning Full Stack (MERN) Web Development Beginner Level through Free Online Tutorials .
These notes and logs were prepared by me as I went through two rounds of most of the main tutorials mentioned in above "Roadmap". I think it may be a very useful resource for students who follow my above Roadmap to learn full stack web app development. [1 Oct. 2024 Update: I did a third round in Sept. 2024 whose details are covered in: Notes on 3rd round of Node.js, Express.js, Mongoose and MongoDB tutorials with quick refresher of (simple) Blog full stack app.]
Topics Covered
- Visual Studio Code
- HTML5
- Chrome DevTools
- CSS
- JavaScript
- Node.js and Express.js
- MongoDB and Mongoose
- ReactJS
- Git
- Github
- Using Git and GitHub from Visual Studio Code
- MERN Full Stack mini-project
Visual Studio Code
Visual Studio Code website with download link for Windows version: https://code.visualstudio.com/
How to Install Visual Studio Code on Windows 10 [2023 Update] Complete Guide, https://www.youtube.com/watch?v=CPmQwlycfGI , 2 min. 30 secs.
Visual Studio Code shortcuts:
- Commenting out selected code: Ctrl + /
- Alt+z to break long line into smaller lines such that it avoids need for horizontal scrolling
- Select line shortcut: Ctrl + L
- Deleting line: Ctrl+Shift+K
- Going back a match when selecting words: Ctrl+U
- Skipping a match: ctrl+k, ctrl+d. Ref: https://stackoverflow.com/questions/61871613/is-there-a-command-in-vs-code-for-skipping-a-match-when-selecting-words-individu
- Ctrl+PageDown to switch to next tab, Ctrl+PageUp to switch to previous tab. Ref: https://stackoverflow.com/questions/38957302/is-there-a-quick-change-tabs-function-in-visual-studio-code
- Format Document Shift+Alt+F; Format Selection Ctrl+K Ctrl+F [From Key Bindings for Visual Studio Code, https://code.visualstudio.com/docs/getstarted/keybindings#_keyboard-shortcuts-reference ].
- Ctrl + Shift + P -> Format Document [from Prettier Formatter for Visual Studio Code, https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode ].
- See unsaved changes by Ctrl+Shift+P followed by (typing in) ‘compa sav’ in opened up textbox. Also shortcut for command is Ctrl+K followed by D (after releasing Control key). Ref: https://stackoverflow.com/questions/65874120/see-unsaved-changes-in-vscode
- To view markdowns (.md files) in preview (better formatted way): Right-Click file in File explorer and choose Open Preview (keyboard shortcut: Ctrl+Shift+V). Ref: Markdown and Visual Studio Code, https://code.visualstudio.com/docs/languages/markdown
Prettier extension installation and invocation: Installing Prettier Visual Studio Code plugin, https://www.youtube.com/watch?v=J-JRwDkDJHc , 1 min. 45 secs.
In VSCode choose File -> Preferences -> Settings -> Extensions -> ES React/React-Native/Redux snippets. In the right panel, uncheck “React Snippets > Settings: Import React on Top”.
I used the following .prettierignore file at project directory level and it worked as expected:
# Ignore src/test directory files
**/src/test
VSCode Prettier: Turning off prettier for next node: From JSX, https://prettier.io/docs/en/ignore.html#jsx
{/* prettier-ignore */}
I tried the above and it works for next JSX tag (and all tags within it).
VSCode can be used to search for text within folders having nested folders of projects with their source code.
22 May 2024 Update: Was able to get Windows Context Menu to show VSCode ('Open with Code') option to open folder or file by following some of the answers from stackoverflow.com article given below. They suggested reinstallation of VSCode (download site) (on top of existing installation) and in the install process, checking the "Open with Code .." checkbox options in a dialog and doing the installation. I had seen this earlier but had hesitated to do it as I thought it will take time to do the reinstallation. Today when I read the stackoverflow.com article, I read one small comment saying that it takes only one minute! I think I had read it earlier too but thought it was a mistake. Today I felt it could be right and so tried it. And yes, the actual install process got down very fast (perhaps around a minute). The download file was also not too big - 97 MB. end-Update 22 May 2024.
Adding Visual Studio Code to Windows Context Menu, https://www.youtube.com/watch?v=4qspErFtm00, 1 min. 50 secs.
Visual Studio Code "Open With Code" does not appear after right-clicking a folder, https://stackoverflow.com/questions/37306672/visual-studio-code-open-with-code-does-not-appear-after-right-clicking-a-folde
From Markdown, https://en.wikipedia.org/wiki/Markdown: “Markdown[9] is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber created Markdown in 2004 as a markup language that is easy to read in its source code form.[9]”
autocomplete for log should be first console.log #49308, https://github.com/Microsoft/vscode/issues/49308
HTML5
A long detailed video tutorial (4 hrs): Learn HTML – Full Tutorial for Beginners (2022), https://www.youtube.com/watch?v=kUMe1FH4CHE, 4 hrs, 3 mins, by freeCodeCamp.org.
HTML5 – Overview, https://www.tutorialspoint.com/html5/html5_overview.htm
! in blank HTML file is (Emmet) shortcut to have a starter HTML file (shown in above video).
Emmet — the essential toolkit for web-developers, https://docs.emmet.io/
To open an HTML file from Visual Studio Code, from Terminal use: start html-filename (e.g. start index.html).
HTML in Visual Studio Code, https://code.visualstudio.com/docs/languages/html
HTML Tutorial, https://www.w3schools.com/html/
HTML5 – Attributes, https://www.tutorialspoint.com/html5/html5_attributes.htm
HTML5 – Events, https://www.tutorialspoint.com/html5/html5_events.htm
HTML5 – Web Forms 2.0, https://www.tutorialspoint.com/html5/html5_web_forms2.htm
HTML5 – Audio & Video, https://www.tutorialspoint.com/html5/html5_audio_video.htm
HTML (link) Tag, https://www.w3schools.com/tags/tag_link.asp
HTML span Tag, https://www.w3schools.com/tags/tag_span.asp
What is the difference between section and div tags in HTML ?, https://www.geeksforgeeks.org/what-is-the-difference-between-section-and-div-tags-in-html/
HTMLElement: dataset property, https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
Question: Why Does my Browser Silently Send Requests for a ‘favicon.ico’ File for Multiple Domains?, answered in: Troubleshoot What a Favicon.ico Is and why a Browser Requests It, https://www.cisco.com/c/en/us/support/docs/security/web-security-appliance/117995-qna-wsa-00.html .
HTML small : the side comment element, https://developer.mozilla.org/en-US/docs/Web/HTML/Element/small
Chrome DevTools
Open Chrome DevTools, https://developer.chrome.com/docs/devtools/open
Build better sites faster with Chrome DevTools, https://www.youtube.com/watch?v=VYyQv0CSZOE , 29 min 4 secs, published on Aug 24, 2019 by SFHTML5
Debugging JavaScript – Chrome DevTools 101, https://www.youtube.com/watch?v=H0XScE08hy8 , 7 min 27 secs, published on Jan 5, 2018 by Chrome for Developers
CSS
A long detailed video tutorial (11 hrs): CSS Tutorial – Full Course for Beginners, https://www.youtube.com/watch?v=OXGznpKZ_sA , 11 hrs. 8 mins, published by freeCodeCamp.org on 30 Aug. 2022. Source code: https://github.com/gitdagray/css_course .
“CSS Tutorial” section of CSS Tutorial, https://www.w3schools.com/css/default.asp .
Learn to style HTML using CSS, https://developer.mozilla.org/en-US/docs/Learn/CSS
CSS align-items Property, https://www.w3schools.com/cssref/css3_pr_align-items.php , https://www.w3schools.com/cssref/tryit.php?filename=trycss3_align-items, https://www.w3schools.com/cssref/playdemo.php?filename=playcss_align-items&preval=stretch
CSS display Property, https://www.w3schools.com/cssref/pr_class_display.php , https://www.w3schools.com/cssref/tryit.php?filename=trycss_display (shows difference between display inline and display block)
An Introduction to the fr CSS unit, https://css-tricks.com/introduction-fr-css-unit/
Understanding use of the +, >, and ~ symbols in CSS selectors, https://levelup.gitconnected.com/understanding-use-of-the-and-symbols-in-css-selectors-95552eb436f5
CSS Box Sizing, https://www.w3schools.com/css/css3_box-sizing.asp
How TO – Hero Image, https://www.w3schools.com/howto/howto_css_hero_image.asp , “A Hero Image is a large image with text, often placed at the top of a webpage…”
CSS Inheritance, https://developer.mozilla.org/en-US/docs/Web/CSS/Inheritance
CSS Variables – The var() Function, https://www.w3schools.com/css/css3_variables.asp
CSS: visibility: hidden makes the element not visible but the element still takes up space in the layout (so the centering of visible siblings in a flexbox is not impacted). display: none removes the element from the document (so the centering of visible siblings in a flexbox is impacted). Ref: Tryit: Difference between display:none and visiblity: hidden, https://www.w3schools.com/css/tryit.asp?filename=trycss_display .
min-height property overrides both height and max-height. Ref: https://css-tricks.com/almanac/properties/m/min-height/
I put up a separate post on: Notes on height related CSS settings for document (html tag) and body (body tag) elements, https://raviswdev.blogspot.com/2024/02/notes-on-height-related-css-settings.html .
- width trigger point for mobile < 600px
- width trigger point for tablet < 768px
- width trigger point for desktop(/laptop) >= 768px
How do I wrap text in a pre tag?, https://stackoverflow.com/questions/248011/how-do-i-wrap-text-in-a-pre-tag …. Key CSS code: pre {white-space: pre-wrap;}
The above explains why my test HTML JS code that was displaying style property(ies) of an element was showing null data when the style property was being set only in CSS. Setting the style property inline or programmatically resulted in that property data getting displayed correctly (using element.style).
CSS Grid Layout Module, https://www.w3schools.com/css/css_grid.asp (display: grid;)
CSS Flexbox, https://www.w3schools.com/css/css3_flexbox.asp (has 3 child-pages: CSS Flex Container, CSS Flex Items and CSS Flex Responsive with the last showing how to “Use flexbox to create a responsive website, containing a flexible navigation bar and flexible content”).
The ultimate CSS battle: Grid vs Flexbox, https://medium.com/hackernoon/the-ultimate-css-battle-grid-vs-flexbox-d40da0449faf
- Learn CSS Flexbox by building a photo card component, https://freshman.tech/flexbox/
- How to build a Navigation Bar with CSS Flexbox, https://freshman.tech/flexbox-navbar/
- How to build a responsive feature list with CSS Flexbox, https://freshman.tech/feature-list/
- How to build a Mobile App Layout with CSS Flexbox, https://freshman.tech/flexbox-mobile-app/
How to Create a Responsive 3 Column Layout Flexbox CSS, https://devpractical.com/3-columns-flexbox-layout-css/ (uses width and is a short and simple article)
Equal Columns With Flexbox: It’s More Complicated Than You Might Think, https://css-tricks.com/equal-columns-with-flexbox-its-more-complicated-than-you-might-think/ (uses flex property and is a detailed and complex article)
CSS: Page with Header, Main and Footer using Flex, https://raviswdev.blogspot.com/2024/03/css-page-with-header-main-and-footer.html
Gradients, transform and web-kit
- Linear Gradient – Top to Bottom: https://www.w3schools.com/css/tryit.asp?filename=trycss3_gradient-linear
-
Linear Gradient – Left to Right:
https://www.w3schools.com/css/tryit.asp?filename=trycss3_gradient-linear_ltr
- Linear Gradient – Transparency: https://www.w3schools.com/css/tryit.asp?filename=trycss3_gradient-linear_trans
linear-gradient(), https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient gives an example of colour and percentage use as color-stop. One of the tutorial projects mentioned elsewhere in this post, uses: “background-image: linear-gradient(to top, #ff0844 0%, #ffb199 100%);”. The above web pages helped me to understand this to mean start with #ffb199 at bottom and have a gradient to top with #ff0844.
CSS transform Property, https://www.w3schools.com/cssref/css3_pr_transform.php
Creating a responsive hamburger menu button with CSS, https://reintech.io/blog/creating-responsive-hamburger-menu-button-with-css
The CSS properties: -webkit-background-clip, -moz-background-clip, -webkit-text-fill-color and -moz-text-fill-color seem to be poorly documented. After lot of searching, I got some info. from the following links:
- -webkit-text-fill-color, https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-fill-color
- What is WebKit and how is it related to CSS?, https://stackoverflow.com/questions/3468154/what-is-webkit-and-how-is-it-related-to-css
- History of the browser user-agent string, https://webaim.org/blog/user-agent-string-history/
It is these properties that seem to provide the text (NEXT GENERATION TECHNOLOGY) using gradient colour effect in HTML-CSS-Website-V1 project referred in youtube video (HTML CSS and Javascript Website Design Tutorial – Beginner Project Fully Responsive) mentioned elsewhere in this post.
HTML DOM
HTML DOM Element classList (includes info. about Toggle method), https://www.w3schools.com/jsref/prop_element_classlist.asp
Toggle example: https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_element_classlist_toggle
HTML DOM Document querySelector(), https://www.w3schools.com/jsref/met_document_queryselector.asp
Additional Info.
To see how a page looks on a mobile screen in Chrome: ctrl+shift+i followed by ctrl+shift+m
Why use *, *::before, *::after at the same time? [duplicate], https://stackoverflow.com/questions/65563666/why-use-before-after-at-the-same-time
Is knowledge of CSS necessary for React?, https://forum.freecodecamp.org/t/is-knowledge-of-css-necessary-for-react/179104
This tutorial combines HTML, CSS and very little bit of JavaScript: HTML CSS and Javascript Website Design Tutorial – Beginner Project Fully Responsive, https://www.youtube.com/watch?v=FazgJVnrVuI, 1 hr. 25 mins, published on 14 Sep. 2020 by Brian Design. Final source code can be downloaded.
This tutorial has little more of JavaScript than above: HTML CSS Javascript Website Tutorial – Responsive Beginner JS Project with Smooth Scroll, https://www.youtube.com/watch?v=3-2Pj5hxwrw , 2 hrs 5 mins, published on 25 Sep. 2020 by Brian Design. Final source code can be downloaded.
CSS Frameworks and Pre-processor(s)
Semantic UI
- Semantic ui library CSS classes. Ref: https://semantic-ui.com/ and https://cdnjs.com/libraries/semantic-ui .
- How to Link Semantic Ui CDN to React in Visual Studio Code 2020, https://www.youtube.com/watch?v=-tromt8uH5E , 4 min. 22 secs.
- Semantic UI In 60 Minutes, https://www.youtube.com/watch?v=a9mUH1EWp40 , 58 min. 29 secs.
- Semantic UI website shows various user interface elements which its CSS file provides, and the HTML code to be used to have such user interface elements. E.g. The Semantic UI button element page: https://semantic-ui.com/elements/button.html .
- Learn How to Code Using Bootstrap 5 Tutorial 2023!, https://www.youtube.com/watch?v=g9b4LjYrsUQ , 19 min. 14 secs.
- Build fast, responsive sites with Bootstrap, https://getbootstrap.com/ “Powerful, extensible, and feature-packed frontend toolkit. Build and customize with Sass, utilize prebuilt grid system and components, and bring projects to life with powerful JavaScript plugins.”
- https://getbootstrap.com/docs/5.3/getting-started/introduction/
- Sass in 100 Seconds, https://www.youtube.com/watch?v=akDIJa0AP5c, 2 min. 30 secs, published Apr 27, 2021 by Fireship
JavaScript
JavaScript Tutorial, https://www.w3schools.com/js/default.asp . [Seems to be comprehensive and good enough for me to quickly understand new features and refresh my knowledge about old features except for few topics like promises, async/await, fetch where I think some other tutorials are better (if I recall correctly).]
JavaScript Versions, https://www.w3schools.com/js/js_versions.asp
ECMAScript is JavaScript official name. ES6 is an abbreviation of ECMAScript first released in 2015. Since 2016 the versions are said to be named by year (but also seem to be referred to as ES6, e.g. ES6 ECMAScript 2020).
To open (JavaScript) console in Chrome, use Ctrl+Shift+J. [Inspect and then clicking on Console tab is a two-step way]
JavaScript Let (and difference with var), https://www.w3schools.com/js/js_let.asp .
forEach: https://www.w3schools.com/jsref/jsref_foreach.asp
(` backtick usage): JavaScript Template Literals, https://www.w3schools.com/js/js_string_templates.asp [Also see test file/program: BackTickTemplateLiteralSample\index.html]
JavaScript Double (==) equals vs Triple (===) equals, https://reactgo.com/javascript-double-vs-triple-equals/
JavaScript Objects, https://www.w3schools.com/js/js_objects.asp
From https://www.w3schools.com/js/js_const.asp : (in my own words) In the context of an object or array, Const defines a constant reference but the properties of the object and the elements of the array can be changed.
JavaScript Array find(), https://www.w3schools.com/jsref/jsref_find.asp
What is function chaining in JavaScript?, https://www.tutorialspoint.com/what-is-function-chaining-in-javascript
JavaScript Object Constructors, https://www.w3schools.com/js/js_object_constructors.asp
Javascript Array.prototype.filter(), https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
Javascript Array.prototype.slice(), https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
Javascript Array.prototype.join(), https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join
Javascript creating objects – multiple approaches, any differences?, https://stackoverflow.com/questions/16109108/javascript-creating-objects-multiple-approaches-any-differences covers factory function which is used or something similar is used in Node js tutorial.
Javascript Short Circuiting Operators, https://www.geeksforgeeks.org/javascript-short-circuiting/ [AND(&&) short circuit, OR(||) short circuit]
Object destructuring, spread and rest
let sortedProducts = products;
As per my understanding, above statement would have two references of sortedProducts and products to same array.
For more, see JavaScript Spread Operator, https://www.geeksforgeeks.org/javascript-spread-operator/
const { id, name, image } = product;
Above statement destructures product into 3 consts of id, name and image which can be used later, as is used in this statement:
return { id, name, image };
JavaScript Arrow Function, https://www.w3schools.com/js/js_arrow_function.asp .
(Arrow Functions) => Explained (blog post), https://blog.webdevsimplified.com/2020-09/arrow-functions/ . Same is covered in this video: JavaScript ES6 Arrow Functions Tutorial, https://www.youtube.com/watch?v=h33Srr5J9nY , 9 min. 31 secs, published on Jan. 3, 2019 by Web Dev Simplified [Created test program ArrowFunctionTut\script.js based on above article code.]
Promise and Async/Await
The JavaScript language -> Promises, async/await, https://javascript.info/promise-basics [Created test program PromiseTut\PromiseTest.js.]
Promise explanation in w3schools, https://www.w3schools.com/js/js_promise.asp is significantly different from https://blog.webdevsimplified.com/2021-09/javascript-promises/ . The w3schools explanation uses promise.then(fn1, fn2) code whereas webdevsimplified.com uses promise.then.catch code, and the latter seems to be more in regular use. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise has a diagram which suggest both of the above code styles are OK! But the description is too complex. I think blog.webdevsimplified.com is the best among the 3 for learning. It also has examples of chained .then. After going through it, going through its fetch API post: https://blog.webdevsimplified.com/2022-01/js-fetch-api/ , makes it easier to understand the latter. w3schools fetch tutorial page: https://www.w3schools.com/js/js_api_fetch.asp is just too minimal. https://blog.webdevsimplified.com/2021-11/async-await/ covers async/await well. w3c async/await page, https://www.w3schools.com/js/js_async.asp is somewhat confusing.
JavaScript Promises In 10 Minutes, https://www.youtube.com/watch?v=DHvZLI7Db8E , 11 mins. 30 secs, published on Jan. 17, 2019 by Web Dev Simplified
From async function, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
Async functions always return a promise. If the return value of an async function is not explicitly a promise, it will be implicitly wrapped in a promise.
For example, consider the following code:
return 1;
}
It is similar to:
return Promise.resolve(1);
}
From Promise.resolve(), https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve
The Promise.resolve() static method “resolves” a given value to a Promise. If the value is a promise, that promise is returned; if the value is a thenable, Promise.resolve() will call the then() method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value.
…
From await, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await
The await operator is used to wait for a Promise and get its fulfillment value. It can only be used inside an async function or at the top level of a module.
…
If the promise is rejected, the await expression throws the rejected value.
Event Bubbling
What is an event loop in JavaScript ?, https://www.geeksforgeeks.org/what-is-an-event-loop-in-javascript/
The event loop, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Event_loop
Object Prototypes
Object prototypes, https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object_prototypes
A Beginner’s Guide to JavaScript’s Prototype, https://www.freecodecamp.org/news/a-beginners-guide-to-javascripts-prototype/
JavaScript Object Prototypes, https://www.w3schools.com/js/js_object_prototypes.asp
Prototype vs Class in JavaScript, https://www.turing.com/kb/prototype-vs-class-in-js
JSON
JSON Syntax, https://www.w3schools.com/js/js_json_syntax.asp
JSON.stringify(), https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
(JavaScript) Response: json() method, https://developer.mozilla.org/en-US/docs/Web/API/Response/json, “The json() method of the Response interface takes a Response stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON.” .. “Note that despite the method being named json(), the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object.”
JSON viewer chrome extension: https://chromewebstore.google.com/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh?pli=1
Nice online JSON editor: https://jsoneditoronline.org/ .
Fetch
Quite extensive info. on using fetch including posting form data or json data: Using the Fetch API, https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
Handling res.ok being false errors in fetch is covered in these two posts:
- (Using fetch .then): Do you know why we check for response.ok while using fetch, https://dev.to/myogeshchavan97/do-you-know-why-we-check-for-response-ok-while-using-fetch-1mkd
- (Using fetch async await): Safe Data Fetching and Improving Error Handling with Fetch API in Modern JavaScript, https://medium.com/@zamin_mirzad/safe-data-fetching-and-improving-error-handling-with-fetch-api-in-modern-javascript-f0e1347d2099
- To Test fetch: https://jsonplaceholder.typicode.com/ ... VSCode project: D:\Users\Ravi-user\vsc-source\HCJProj\JStest\testfetch. Use LiveServer to serve index.html which links to JavaScript file having fetch. On browser use Inspect and Console in it, to view log data.
- 1.1: fetch() – Working With Data & APIs in JavaScript, https://www.youtube.com/watch?v=tc8DU14qX6I, 15 min. 38 secs. published on May 17, 2019 by The Coding Train, Github: https://github.com/CodingTrain/Intro-to-Data-APIs-JS. Above video looks at image fetch. A later video is said to look at CSV file data fetch but I have not seen it yet.
Notes on using Axios on frontend/browser, https://raviswdev.blogspot.com/2024/03/notes-on-using-axios-on-frontendbrowser.html.
Seems worth checking out: Axios Tutorial – Part 1 | Axios Get Post Put Delete Example Tutorial | Axios Tutorial Node js (3 part video series), https://www.youtube.com/watch?v=WoUwtDGdF6k , 14 min. 17 secs., published on Dec. 22, 2022 by ARCTutorials.
Error Handling
Error() constructor, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error
Custom errors, extending Error, https://javascript.info/custom-errors
Interesting video for quick coverage of JavaScript along with one small game project and a web app project using HTML, CSS and JS: Notes on freeCodeCamp.org Full Stack Web Development for Beginners video, https://raviswdev.blogspot.com/2024/03/notes-on-freecodecamporg-full-stack-web.html.
JavaScript Programming – Full Course, https://www.youtube.com/watch?v=jS4aFq5-91M , 7 hrs. 44 mins, published Jun 21, 2021 by freeCodeCamp.org (Created by Per Harald Borgen). [Claims to be part of Front End Developer Learning Path ... https://github.com/scrimba/learn-javascript ...Projects in the video: Passenger counter app, Blackjack game, (build) Chrome extension
JavaScript Crash Course – Tutorial for Complete Beginners, https://www.youtube.com/watch?v=XIOLqoPHCJ4 , 1 hr. 20 mins, published Feb 6, 2022 by Codevolution
Advanced JavaScript Crash Course, https://www.youtube.com/watch?v=R9I85RhI7Cg , 1 hr. 4 mins, published Feb 13, 2022 by Codevolution
Asynchronous JavaScript Crash Course, https://www.youtube.com/watch?v=exBgWAIeIeg , 1 hr. 28 mins, published Feb 20, 2022 by Codevolution
At the beginning of the video, the teacher says, “In this course, we’re going to learn how to build complex websites using JavaScript from a beginner to a professional level, and by the end of this course, we’re going to build amazon.com.” and shows screenshots of that app.
JavaScript Full Course (2023) – Beginner to Pro – Part 2 Lesson 14, https://www.youtube.com/watch?v=2exKokkn8o0 , 1 hr. 28 mins.
Long (3.5 hrs) video tutorial to browse through for specific topics (e.g. Arrow function) or to have a detailed beginner view of JavaScript: Learn JavaScript – Full Course for Beginners, https://www.youtube.com/watch?v=PkZNo7MFNFg, 3 hrs. 26 mins, published on 10 Dec. 2018 by freeCodeCamp.org.
https://www.youtube.com/@WebDevSimplified/search?query=javascript%20projects : Link for search for javascript projects In Web Dev Simplified youtube channel which lists a few such project videos. I have not checked it out but they could be interesting as the teacher seems to be pretty good.
OMBD#4: Quick Async One-Liners With Async Immediately Invoked Function Expressions, https://itnext.io/1-minute-to-become-a-better-developer-4-aeabd6586396
Node.js and Express.js
Node.js and Express.js – Full Course, https://www.youtube.com/watch?v=Oe421EPjeBE , 8 hrs. 16 mins, published on Apr 1, 2021 by freeCodeCamp.org. Code: https://github.com/john-smilga/node-express-course
Above Node.js and Express.js tutorial video has an audio lag (lagging behind video) issue. Put up the following comment on the video: “Great video. Many thanks. But I am facing an audio lag (of around 15 seconds behind the video). At times I don’t follow a video part due to the audio lag. Replaying that video part usually helps me understand the part. I could not figure out a way in youtube settings to fix this audio lag. Going by some comments, I think others have also faced this issue. Does anybody have any solution to it? Thanks.”
[Not setup as a regular tutorial but has some useful background info. about Node.js:] Learn Node.js®, https://nodejs.org/en/learn
Seems to be Reference pages: https://nodejs.org/docs/latest/api/
The Node.js Event Loop, Timers, and process.nextTick(), https://nodejs.org/en/guides/event-loop-timers-and-nexttick#what-is-the-event-loop
express.Router section (towards end of page) in Routing, https://expressjs.com/en/guide/routing.html
- JavaScript require vs import, https://flexiple.com/javascript/javascript-require-vs-import
- – — — — — CommonJS vs AMD vs RequireJS vs ES6 Modules — — —, https://medium.com/computed-comparisons/commonjs-vs-amd-vs-requirejs-vs-es6-modules-2e814b114a0b
- JavaScript modules, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
- JavaScript Require – How to Use the require() Function in JS, https://www.freecodecamp.org/news/how-to-use-the-javascript-require-function/
- Node.js Require vs Import, https://www.scaler.com/topics/nodejs/require-vs-import-nodejs/
- module.exports – How to Export in Node.js and JavaScript, https://www.freecodecamp.org/news/module-exports-how-to-export-in-node-js-and-javascript/
- [Covers require/module.exports (CommonJS) as well as import/export (ESmodules)] Modules in JavaScript – CommonJS and ESmodules Explained, https://www.freecodecamp.org/news/modules-in-javascript/
Following article gives some info. on usage of “node:xx” in require as against simply “xx”: What are the node:fs, node:path etc. modules? https://stackoverflow.com/questions/67554506/what-are-the-nodefs-nodepath-etc-modules . The key info. seems to be that node: prefix identifies the module as a core module and so bypasses the require cache.
Info. about underscore and lodash js libraries which use only _ (variable?) which is used around 2 hrs 0 min. point in above Node.js and Express.js – Full Course video:
- Example of _ usage: https://www.tutorialspoint.com/underscorejs/underscorejs_environment.htm
- https://underscorejs.org/
- https://www.npmjs.com/package/underscore
- https://lodash.com/
Around 2 hrs, 5 mins in above video, git commands are used. As of now, it is not clear to me whether for my needs, these git commands have to be understood. The point being explained in this part of the video is that after cloning the project without node modules, npm install does the task of going through dependencies in package.json and installing them, thus making the cloned project complete (with node modules).
How To Use Nodemon With Node.js, https://vegibit.com/how-to-use-nodemon-with-node-js
If content-type is not shown in Chrome Inspect Network Response header, try checking “Disable Cache” in panel near top of Inspect window and refresh. For me, that worked (content-type was shown and as application/json).
https://react-projects.netlify.app/ and https://react-project-6-tabs.netlify.app/ are the urls to bring up pages mentioned in NodeJS tutorial around 5 hrs. 23 mins.
Hacker News algolia api, https://hn.algolia.com/api
Postman app: https://www.postman.com/downloads/
2nd in series: Node.js Projects, https://www.youtube.com/watch?v=rltfdjcXjmk , around 10 hrs, published on Sep. 21, 2021 by Coding Addict. [This video follows up on Node.js and Express.js tutorial video. It covers MongoDB and Mongoose in the first project (TASK MANAGER). This coverage is from beginning of video till around 3 hrs 7 mins after which the next project (STORE API) starts. More about this part of the video is covered in the MongoDB and Mongoose related section.]
Notes about asyncWrapper function, https://raviswdev.blogspot.com/2024/03/notes-about-asyncwrapper-function.html.
Error handling
How do I handle 404 responses? section in FAQ, https://expressjs.com/en/starter/faq.html
Error Handling, http://expressjs.com/en/guide/error-handling.html#error-handling
Writing error handlers, https://expressjs.com/en/guide/error-handling.html#writing-error-handlers
Have not checked it out but may be worth checking out: Node.js Full Course for Beginners | Complete All-in-One Tutorial | 7 Hours, https://www.youtube.com/watch?v=f2EqECiTBL8, 6 hrs 50 mins, published on Dec 3, 2021 by Dave Gray
Learn CORS In 6 Minutes, https://www.youtube.com/watch?v=PNtFSVU-YTI, 6 min. 5 secs., published on May 22, 2021 by Web Dev Simplified. Associated blog post: CORS (Cross-Origin Resource Sharing), https://blog.webdevsimplified.com/2021-05/cors/ , May 3, 2021.
MongoDB and Mongoose
Getting Started with MongoDB Atlas – A Modern Database!, https://www.youtube.com/watch?v=bBA9rUdqmgY , 19 min. 55 secs, published on Sep. 20, 2022 by MongoDB
Getting Started with MongoDB & Mongoose ODM (Object Data Modeling) Library, https://www.youtube.com/watch?v=bALyYC10ABw, 21 mins., published on May 24, 2022 by MongoDB
As mentioned earlier, Node.js Projects, https://www.youtube.com/watch?v=rltfdjcXjmk , around 10 hrs, published on Sep. 21, 2021 by Coding Addict follows up on Node.js and Express.js tutorial video and covers MongoDb and Mongoose in the first project (TASK MANAGER). This coverage is from beginning of video till around 3 hrs 7 mins.
[Then choose Atlas UI.]
The user interface is significanly different from the Node projects video.
To get connection string of default created database in Atlas MongoDB:
1) Go to Project (Project 0 was auto created in my case)
2) In the left pane click DEPLOYMENT -> Database
3) In the main pane, click Cluster 0 -> Connect
4) In the dialog, click Drivers under Connect to your application
5) Step 3 shows the connection string with a copy button.
“npm install mongoose” seems to be optional but no harm in running it. I ran it and it reported it is ‘up to date’. I am not sure if any packages were installed when I ran it. Perhaps npm install mongodb installs mongoose too?
Notes-Log about mongoDB access via mongoose errors after installation, https://raviswdev.blogspot.com/2024/03/notes-log-about-mongodb-access-via.html .
Example of such alias usage in Node Express and MongoDB/Mongoose video:
const { id: taskID } = req.params
id is destructured from params, and assigned an alias of taskID. Later code can refer to id as taskID.
Models
From the above: “Models are fancy constructors compiled from Schema definitions. An instance of a model is called a document. Models are responsible for creating and reading documents from the underlying MongoDB database.”
module.exports = mongoose.model(‘Task’, TaskSchema)
Now my understanding is that what is returned by mongoose.model(‘Task’, TaskSchema) is what is exported.
But what does mongoose.model(‘Task’, TaskSchema) return?
https://mongoosejs.com/docs/models.html states, “When you call mongoose.model() on a schema, Mongoose compiles a model for you.”
“A Model is a class that’s your primary tool for interacting with MongoDB. An instance of a Model is called a Document.
model with lowercase ‘m’ is a method/function of mongoose module. Model with uppercase ‘M’ is a class (which should not be used directly).
https://mongoosejs.com/docs/validation.html
Model Queries (includes find methods)
findOne() needs to be chained to .exec(), but findOneAndDelete() does not have to be OR should not be chained to .exec(). It is not clear to me from mongoose docs why that is the case.
As per tutorial video, when we use PUT method, the corresponding controller code should use additional option of overwrite: true when using findOneAndUpdate(). But current mongoose version docs do not show that option (perhaps it has been removed now). https://www.mongodb.com/community/forums/t/overwrite-true-not-working-in-findoneandupdate-in-mongodb/217812/3 suggests that Model.findOneAndReplace(), https://mongoosejs.com/docs/api/model.html#Model.findOneAndReplace() could be used. I think the right thing to do is to use PATCH and not spend time, as of now at least, on trying out Model.findOneAndReplace(), as PATCH seems to be the recommended way as against PUT.
https://mongoosejs.com/docs/queries.html
“Queries are Not Promises
Mongoose queries are not promises. Queries are thenables, meaning they have a .then() method for async/await as a convenience. However, unlike promises, calling a query’s .then() executes the query, so calling then() multiple times will throw an error.”
ReactJS
Do You Know Enough JavaScript To Learn React, https://www.youtube.com/watch?v=JR9wsVYp8RQ, 6 min. 27 secs., published on Dec 14, 2021 by Web Dev Simplified
How to run React JS app in Visual studio code tutorial | Download and install react in VS Code 2023, https://www.youtube.com/watch?v=zuyH4QUuTZk, 11 mins.
How to Install React App In VsCode 2023, https://medium.com/@chauhanomprakash7206/how-to-install-react-app-in-vscode-2023-7cf3eb057a3c
React installation on Windows: Fixing npm ERR! enoent ENOENT, https://raviswdev.blogspot.com/2024/03/react-installation-on-windows-fixing.html .
The main React tutorial (Dave Gray tutorial given below) I have used, uses Create React App (CRA). But ... Create React App is Officially DEAD!, https://www.youtube.com/watch?v=KhBj0g9DNzY , 5 min. 33 secs. Even if it is 'dead', Create React App can still be used, and I used it a lot while going through not only the Dave Gray tutorial but also some other React tutorials.
The alternative is Vite. I have used it and found it to be good. For more on it, see Vite, Console Ninja, https://raviswdev.blogspot.com/2024/03/vite-console-ninja.html . However while going through the tutorials using CRA, I chose to mainly use CRA.
Notes on JSX, https://raviswdev.blogspot.com/2024/03/jsx.html
The Best Guide to Know What Is React, https://www.simplilearn.com/tutorials/reactjs-tutorial/what-is-reactjs
React JS Full Course for Beginners | Complete All-in-One Tutorial | 9 Hours, https://www.youtube.com/watch?v=RVFAyFWO4go , 8 hr 49 min, published on Sep 10, 2021 by Dave Gray. Source code: https://github.com/gitdagray/react_resources
Update video: React Router v6 in 20 Minutes | RRv6 Upgrade & Refactor Tutorial, https://www.youtube.com/watch?v=XBRLVRjZ3CQ , 21 min, published on Dec 7, 2021 by Dave Gray. [Source code for update too, is provided in above main video link.]
Procedure to build React tutorial project from its source files, https://raviswdev.blogspot.com/2024/03/procedure-to-build-react-tutorial.html.
Building React Router part of Dave Gray tutorial, https://raviswdev.blogspot.com/2024/03/building-react-router-part-of-dave-gray.html
Notes on React useEffect, https://raviswdev.blogspot.com/2024/02/notes-on-react-useeffect.html
- ReactJS Tutorial – 2 – Hello World, https://www.youtube.com/watch?v=9hb_0TZ_MVI&list=PLC3y8-rFHvwgg3vaYJgHGnModB54rxOk3&index=2
- ReactJS Tutorial – 3 – Folder Structure (the name is a misnomer as it covers more than folder structure), https://www.youtube.com/watch?v=9VIiLJL0H4Y , 5 min. 34 secs. Very useful video as it covered the role of most files and folders of the simple app. created by create-react-app . Helps to understand how the HTML, JavaScript and react components tie in in this simple app., to render the final output on the browser.
- Good short video on Props: ReactJS Tutorial – 9 – Props, https://www.youtube.com/watch?v=m7OWXtbiXX8 , 11 min. 36 secs.
- ReactJS Tutorial – 10 – State, https://www.youtube.com/watch?v=4ORZ1GmjaMc , 10 min. 34 secs.
- ReactJS Tutorial – 15 – Methods as props, https://www.youtube.com/watch?v=QpfyjwhY9kg , 8 min. 44 secs.
- ReactJS Tutorial – 16 – Conditional Rendering, https://www.youtube.com/watch?v=7o5FPaVA9m0 , 11 min. 45 secs.
- ReactJS Tutorial – 17 – List Rendering, https://www.youtube.com/watch?v=5s8Ol9uw-yM , 11 min. 56 secs. [React Lists, https://www.javatpoint.com/react-lists ]
- ReactJS Tutorial – 18 – Lists and Keys, https://www.youtube.com/watch?v=0sasRxl35_8 , 7 min. 31 secs.
- ReactJS Tutorial – 20 – Styling and CSS Basics, https://www.youtube.com/watch?v=j5P9FHiBVNo , 11 min. 39 secs.
Git
Git, GitHub, & GitHub Desktop for beginners, https://www.youtube.com/watch?v=8Dd7KRpKeaE , 22 min. 15 secs. More details
git init, git add ., git commit and git push are the key commands ... To add files to local git repo, commit and push to Github repo, see: Steps to deploy React app on Netlify and push later changes, https://raviswdev.blogspot.com/2024/03/steps-to-deploy-react-app-on-netlify.html . This post also covers how to add changed files to staging area, commit and push to Github.
2.2 Git Basics - Recording Changes to the Repository, https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository
'git status' lists the changed files (staged and not staged).
'git add .' seems to add only the modified files (and perhaps new files though I have not tested it with new file case) to staging area as afterwards, git status shows the modified files under "Changes to be committed" (before 'git add .', it shows them under "Changes not staged for commit").
Git Remote, https://github.com/git-guides/git-remote
Besides 'git status', 'git log', 'git log --stat' and 'git remote -v' are useful commands to inspect a local repo. [On my PC, "cawv-1406-blog-netlify-deploy-info\info-log.txt" file captures the output of such inspection of a local repo.]
'git diff' seems to show difference between current project code and last committed git local repo code. Ref. page: https://git-scm.com/docs/git-diff uses somewhat different language (index, staging area etc.) but I think it means the same. When I used the command, the output showed differences between current project code and last committed git local repo code.
To scroll through the output:
Enter: next line
Up arrow, Down arrow: scroll up/down one line
Page Up, Page Downw: scroll up/down one page
Mouse wheel can be used to scroll up and down
Q: to quit
Github
[Repeat of above entry:] Git, GitHub, & GitHub Desktop for beginners, https://www.youtube.com/watch?v=8Dd7KRpKeaE , 22 min. 15 secs. More details
Using Git and GitHub from Visual Studio Code
Using Git with Visual Studio Code (Official Beginner Tutorial), https://www.youtube.com/watch?v=i_23KUAEtUM, 6 min. 55 secs. More details
Clone and use a GitHub repository in Visual Studio Code, https://learn.microsoft.com/en-us/azure/developer/javascript/how-to/with-visual-studio-code/clone-github-repository
Comments
Post a Comment