A modern, interactive portfolio and blog website showcasing software development expertise through cutting-edge web technologies.
- 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
- 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
- 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
- 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
- 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
- Database: Supabase (PostgreSQL)
- Authentication: Custom admin auth with bcrypt
- API Routes: Next.js API endpoints
- File Storage: Supabase Storage for media assets
- Markdown Parser: React Markdown with GFM support
- Code Highlighting: React Syntax Highlighter
- Math Rendering: KaTeX for mathematical expressions
- Content Sanitization: Rehype plugins for security
- Language: JavaScript/TypeScript
- Package Manager: npm
- Linting: ESLint with Next.js configuration
- Deployment: Optimized for Vercel/Netlify
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
- Node.js 18+ and npm
- Supabase account and project
- Git for version control
-
Clone the repository
git clone https://github.com/yourusername/MeghamGarg.com.git cd MeghamGarg.com
-
Install dependencies
npm install
-
Environment setup
cp .env.example .env.local
-
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
-
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() );
-
Start development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000
-
Access Admin Panel
- Navigate to
/admin
- Enter your admin password
- Navigate to
-
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
-
Markdown Features
- Syntax highlighting for code blocks
- Math equations with KaTeX
- Task lists with checkboxes
- Tables, images, and embeds
- Custom styling with Tailwind classes
- 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
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 */
Components are modular and easily customizable:
// Example: Customizing the blog card
<BlogCard
title="Custom Title"
excerpt="Custom excerpt..."
tags={["custom", "tags"]}
className="custom-styling"
/>
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} />;
}
-
Connect Repository
- Import project in Vercel dashboard
- Connect your GitHub repository
-
Configure Environment
- Add all environment variables
- Set build command:
npm run build
-
Deploy
- Automatic deployments on git push
- Preview deployments for PRs
The project is compatible with:
- Netlify: Zero-config deployment
- Railway: Full-stack deployment
- AWS Amplify: Scalable hosting
- DigitalOcean App Platform: Simple deployment
# 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
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 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
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m 'Add amazing feature'
- Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
- Follow the existing code style
- Add comments for complex logic
- Test thoroughly before submitting
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- 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
Megham Garg
- Website: meghamgarg.com
- Email: contact@meghamgarg.com
- LinkedIn: linkedin.com/in/meghamgarg
- GitHub: github.com/gargmegham
Built with β€οΈ and cutting-edge web technologies
π Live Website | β¨ Features | π Quick Start | π Deploy