An open API service indexing awesome lists of open source software.

https://github.com/helloimkevo/udemyfullstackwebreact

Udemy course for Full-Stack Web Development with JS, Node, React and PostgreSQL.
https://github.com/helloimkevo/udemyfullstackwebreact

html-css javascript node postgresql react reactjs web3

Last synced: 5 months ago
JSON representation

Udemy course for Full-Stack Web Development with JS, Node, React and PostgreSQL.

Awesome Lists containing this project

README

          

# Full-Stack Web Development Quick Start Guide

A comprehensive guide for setting up a complete full-stack web development environment using HTML, CSS, JavaScript, Node.js, React, PostgreSQL, Web3, and DApps. This repository serves as a reference point for enterprise-level application development.

## 🎯 Project Overview

Become a Full-Stack Web Developer with this reference project covering:

### Front-End Technologies

- **HTML 5** - Modern markup language for web structure
- **CSS 3** - Advanced styling with Flexbox and Grid
- **Bootstrap 5** - Responsive UI framework
- **JavaScript ES6+** - Modern JavaScript features and syntax
- **React.js** - Component-based UI library with Hooks
- **DOM Manipulation** - Direct browser API interaction
- **jQuery** - JavaScript library for simplified DOM operations

### Back-End Technologies

- **Node.js** - JavaScript runtime for server-side development
- **Express.js** - Web application framework for Node.js
- **EJS** - Templating engine for dynamic content
- **REST APIs** - RESTful web service architecture
- **Authentication** - User login and security systems

### Templating Languages

Templating languages allow you to generate dynamic HTML by embedding programming logic into HTML templates. They enable separation of presentation (HTML) from business logic (JavaScript/Python/PHP).

#### **EJS (Embedded JavaScript)**
- **Language**: JavaScript
- **Framework**: Express.js (Node.js)
- **Syntax**: `<%= variable %>` for output, `<% code %>` for logic
- **Use Case**: Simple, JavaScript-based templating for Node.js applications

```ejs

Welcome <%= username %>!


<% if (isLoggedIn) { %>

You are logged in


<% } else { %>

Please log in


<% } %>


    <% items.forEach(function(item) { %>
  • <%= item.name %>

  • <% }); %>

```

#### **Handlebars**
- **Language**: JavaScript
- **Framework**: Express.js, Ember.js
- **Syntax**: `{{variable}}` for output, `{{#if}}` for logic
- **Use Case**: Logic-less templates with minimal programming constructs

```handlebars

Welcome {{username}}!


{{#if isLoggedIn}}

You are logged in


{{else}}

Please log in


{{/if}}


    {{#each items}}
  • {{this.name}}

  • {{/each}}

```

#### **Pug (formerly Jade)**
- **Language**: JavaScript
- **Framework**: Express.js (Node.js)
- **Syntax**: Indentation-based, no closing tags
- **Use Case**: Clean, concise templates with minimal syntax

```pug
// Pug Example
h1 Welcome #{username}!
if isLoggedIn
p You are logged in
else
p Please log in

ul
each item in items
li= item.name
```

#### **Twig**
- **Language**: PHP
- **Framework**: Symfony, Laravel (Blade is more common)
- **Syntax**: `{{ variable }}` for output, `{% code %}` for logic
- **Use Case**: Secure, fast templating for PHP applications

```twig
{# Twig Example #}

Welcome {{ username }}!


{% if isLoggedIn %}

You are logged in


{% else %}

Please log in


{% endif %}


    {% for item in items %}
  • {{ item.name }}

  • {% endfor %}

```

#### **Jinja2**
- **Language**: Python
- **Framework**: Flask, Django (uses its own template engine)
- **Syntax**: `{{ variable }}` for output, `{% code %}` for logic
- **Use Case**: Powerful templating for Python web applications

```jinja
{# Jinja2 Example #}

Welcome {{ username }}!


{% if isLoggedIn %}

You are logged in


{% else %}

Please log in


{% endif %}


    {% for item in items %}
  • {{ item.name }}

  • {% endfor %}

```

#### **Templating Language Comparison**

