Lesson 5 - Set up Dev Environment
Setup Environment
Visual Studio Code
download Visual Studio Code for your platform (Windows, Mac, Linux) and install
start VS Code
Press Ctrl+Alt+I or select Use AI Features with GitHub Copilot for Free... from the Copilot menu in the title bar
Select Sign in to Use Copilot for Free to sign in to your GitHub account and sign up for Copilot Free
Install VSC extensions :
Prettier - Code formatter
Theme oh lucy
ES7+ React/Redux/React-Native snip
At Bash/Windows PowerShell terminal,
$code -v
ES7+ React/Redux/React-Native snippets
Prettier - Code formatter
ESLint
HTML Boilerplate
Live Server
NodeJS
Download the package and install latest Node.js
Update nodeJS Using the Node.js Installer (Windows and macOS)
use below npm command to upgrade npm to latest
Download and install NVM for Windows/Mac/Linux

Click on the nvm-setup.exe asset which is the installation file for the tool:
Open the file that you have downloaded, and complete the installation wizard.
At Bash/Windows PowerShell terminal,
$node -v
$node --help
$npm -v
$nvm -v
$nvm --help
Git and Git-Bash Terminal on Windows
To install Git Bash on Windows, go to the official Git for Windows website (https://git-scm.com/downloads/win), download the latest version, run the executable file, and follow the on-screen instructions, ensuring to select the "Git Bash" option during the installation process; essentially, you're installing the full Git package which includes Git Bash as a component.
How To Install Git Bash On Windows
Go to the website: Navigate to the official Git for Windows website (git-scm.com).
Download the installer: Click "Download" to get the latest version of the Git installer for Windows.
Run the installer: Open the downloaded executable file (Git-2.47.1.2-64-bit.exe).
Follow the prompts:
Accept the license agreement.
Choose the default installation directory.
Important: During the installation options, make sure to select "Add Git Bash to the PATH" or a similar option to access Git Bash from your command prompt, ensuring to select the "Git Bash" option during the installation process.
Finish installation: Click "Install" and then "Finish" to complete the process.
Generation of Disposable Temp Email
Visit https://temp-mail.org/en/ site to generate a temporary email for test.
Sign up and Sign in for Supabase
Go to https://supabase.com/dashboard/sign-up site.
Two options for sign up ::
Continue with GitHub account or
Use your email account and check your email for confirmation.
After finishing sign up, now you can sign in with your credentials
Sign up and Sign In to Postman
Go to https://www.postman.com/ site
Enter your email address for Sign Up for free. Check your email for confirmation.
After finishing sign up, now you can sign in with your credentials either by Sign In with Google or email.
Sign up and Sign In to GitHub
Go to https://github.com/signup site
Use your email to create GitHub free account
Email:
Password:
Username:Aklebek
Verify your account with visual or audio puzzle
Confirm your email address and enter code. You are all set and good to go.
Ground Up from the Base
Vite + React Project Creation
Step 1: Set Up the React App
go to vite.dev site and click get started (https://vite.dev/guide/).
Vite requires Node.js version 18+ or 20+.
check whether you already installed a right version of node.js
Open Bash/PowerShell terminal and create your working directory, ie. "react-sandbox". Change the directory to "react-sandbox" and install vite latest version.
Then follow the prompts!
Project name:react-fun-facts-yourname
Select a framework: > React
Select a variant: > JavaScript
Change the directory to "react-fun-facts-yourname". And then install and run.
Install any necessary dependencies (optional): While this basic app doesn't require additional libraries, you can install styling libraries like Bootstrap if needed:
Click : http://localhost:5173
Try our codebase example - static react app

Code base for react-fun-facts-yourname project


Understanding the Difference between export default and export with Named Exports in JavaScript
export default and export with Named Exports in JavaScriptIn JavaScript modules, export statements are used to make functions, objects, or primitive values available to other modules. There are two main ways to export: export default and named exports. Here's a breakdown of their differences:
When creating JavaScript modules, there are two common ways to export code from a file: using export default and using export with named exports.
1. export default (Default Export)
export default (Default Export)One per module: You can have only one default export per module.
Import with any name: When importing a default export, you can use any name you want.
Common use case: Typically used for exporting the primary or main functionality of a module.
Syntax:
Exporting:
JavaScript(JSX)
Importing:
JavaScript(JSX)
Example:
JavaScript(JSX)
2. Named Exports
Multiple per module: You can have multiple named exports in a single module.
Import with the same name (or alias): When importing named exports, you must use the same name as the export, or use an alias with the
askeyword.Common use case: Used for exporting multiple functions, objects, or values that are related but not necessarily the primary functionality.
Syntax:
Exporting:
JavaScript(JSX)
Importing:
JavaScript(JSX)
Example:
JavaScript(JSX)
Key Differences Summarized
Feature
export default
Named Exports
Number per module
One
Multiple
Import name
Any name
Same name (or alias)
Syntax (import)
import anyName from 'module';
import { name1, name2 } from 'module';
Use Case
Main functionality of a module
Multiple related functions, objects, or values
Export to Sheets
Which to Use?
Use
export defaultwhen you have a single primary export from a module, like a class or a function that represents the main purpose of the module.Use named exports when you have multiple related exports from a module. This improves code clarity and allows for more granular imports.
By understanding these differences, you can effectively structure your JavaScript modules and improve code organization.
Last updated