Posts

Showing posts with the label 2025

Setup & CRUD PostgreSQL, Nodejs as backend

What is PostgreSQL PostgreSQL, or Postgres, is a free, open-source relational database system that competes with MySQL, SQL Server, and MariaDB. Since 1997, it has been known for its reliability, flexibility, and compliance with standards, making it a popular choice for developers and companies. What is node-postgres? Node-postgres (pg) is a non-blocking PostgreSQL client for Node.js, providing a set of modules to interact with PostgreSQL databases. It supports features like callbacks, promises, async/await, connection pooling, prepared statements, cursors, advanced type parsing, and C/C++ bindings. Install PostgreSQL Installer Windows Installer   For Mac:  brew install postgresql To start services brew services start postgresql ==> Successfully started `postgresql@14` (label: homebrew.mxcl.postgresql@14) To stop services brew services stop postgresql ==> Successfully stopped `postgresql@14` (label: homebrew.mxcl.postgresql@14) Connect to Postgres’s  psql postg...

Create your first website with Home, Contact us, Register, Login Pages

Image
Create a Folder Structure for Your Website 1. Create a folder named MyFirstWebsite . 2. Inside the MyFirstWebsite folder, create the following HTML files: index.html (Home page) contact.html (Contact Us page) register.html (Registration page) login.html (Login page) MyFirstWebsite/ │ ├── index.html ├── contact.html ├── register.html ├── login.html └── main.css Note: why the main HTML file is named index.html 1. Default Behavior: Most web servers automatically serve index.html when a directory is accessed (e.g., http://example.com/). 2. Organizational Convention: It clearly indicates the starting point of a website, making projects easier to navigate. 3. SEO and Usability: Enhances usability for users and search engines by providing a clear homepage. 4. Historical Context: This naming convention has been widely accepted since the early days of the web. Using index.html ensures compatibility with hosting services and improves site navigation. File Content index.html <!DOCTYPE html...