| Feature | EJS | Handlebars | Pug | Twig | Jinja2 |
|---------|-----|------------|-----|------|--------|
| **Language** | JavaScript | JavaScript | JavaScript | PHP | Python |
| **Syntax Style** | Embedded JS | Mustache-like | Indentation | Django-like | Django-like |
| **Learning Curve** | Easy | Easy | Moderate | Easy | Easy |
| **Logic Complexity** | Full JS | Limited | Full JS | Full PHP | Full Python |
| **Auto-escaping** | Manual | Auto | Manual | Auto | Auto |
| **Performance** | Fast | Fast | Very Fast | Fast | Fast |
| **Popular With** | Express.js | Ember.js | Express.js | Symfony | Flask |

#### **When to Use Each:**

- **EJS**: When you want JavaScript logic directly in templates and familiarity with HTML
- **Handlebars**: When you need logic-less templates and reusable components
- **Pug**: When you prefer clean, minimal syntax and don't mind learning new syntax
- **Twig**: When building PHP applications, especially with Symfony framework
- **Jinja2**: When developing Python web applications with Flask

#### **Common Features:**

- **Variable Output**: Display dynamic data
- **Conditionals**: If/else logic for conditional rendering
- **Loops**: Iterate over arrays and objects
- **Partials/Includes**: Reusable template components
- **Filters**: Transform data during output (e.g., uppercase, date formatting)
- **Inheritance**: Extend base templates for consistent layouts

#### **Installation Examples:**

```bash
# EJS
npm install ejs

# Handlebars
npm install express-handlebars

# Pug
npm install pug

# Twig (PHP - via Composer)
composer require "twig/twig:^3.0"

# Jinja2 (Python - via pip)
pip install Jinja2
```

#### **Express.js Setup Examples:**

```javascript
// EJS Setup
app.set('view engine', 'ejs');
app.render('index', { username: 'John' });

// Handlebars Setup
const exphbs = require('express-handlebars');
app.engine('handlebars', exphbs());
app.set('view engine', 'handlebars');

// Pug Setup
app.set('view engine', 'pug');
app.render('index', { username: 'John' });
```

### Database & Storage

- **SQL** - Structured Query Language fundamentals
- **PostgreSQL** - Advanced open-source relational database
- PostgreSQL Download: https://www.postgresql.org/download/

### Development Tools & Workflow

- **NPM** - Node Package Manager for dependency management
- **Git & GitHub** - Version control and collaboration
- **Bash Command Line** - Terminal/shell scripting
- **VS Code** - Primary development environment

### Advanced Topics

- **Web3 Development** - Blockchain and decentralized applications
- **Internet Computer** - Modern blockchain platform
- **Token Contracts** - Smart contract development
- **NFT Development** - Non-fungible token creation and marketplace logic
- **Deployment** - GitHub Pages and production hosting

---

## 🚀 Development Environment Setup

### Prerequisites for All Platforms

#### 1. Install Visual Studio Code

VS Code is a free, powerful code editor from Microsoft that will be your primary development environment.

**Download:** https://code.visualstudio.com/

**Key Features:**

- IntelliSense code completion
- Integrated terminal
- Git integration
- Extensive extension marketplace
- Cross-platform support

#### 2. Install Google Chrome

Chrome provides the best developer tools suite for web development, even if you prefer another browser for daily use.

**Download:** https://www.google.com/intl/en_uk/chrome/

**Developer Tools Include:**

- Element inspector
- Network monitoring
- JavaScript debugger
- Performance profiling
- Security analysis

#### 3. Essential VS Code Extensions

Install these extensions to enhance your development experience:

