samir-ali-portfolio

๐Ÿš€ Full Stack Portfolio Website (Node.js without Express)

A dynamic full-stack portfolio website built using HTML, CSS,Tailwind CSS, JavaScript, Node.js (core HTTP module), and MySQL.

This project demonstrates deep backend understanding by implementing custom routing, request handling, and API logic without using any framework like Express.js.


๐Ÿ“Œ Overview

This is not a static portfolio โ€” it is a fully dynamic, database-driven system where all content is managed via an admin dashboard.


๐Ÿ—๏ธ Architecture

๐Ÿ“Œ Current Architecture: Monolithic (Custom Node.js Server)

Client (Browser)
      โ†“
Node.js (HTTP Module - Custom Server)
      โ†“
MySQL Database

๐Ÿง  Why No Express?

This project intentionally avoids Express to:


๐Ÿ› ๏ธ Tech Stack

Layer Technology
Frontend HTML, CSS,Tailwind CSS, JavaScript
Backend Node.js (HTTP module)
Database MySQL
Auth Google OAuth
Animation AOS (Animate on Scroll)

โœจ Features

๐Ÿ‘ค User Features

๐Ÿ” Admin Features


๐Ÿ  Home Page Sections

All sections are dynamically controlled via the database.


๐Ÿ—„๏ธ Database Schema

Main tables:

admins

CREATE TABLE admins (
  id INT AUTO_INCREMENT PRIMARY KEY,
  google_id VARCHAR(255) UNIQUE,
  name VARCHAR(100),
  email VARCHAR(100) UNIQUE,
  profile_pic TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

projects

CREATE TABLE projects (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(255),
  short_description TEXT,
  full_description TEXT,
  preview_image TEXT,
  animation_type VARCHAR(100),
  tech_stack VARCHAR(255),
  github_link VARCHAR(255),
  live_link VARCHAR(255),
  is_featured BOOLEAN DEFAULT FALSE,
  display_order INT DEFAULT 0,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

blogs

CREATE TABLE blogs (
  id INT AUTO_INCREMENT PRIMARY KEY,
  title VARCHAR(255),
  content TEXT,
  author_id INT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (author_id) REFERENCES admins(id)
);

reviews

CREATE TABLE reviews (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(100),
  role VARCHAR(100),
  message TEXT,
  rating INT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

contacts

CREATE TABLE contacts (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(100),
  email VARCHAR(100),
  message TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

sections

CREATE TABLE sections (
  id INT AUTO_INCREMENT PRIMARY KEY,
  section_name VARCHAR(100),
  title VARCHAR(255),
  content TEXT,
  image_url TEXT,
  is_active BOOLEAN DEFAULT TRUE,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Relationships

admins (1) โ†’ blogs (many)


Key Points


๐Ÿ”— API Endpoints (Custom Implementation)

All APIs are manually implemented using Node.js http module.

๐Ÿ” Authentication

๐Ÿ’ผ Projects

๐Ÿ“ Blogs

โญ Reviews

๐Ÿ“ฉ Contacts

๐Ÿงฉ Sections


๐Ÿ“ Project Structure

My-Portfolio/
โ”‚
โ”œโ”€โ”€ server.js              # Core HTTP server
โ”œโ”€โ”€ .env
โ”œโ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ db/
โ”‚   โ””โ”€โ”€ connection.js      # MySQL connection
โ”‚
โ”œโ”€โ”€ public/                # Frontend files
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ projects.html
โ”‚   โ”œโ”€โ”€ blog.html
โ”‚   โ”œโ”€โ”€ contact.html
โ”‚   โ”œโ”€โ”€ admin.html
โ”‚   โ”œโ”€โ”€ css/
โ”‚   โ””โ”€โ”€ js/
โ”‚
โ””โ”€โ”€ sql/
    โ””โ”€โ”€ schema.sql

โš™๏ธ Installation & Setup

1๏ธโƒฃ Clone Repository

git clone https://github.com/Mr-Ali01/samir-ali-portfolio.git
cd My-Portfolio

2๏ธโƒฃ Install Dependencies

npm install

3๏ธโƒฃ Setup Environment Variables

Create .env file:

PORT=5000

DB_HOST=localhost
DB_USER=root
DB_PASSWORD=yourpassword
DB_NAME=portfolio_db

GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_secret

4๏ธโƒฃ Run Server

node server.js

Server runs on:

http://localhost:5000

๐Ÿ”„ Data Flow

Frontend (fetch API)
        โ†“
Node.js (Custom HTTP Server)
        โ†“
MySQL Database
        โ†“
JSON Response
        โ†“
Dynamic UI Rendering

๐Ÿ” Authentication Flow

  1. User clicks โ€œLogin with Googleโ€
  2. Google returns user data
  3. Backend checks/inserts admin
  4. Session is created

โš ๏ธ Challenges Solved


๐Ÿš€ Deployment


๐Ÿ”ฎ Future Enhancements


๐ŸŽฏ Learning Outcomes


๐Ÿ’ก Interview Explanation

Built a full-stack portfolio using Node.js core HTTP module without Express, implementing custom routing, request handling, and REST APIs. Integrated MySQL for dynamic content and Google OAuth for authentication.


๐Ÿ“Œ Conclusion

This project demonstrates:

โœ” Strong backend fundamentals โœ” Full-stack development skills โœ” Real-world system design โœ” Ability to work without frameworks


โญ Support

If you like this project, give it a โญ on GitHub!