Skip to content

Instantly share code, notes, and snippets.

View mahmoudalnkeeb's full-sized avatar

Mahmoud Alnakeeb mahmoudalnkeeb

View GitHub Profile

JWT-Based Authentication and Authorization System in Node.js

1. User Registration:

  • Users provide registration details (e.g., username, email, password) through a registration form.
  • Server receives the registration request, validates the input data, and securely hashes the password before storing it in the database.
  • Upon successful registration, the server responds with a success message or redirects the user to the login page.

2. User Authentication:

  • Users provide login credentials (username/email and password) through a login form. The server validates the credentials, checks the user's existence, and verifies the provided password against the stored hashed password.
@mahmoudalnkeeb
mahmoudalnkeeb / Comprehensive Guide to Database Normalization.md
Last active May 19, 2024 22:35
This concise guide covers database normalization principles, including 1NF, 2NF, 3NF, BCNF, 4NF, 5NF, functional dependencies, multi-valued dependencies, and denormalization. Learn how to organize data efficiently and maintain data integrity while minimizing redundancy.

Principles of Database Normalization

Database normalization is a systematic approach to organizing data in a database to reduce redundancy and improve data integrity. The process involves decomposing large tables into smaller, related tables and defining relationships between them. Normalization typically progresses through several forms, each addressing specific types of anomalies and dependencies.

First Normal Form (1NF)

1NF requires that each column in a table contains atomic (indivisible) values and that each column contains only one type of data.

Example: A table with multiple phone numbers in one column is not in 1NF. To convert it, split the phone numbers into separate rows:

@mahmoudalnkeeb
mahmoudalnkeeb / PostGreSQL_Syntax.md
Last active February 2, 2022 18:52
contains PostgreSQL basic syntax

PostGres Basic Syntax

meta commnds

 \c connect
 \q exit
 \dt display table
 \l list of databases

create database