| Extension | Purpose | Install Link |
| -------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| **Live Preview** | Local development server with live reload | [Install](https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server) |
| **Prettier** | Code formatter for consistent styling | [Install](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) |
| **vscode-icons** | File and folder icons for better navigation | [Install](https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons) |
| **EJS lang support** | Support EJS templating language | [Install](https://marketplace.visualstudio.com/items?itemName=DigitalBrainstem.javascript-ejs-support) |

**Additional Recommended Extensions:**

- **ES7+ React/Redux/React-Native snippets** - React code snippets
- **Bracket Pair Colorizer** - Color-coded bracket matching
- **GitLens** - Enhanced Git capabilities
- **REST Client** - API testing within VS Code
- **PostgreSQL** - Database management tools

---

## 🍎 macOS Setup Instructions

### 1. Install Homebrew (Package Manager)

Homebrew is the most popular package manager for macOS, making software installation simple.

```bash
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Verify installation
brew --version
```

**Official Documentation:** https://brew.sh/

### 2. Install Node.js and NPM

```bash
# Install Node.js (includes NPM)
brew install node

# Verify installation
node --version
npm --version

# Install Yarn (alternative package manager)
brew install yarn
```

### 3. Install PostgreSQL & pgAdmin

This guide assumes you are using **Homebrew** on macOS.

#### Install PostgreSQL
```bash
# Install PostgreSQL
brew install postgresql@15

# Start PostgreSQL service
brew services start postgresql@15

# Verify installation
psql --version
```

#### 🔧 Troubleshooting

### Error: `zsh: command not found: psql`

If you see this error, the PostgreSQL binaries are not in your system `PATH`.

**Step 1: Verify Installation**
First, ensure the package is actually installed:
```bash
brew list postgresql@15
```
If this returns an error, install it first: `brew install postgresql@15`

**Step 2: Add to PATH (Robust Method)**
Run the following command to automatically find the correct installation path (regardless of whether you are on Intel or Apple Silicon) and add it to your shell configuration:

```bash
# 1. Add the dynamic path to your zsh configuration
echo "export PATH=\"$(brew --prefix postgresql@15)/bin:\$PATH\"" >> ~/.zshrc

# 2. Apply the changes to your current session
source ~/.zshrc
```

**Step 3: Verify**
```bash
psql --version
```

#### Install pgAdmin 4
pgAdmin is the most popular administration and development platform for PostgreSQL.

**Option 1: Install via Homebrew (Recommended)**
```bash
brew install --cask pgadmin4
```

**Option 2: Manual Download (If Homebrew fails)**
If you encounter SSL/TLS errors (e.g., `tlsv1 alert protocol version`) due to corporate firewalls or proxies:

1. Visit the official download page: [https://www.pgadmin.org/download/pgadmin-4-macos/](https://www.pgadmin.org/download/pgadmin-4-macos/)
2. Download the latest `.dmg` file manually.
3. Open the `.dmg` and drag pgAdmin 4 to your Applications folder.

**Option 3: Install via Python (CLI Alternative)**
If you prefer a CLI-based installation and have Python installed, you can install pgAdmin as a Python package:

```bash
# Create a virtual environment (recommended)
python3 -m venv pgadmin-venv
source pgadmin-venv/bin/activate

# Install pgAdmin4
pip install pgadmin4

# Run pgAdmin4
pgadmin4
```

### 4. Install Git

```bash
# Install Git
brew install git

# Configure Git with your information
git config --global user.name "Your Name"
git config --global user.email "your.email@company.com"

# Verify installation
git --version
```

### 5. Install Additional Development Tools

```bash
# Install useful development utilities
brew install curl wget tree jq

# Install API testing tool
brew install --cask postman
```

---

## 🪟 Windows Setup Instructions

### 1. Install Chocolatey (Package Manager)

Chocolatey is a package manager for Windows that simplifies software installation.

```powershell
# Run PowerShell as Administrator and execute:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

# Verify installation
choco --version
```

**Official Documentation:** https://chocolatey.org/

### 2. Install Node.js and NPM

```powershell
# Install Node.js (includes NPM)
choco install nodejs

# Verify installation
node --version
npm --version

# Install Yarn (alternative package manager)
choco install yarn
```

### 3. Install PostgreSQL

```powershell
# Install PostgreSQL
choco install postgresql

# Start PostgreSQL service
net start postgresql-x64-14

# Add PostgreSQL to PATH (restart terminal after)
# PostgreSQL should be available at: C:\Program Files\PostgreSQL\14\bin
```

### 4. Install Git

```powershell
# Install Git
choco install git

# Configure Git with your information
git config --global user.name "Your Name"
git config --global user.email "your.email@company.com"

# Verify installation
git --version
```

### 5. Install Additional Development Tools

```powershell
# Install useful development utilities
choco install curl wget

# Install database management tool
choco install pgadmin4

# Install API testing tool
choco install postman
```

---

## 📚 JavaScript Language Fundamentals

### What is JavaScript?

JavaScript is a versatile, high-level programming language that runs in web browsers and on servers (via Node.js). Originally designed for web interactivity, it has evolved into a full-stack development language.

### Key JavaScript Concepts for Beginners

#### 1. Variables and Data Types

```javascript
// Variable declarations
let name = "John"; // String
const age = 30; // Number (immutable)
var isActive = true; // Boolean (avoid var, use let/const)

// Data types
let string = "Hello World";
let number = 42;
let boolean = true;
let array = [1, 2, 3, 4];
let object = { name: "John", age: 30 };
let nullValue = null;
let undefinedValue = undefined;
```

#### 2. Functions

```javascript
// Function declaration
function greet(name) {
return `Hello, ${name}!`;
}

// Arrow function (ES6+)
const greet = (name) => `Hello, ${name}!`;

// Function with multiple parameters
const calculate = (a, b, operation) => {
switch (operation) {
case "add":
return a + b;
case "subtract":
return a - b;
default:
return 0;
}
};
```

#### 3. Objects and Arrays

```javascript
// Object creation and manipulation
const person = {
name: "Alice",
age: 25,
greet() {
return `Hi, I'm ${this.name}`;
},
};

