Skip to content

gargmegham/Portfolio

MeghamGarg.com

Netlify Status

A modern, interactive portfolio and blog website showcasing software development expertise through cutting-edge web technologies.

Next.js React Tailwind CSS Three.js Supabase

🌟 Features

🎨 Interactive Portfolio

  • 3D Animations: Interactive iPhone and MacBook models with realistic lighting
  • Animated Backgrounds: Dynamic displacement spheres with WebGL shaders
  • Smooth Scroll Effects: Intersection Observer-powered animations
  • Responsive Design: Custom grid patterns adapting to all screen sizes

πŸ“ Full-Featured Blog

  • Rich Content: Markdown support with syntax highlighting, math equations (KaTeX), and task lists
  • Dynamic Routing: SEO-friendly URLs with slug-based navigation
  • Tag System: Categorization and related post suggestions
  • Draft Mode: Preview posts before publishing
  • Social Sharing: Built-in sharing capabilities

πŸ›‘οΈ Admin Dashboard

  • Secure Authentication: Password-protected admin panel with middleware
  • Content Management: Create, edit, and manage blog posts
  • Media Gallery: Image upload and management system
  • Subscriber Analytics: Newsletter subscription management
  • Protected Routes: Role-based access control

πŸš€ Performance & SEO

  • Next.js App Router: Latest routing architecture for optimal performance
  • Dynamic Metadata: Automatic SEO optimization for all pages
  • Sitemap Generation: Automated sitemap and robots.txt
  • Analytics Integration: Google Analytics and Microsoft Clarity

πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js 14.2.3 with App Router
  • UI Library: React 18 with custom components
  • Styling: Tailwind CSS with custom design system
  • Animations: Framer Motion for smooth transitions
  • 3D Graphics: Three.js with React Three Fiber
  • Icons: Tabler Icons React

Backend & Database

  • Database: Supabase (PostgreSQL)
  • Authentication: Custom admin auth with bcrypt
  • API Routes: Next.js API endpoints
  • File Storage: Supabase Storage for media assets

Content & Markdown

  • Markdown Parser: React Markdown with GFM support
  • Code Highlighting: React Syntax Highlighter
  • Math Rendering: KaTeX for mathematical expressions
  • Content Sanitization: Rehype plugins for security

Development & Deployment

  • Language: JavaScript/TypeScript
  • Package Manager: npm
  • Linting: ESLint with Next.js configuration
  • Deployment: Optimized for Vercel/Netlify

πŸ“ Project Structure

MeghamGarg.com/
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ πŸ“ app/                    # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ πŸ“ admin/              # Admin dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ page.jsx        # Main admin panel
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ blogs/          # Blog management
β”‚   β”‚   β”‚   └── πŸ“ gallery/        # Media management
β”‚   β”‚   β”œβ”€β”€ πŸ“ api/                # API endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ admin/          # Admin authentication
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ blogs/          # Blog CRUD operations
β”‚   β”‚   β”‚   └── πŸ“ subscribe/      # Newsletter API
β”‚   β”‚   β”œβ”€β”€ πŸ“ blog/               # Blog pages
β”‚   β”‚   β”‚   └── πŸ“ [slug]/         # Dynamic blog posts
β”‚   β”‚   β”œβ”€β”€ πŸ“ logs/               # Blog listing
β”‚   β”‚   β”œβ”€β”€ πŸ“„ layout.jsx          # Root layout
β”‚   β”‚   β”œβ”€β”€ πŸ“„ page.jsx            # Homepage
β”‚   β”‚   └── πŸ“„ globals.css         # Global styles
β”‚   β”œβ”€β”€ πŸ“ components/             # React components
β”‚   β”‚   β”œβ”€β”€ πŸ“„ custom-markdown.jsx # Enhanced markdown renderer
β”‚   β”‚   β”œβ”€β”€ πŸ“„ blog-card.jsx       # Blog post cards
β”‚   β”‚   β”œβ”€β”€ πŸ“„ navbar.jsx          # Navigation component
β”‚   β”‚   └── πŸ“„ ...                 # Other components
β”‚   β”œβ”€β”€ πŸ“ ui/                     # Reusable UI modules
β”‚   β”‚   β”œβ”€β”€ πŸ“ admin/              # Admin-specific components
β”‚   β”‚   β”œβ”€β”€ πŸ“ blog/               # Blog-specific components
β”‚   β”‚   β”œβ”€β”€ πŸ“ canvas/             # 3D canvas components
β”‚   β”‚   β”œβ”€β”€ πŸ“ common/             # Shared components
β”‚   β”‚   └── πŸ“ home/               # Homepage components
β”‚   β”œβ”€β”€ πŸ“ utils/                  # Utility functions
β”‚   β”‚   β”œβ”€β”€ πŸ“„ supabaseClient.js   # Database client
β”‚   β”‚   β”œβ”€β”€ πŸ“„ apiUtils.js         # API helpers
β”‚   β”‚   └── πŸ“„ cn.js               # Class name utility
β”‚   β”œβ”€β”€ πŸ“ hooks/                  # Custom React hooks
β”‚   β”œβ”€β”€ πŸ“ constants/              # Configuration files
β”‚   └── πŸ“ assets/                 # Fonts and CSS
β”œβ”€β”€ πŸ“ public/                     # Static assets
β”‚   β”œβ”€β”€ πŸ“ images/                 # Image assets
β”‚   β”œβ”€β”€ πŸ“ models/                 # 3D model files
β”‚   β”œβ”€β”€ πŸ“ icons/                  # SVG icons
β”‚   └── πŸ“„ ...                     # Other static files
β”œβ”€β”€ πŸ“„ package.json               # Dependencies and scripts
β”œβ”€β”€ πŸ“„ tailwind.config.js         # Tailwind configuration
β”œβ”€β”€ πŸ“„ next.config.mjs            # Next.js configuration
└── πŸ“„ middleware.js              # Route protection

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Supabase account and project
  • Git for version control

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/MeghamGarg.com.git
    cd MeghamGarg.com
  2. Install dependencies

    npm install
  3. Environment setup

    cp .env.example .env.local
  4. Configure environment variables

    # Supabase Configuration
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
    SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
    
    # Admin Authentication
    ADMIN_PASSWORD_HASH=your_bcrypt_hashed_password
    JWT_SECRET=your_jwt_secret
    
    # Analytics (Optional)
    NEXT_PUBLIC_GA_ID=your_google_analytics_id
    NEXT_PUBLIC_CLARITY_ID=your_microsoft_clarity_id
  5. Database setup

    -- Create blogs table
    CREATE TABLE blogs (
      id SERIAL PRIMARY KEY,
      title VARCHAR(255) NOT NULL,
      content TEXT NOT NULL,
      slug VARCHAR(255) UNIQUE NOT NULL,
      tags TEXT[],
      excerpt TEXT,
      is_draft BOOLEAN DEFAULT false,
      created_at TIMESTAMP DEFAULT NOW(),
      updated_at TIMESTAMP DEFAULT NOW()
    );
    
    -- Create subscribers table
    CREATE TABLE subscribers (
      id SERIAL PRIMARY KEY,
      email VARCHAR(255) UNIQUE NOT NULL,
      subscribed_at TIMESTAMP DEFAULT NOW()
    );
  6. Start development server

    npm run dev
  7. Open your browser Navigate to http://localhost:3000