// Array methods
const numbers = [1, 2, 3, 4, 5];
const doubled = numbers.map((n) => n * 2);
const evens = numbers.filter((n) => n % 2 === 0);
const sum = numbers.reduce((acc, n) => acc + n, 0);
```

#### 4. Async Programming

```javascript
// Promises
const fetchData = () => {
return new Promise((resolve, reject) => {
// Async operation
setTimeout(() => resolve("Data received"), 1000);
});
};

// Async/Await (modern approach)
const getData = async () => {
try {
const data = await fetchData();
console.log(data);
} catch (error) {
console.error("Error:", error);
}
};
```

### JavaScript Ecosystem Overview

#### Package Managers

- **NPM** - Default Node.js package manager
- **Yarn** - Alternative package manager with improved performance
- **PNPM** - Efficient package manager with shared dependencies

#### Key Node.js Concepts

- **Modules** - CommonJS (`require()`) and ES6 (`import/export`)
- **Event Loop** - Non-blocking I/O operations
- **Middleware** - Functions that execute during request/response cycle
- **Environment Variables** - Configuration management

---

## 🔧 Project Setup and Common Commands

### Initialize a New Project

```bash
# Create project directory
mkdir my-fullstack-app
cd my-fullstack-app

# Initialize package.json
npm init -y

# Install common dependencies
npm install express react react-dom pg dotenv
npm install -D nodemon @types/node prettier eslint
```

### Common NPM Commands

```bash
# Install dependencies
npm install # Install all dependencies
npm install package-name # Install specific package
npm install -D package-name # Install as dev dependency
npm install -g package-name # Install globally

# Run scripts
npm start # Start application
npm run dev # Start development server
npm test # Run tests
npm run build # Build for production

# Package management
npm list # List installed packages
npm outdated # Check for updates
npm update # Update packages
npm audit # Security audit
```

### Git Workflow Commands

```bash
# Repository setup
git init # Initialize repository
git clone # Clone repository
git remote add origin # Add remote repository

# Daily workflow
git status # Check file status
git add . # Stage all changes
git add # Stage specific file
git commit -m "message" # Commit changes
git push origin main # Push to remote
git pull origin main # Pull latest changes

# Branching
git branch feature-name # Create branch
git checkout feature-name # Switch branch
git checkout -b feature-name # Create and switch
git merge feature-name # Merge branch
git branch -d feature-name # Delete branch
```

---

## 🗄️ PostgreSQL Quick Reference

### Basic PostgreSQL Commands

```sql
-- Database operations
CREATE DATABASE myapp_development;
DROP DATABASE myapp_development;
\l -- List databases
\c database_name -- Connect to database

-- Table operations
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Data operations
INSERT INTO users (name, email) VALUES ('John Doe', 'john@example.com');
SELECT * FROM users;
UPDATE users SET name = 'Jane Doe' WHERE id = 1;
DELETE FROM users WHERE id = 1;

-- Useful meta commands
\dt -- List tables
\d table_name -- Describe table
\q -- Quit psql
```

### Node.js PostgreSQL Integration

```javascript
// Using pg (node-postgres) library
const { Pool } = require("pg");

const pool = new Pool({
user: "your_username",
host: "localhost",
database: "your_database",
password: "your_password",
port: 5432,
});

// Query example
const getUsers = async () => {
try {
const result = await pool.query("SELECT * FROM users");
return result.rows;
} catch (error) {
console.error("Database error:", error);
}
};
```

---

## 🌐 Web3 and Blockchain Development

### Understanding Web3

Web3 represents the next evolution of the internet, built on blockchain technology and focused on decentralization, user ownership, and trustless interactions.

#### Key Concepts:

- **Blockchain** - Distributed ledger technology
- **Smart Contracts** - Self-executing contracts with code
- **DApps** - Decentralized applications
- **Tokens** - Digital assets on blockchain
- **NFTs** - Non-fungible tokens (unique digital assets)

### Internet Computer Development

The Internet Computer is a blockchain platform that extends the internet with smart contract capabilities.

```bash
# Install DFINITY SDK
sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"

# Verify installation
dfx --version

# Create new project
dfx new my_dapp
cd my_dapp
dfx start --background
dfx deploy
```

---

## 📦 Project Structure Best Practices

### Typical Full-Stack Project Structure

```
my-fullstack-app/
├── client/ # React frontend
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── hooks/
│ │ ├── utils/
│ │ └── App.js
│ └── package.json
├── server/ # Node.js backend
│ ├── routes/
│ ├── models/
│ ├── middleware/
│ ├── config/
│ ├── app.js
│ └── package.json
├── database/ # Database scripts
│ ├── migrations/
│ ├── seeds/
│ └── schema.sql
├── docs/ # Documentation
├── .env.example # Environment variables template
├── .gitignore # Git ignore rules
├── README.md # Project documentation
└── package.json # Root package.json
```

---

## 🔍 Troubleshooting Common Issues

### Node.js Issues

```bash
# Clear npm cache
npm cache clean --force

# Reinstall node_modules
rm -rf node_modules package-lock.json
npm install

# Check Node.js version compatibility
node --version
npm --version
```

### PostgreSQL Issues

```bash
# Restart PostgreSQL service (macOS)
brew services restart postgresql@15

# Restart PostgreSQL service (Windows)
net stop postgresql-x64-14
net start postgresql-x64-14

# Check PostgreSQL status
pg_isready
```

### Git Issues

```bash
# Reset local changes
git reset --hard HEAD

# Pull latest changes (force)
git fetch origin
git reset --hard origin/main