πŸ“ Content Management

Creating Blog Posts

  1. Access Admin Panel

    • Navigate to /admin
    • Enter your admin password
  2. Create New Post

    • Click "Create New Blog"
    • Fill in title, content (Markdown), tags, and excerpt
    • Toggle draft mode for previewing
    • Click "Create Blog" to publish
  3. Markdown Features

    • Syntax highlighting for code blocks
    • Math equations with KaTeX
    • Task lists with checkboxes
    • Tables, images, and embeds
    • Custom styling with Tailwind classes

Managing Content

  • Edit Posts: Click edit icon on any blog post
  • Delete Posts: Use delete button with confirmation
  • Manage Subscribers: View and export newsletter subscribers
  • Upload Images: Use gallery section for media management

🎨 Customization

Design System

The website uses a custom design system built with Tailwind CSS:

/* Primary Colors */
--amber-400: #fbbf24; /* Primary accent */
--amber-300: #fcd34d; /* Light accent */
--amber-500: #f59e0b; /* Dark accent */

/* Background */
--bg-primary: #000000; /* Main background */
--bg-secondary: #1a1a1a; /* Card backgrounds */

/* Text */
--text-primary: #ffffff; /* Primary text */
--text-secondary: #d1d5db; /* Secondary text */

Component Customization

Components are modular and easily customizable:

// Example: Customizing the blog card
<BlogCard
  title="Custom Title"
  excerpt="Custom excerpt..."
  tags={["custom", "tags"]}
  className="custom-styling"
/>

3D Models

Add new 3D models to the /public/models/ directory and import them:

import { useGLTF } from "@react-three/drei";

function CustomModel() {
  const { scene } = useGLTF("/models/your-model.gltf");
  return <primitive object={scene} />;
}

πŸš€ Deployment

Vercel (Recommended)

  1. Connect Repository

    • Import project in Vercel dashboard
    • Connect your GitHub repository
  2. Configure Environment

    • Add all environment variables
    • Set build command: npm run build
  3. Deploy

    • Automatic deployments on git push
    • Preview deployments for PRs

Other Platforms

The project is compatible with:

  • Netlify: Zero-config deployment
  • Railway: Full-stack deployment
  • AWS Amplify: Scalable hosting
  • DigitalOcean App Platform: Simple deployment

πŸ”§ Scripts

# Development
npm run dev          # Start development server

# Production
npm run build        # Build for production
npm start           # Start production server

# Code Quality
npm run lint        # Run ESLint
npm run lint:fix    # Fix linting issues

πŸ“Š Performance

The website is optimized for performance:

  • Lighthouse Score: 95+ across all metrics
  • Core Web Vitals: Excellent ratings
  • Bundle Size: Optimized with code splitting
  • Image Optimization: Next.js automatic optimization
  • Lazy Loading: Components and 3D models

πŸ”’ Security

Security measures implemented:

  • Content Sanitization: All user content is sanitized
  • CSRF Protection: Built-in Next.js protection
  • Environment Variables: Sensitive data in environment
  • Password Hashing: Bcrypt for admin authentication
  • XSS Prevention: Secure markdown rendering

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m 'Add amazing feature'
  4. Push to the branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow the existing code style
  • Add comments for complex logic
  • Test thoroughly before submitting
  • Update documentation as needed

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Next.js Team - Amazing React framework
  • Tailwind CSS - Utility-first CSS framework
  • Three.js Community - 3D graphics library
  • Supabase - Backend-as-a-Service platform
  • Vercel - Deployment and hosting platform

πŸ“ž Contact

Megham Garg


Built with ❀️ and cutting-edge web technologies

🌐 Live Website | ✨ Features | πŸš€ Quick Start | πŸš€ Deploy

About

🌚 Beautiful Next.js portfolio template showcasing projects, and experience

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published