# Fix merge conflicts
git status
# Edit conflicted files
git add .
git commit -m "Resolve merge conflicts"
```

---

## 📚 Additional Resources

### Official Documentation
- **Node.js:** https://nodejs.org/en/docs/
- **React:** https://react.dev/
- **PostgreSQL:** https://www.postgresql.org/docs/
- **Express.js:** https://expressjs.com/
- **Internet Computer:** https://internetcomputer.org/docs/

### Learning Resources
- **MDN Web Docs:** https://developer.mozilla.org/
- **MDN DOM Events:** https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Events
- **JavaScript.info:** https://javascript.info/
- **Node.js Best Practices:** https://github.com/goldbergyoni/nodebestpractices
- **React Patterns:** https://reactpatterns.com/
- **JavaScript and CSS Minifier:**: https://www.minifier.org/
- **jQuery Minified Source:** https://code.jquery.com/jquery-3.7.1.min.js
- **Collection of .gitignore templates:** https://github.com/github/gitignore
- **Learn Git Branching Interactive Demo:** https://learngitbranching.js.org/

### HTTP Status Codes
*Attributed to Sander Hoogendoorn - ditisagile.nl*

- **1xx.** Hold on
- **2xx.** Here you go
- **3xx.** Go away
- **4xx.** You f*cked up
- **5xx.** I f*cked up

### Colors, Themes, Responsive Design
- **CSS Named Colors:** https://developer.mozilla.org/en-US/docs/Web/CSS/named-color
- **Color Hunt Palettes:** https://colorhunt.co/
- **CSS Flexbox Layout Guide:** https://css-tricks.com/snippets/css/a-guide-to-flexbox/
- **CSS Flex Layout Interactive Tool:** https://appbrewery.github.io/flex-layout/
- **CSS Flexbox Froggy Game:** https://appbrewery.github.io/flexboxfroggy/
- **CSS Display Grid Weather Report:** https://aare.guru/bern/aare-wasser#bern
- **CSS Grid Garden Game:** https://appbrewery.github.io/gridgarden/
- **CSS Bootstrap Grid Px Breakpoints:** https://getbootstrap.com/docs/4.0/layout/grid/#grid-options
- **CSS Bootstrap 'Heroes' Header Component:** https://getbootstrap.com/docs/5.0/examples/heroes/

### Bootstrap Website Themes
- **Bootstrap Themes:** https://themes.getbootstrap.com/
- **Pheonix - Admin Dashboard & WebApp Template:** https://themes.getbootstrap.com/product/phoenix-admin-dashboard-webapp-template/
- **Silicon - Business / Technology Template + UI Kit:** https://themes.getbootstrap.com/product/silicon-business-technology-template-ui-kit/

### Code Style Guides
- **Idiomatic JS Guide:** https://github.com/rwaldron/idiomatic.js/

### Useful Plugins
- **HTML DOM Tree Visualization**: https://chromewebstore.google.com/detail/html-tree-generator/dlbbmhhaadfnbbdnjalilhdakfmiffeg?pli=1
- **Axios HTTP API for JavaScript:** https://axios-http.com/docs/intro

### Helpful Open Source Projects
- **Flappy Bird JS:** https://github.com/elmejdki/FlappyBird
- **Flappy Bird JS - Live Demo:** https://zakariaeelmejdki.com/FlappyBird/
- **QuakeJS by inolen:** https://github.com/inolen/quakejs
- **Awesome Selfhosted:** https://github.com/awesome-selfhosted/awesome-selfhosted
- **Wordle Clone - Word-Mastermind:** https://github.com/clupasq/word-mastermind
- **Alamofire - HTTP networking library written in Swift:** https://github.com/Alamofire/Alamofire

### Useful Tools
- **JSON Online Viewer:** https://jsonviewer.stack.hu/
- **Where the ISS at:** https://wheretheiss.at/
- **SVG Background Pattern Monster:** https://pattern.monster/
- **Rapid API Hosting:** https://rapidapi.com/hub

### Community and Support
- **Stack Overflow:** https://stackoverflow.com/
- **Reddit r/webdev:** https://www.reddit.com/r/webdev/
- **Discord/Slack Communities:** Various tech-focused servers
- **GitHub Discussions:** Platform-specific discussions

---

## 🎯 Next Steps

1. **Complete Environment Setup** - Follow the instructions for your operating system
2. **Practice JavaScript Fundamentals** - Work through basic exercises
3. **Build Sample Projects** - Start with simple HTML/CSS/JS projects
4. **Learn React Basics** - Create your first React component
5. **Set Up Database** - Create your first PostgreSQL database
6. **Build Full-Stack App** - Combine frontend and backend
7. **Explore Web3** - Start with simple smart contracts
8. **Deploy Your Applications** - Learn deployment strategies

---

_This guide serves as a comprehensive starting point for enterprise-level full-stack web development. Keep this documentation updated as new tools and best practices emerge in the rapidly evolving JavaScript ecosystem._