Amrelshabrawydev.github.io
No description available.
Technologies
Languages
README
Amr Elshabrawy β Portfolio
A modern, high-performance developer portfolio built with Next.js 16, React 19 & Tailwind CSS v4
π Table of Contents
- Overview
- Live Demo
- Tech Stack & Why
- Project Structure
- How It Works
- Data Fetching Strategy
- Styling & Design System
- Components Architecture
- SEO & Performance
- Deployment
- Getting Started
- Environment Variables
- Scripts
- License
π Overview
A fully static, blazing-fast developer portfolio that automatically syncs with GitHub to showcase projects. No CMS, no database β just push to GitHub and your portfolio updates itself on the next build.
β¨ Key Features
| Feature | Description |
|---|---|
| Auto-Synced Projects | Fetches all repositories from GitHub API at build time β no manual data entry |
| Dynamic Project Pages | Each repo gets its own detail page with full README rendering |
| Contact Form | Functional email form powered by EmailJS β no backend needed |
| Responsive Design | Pixel-perfect on every device, from 320px to 4K |
| Dark Cosmic Theme | Custom dark theme with glassmorphism, gradients, and glow effects |
| Smooth Animations | Page transitions, scroll-triggered reveals, and micro-interactions |
| Full SEO | Structured data (JSON-LD), Open Graph, Twitter Cards, sitemap, robots.txt |
| Static Export | Pre-rendered to pure HTML/CSS/JS β deploys anywhere |
π Live Demo
π amrelshabrawydev.github.io
π οΈ Tech Stack & Why
Core Framework
| Technology | Version | Why We Use It |
|---|---|---|
| Next.js | 16.0.10 | App Router, static export (output: "export"), file-based routing, built-in image optimization, and Turbopack for fast builds |
| React | 19.2.0 | Latest concurrent features, server components, improved performance with automatic batching |
| TypeScript | 5.x | Type safety across the entire codebase β catches bugs at compile time, improves DX with autocomplete |
Styling
| Technology | Why We Use It |
|---|---|
| Tailwind CSS v4 | Utility-first CSS with the new @theme directive for design tokens. Zero runtime CSS β everything is compiled at build time |
| tailwind-merge | Intelligently merges conflicting Tailwind classes (e.g., px-4 + px-6 β px-6) |
| class-variance-authority | Type-safe component variant APIs (used by shadcn/ui Button, Badge, etc.) |
| clsx | Conditional class name composition β cleaner than template literals |
UI Components
| Technology | Why We Use It |
|---|---|
| shadcn/ui | Pre-built, accessible, customizable components (Button, Card, Tabs, Dialog, Tooltip, Badge, Input, Textarea). Not a dependency β components are copied into components/ui/ for full control |
| Radix UI | Headless, accessible primitives that power shadcn/ui (Dialog, Tabs, Tooltip, Slot) |
| Lucide React | Beautiful, consistent SVG icon set with tree-shaking β only imports icons we use |
| Framer Motion | Declarative animations: page transitions, scroll-triggered reveals, layout animations, and hover micro-interactions |
Data & Communication
| Technology | Why We Use It |
|---|---|
| GitHub REST API v3 | Fetches all public repositories, language stats, and README content at build time |
| EmailJS | Sends contact form emails directly from the browser β no backend, no server functions needed for static export |
Markdown Rendering
| Technology | Why We Use It |
|---|---|
| react-markdown | Renders GitHub README files as React components |
| remark-gfm | GitHub Flavored Markdown support (tables, strikethrough, task lists, autolinks) |
| rehype-raw | Allows raw HTML in markdown (for badges, images, etc.) |
| rehype-sanitize | Sanitizes HTML to prevent XSS attacks |
| react-syntax-highlighter | Syntax highlighting for code blocks inside READMEs |
DevOps & Deployment
| Technology | Why We Use It |
|---|---|
| gh-pages | Publishes the out/ directory to the gh-pages branch with one command |
| GitHub Pages | Free, reliable static hosting with HTTPS and custom domain support |
| ESLint | Code quality and consistency enforcement |
| pnpm | Fast, disk-efficient package manager |
π Project Structure
amrelshabrawydev/
βββ app/ # Next.js App Router
β βββ layout.tsx # Root layout (fonts, metadata, navbar, footer)
β βββ page.tsx # Home page β HeroSection
β βββ globals.css # Design system (theme tokens, utilities, animations)
β βββ robots.ts # Dynamic robots.txt generation
β βββ sitemap.ts # Dynamic sitemap.xml generation
β βββ about/page.tsx # About page β AboutSection
β βββ services/page.tsx # Services page β ServicesSection
β βββ work/
β β βββ page.tsx # Work page β GitHubProjectsSection
β β βββ [slug]/page.tsx # Dynamic project detail pages
β βββ contact/page.tsx # Contact page β ContactSection
β βββ api/
β βββ github-projects/route.ts # API route for client-side project fetching
β
βββ components/
β βββ Layout/
β β βββ Footer.tsx # Site footer with social links
β β βββ PageTransition.tsx # Framer Motion animation variants
β βββ Navigation/
β β βββ Navbar.tsx # Responsive navbar with mobile menu
β βββ Sections/
β β βββ HeroSection.tsx # Hero with typewriter animation
β β βββ AboutSection.tsx # Skills, experience, and bio
β β βββ ServicesSection.tsx # Services offered
β β βββ ContactSection.tsx # EmailJS-powered contact form
β β βββ GitHubProjectsSection.tsx # Project grid (client-side fetch)
β β βββ GitHubProjects/
β β βββ ProjectCard.tsx # Individual project card
β β βββ ProjectSkeleton.tsx # Loading skeleton
β βββ ui/ # shadcn/ui components
β βββ button.tsx, badge.tsx, card.tsx, dialog.tsx
β βββ input.tsx, textarea.tsx, tabs.tsx, tooltip.tsx
β βββ glass-card.tsx # Custom glassmorphic card
β βββ markdown-components.tsx # Custom markdown renderers
β βββ type-animation.tsx # Typewriter effect component
β
βββ lib/
β βββ github.ts # GitHub API service (fetch repos, READMEs)
β βββ metadata.ts # Centralized SEO metadata & JSON-LD schemas
β βββ utils.ts # Utilities (cn, formatDate, generateSlug)
β
βββ data/
β βββ index.tsx # Static data (personal info, skills, services, social links)
β
βββ types/
β βββ github.ts # TypeScript interfaces (Project, Language)
β
βββ public/ # Static assets
β βββ .nojekyll # Tells GitHub Pages to serve _next/ directory
β βββ logo.svg, profile.png # Branding
β βββ og-*.png, twitter-card.png # Social sharing images
β βββ favicon.*, apple-touch-icon.png # Favicons
β βββ site.webmanifest # PWA manifest
β
βββ next.config.ts # Next.js config (static export, image patterns)
βββ tsconfig.json # TypeScript strict configuration
βββ postcss.config.mjs # PostCSS with Tailwind plugin
βββ eslint.config.mjs # ESLint configuration
βββ package.json # Dependencies & scripts
βοΈ How It Works
Build Pipeline
graph LR
A[pnpm build] --> B[Next.js Turbopack]
B --> C[Fetch GitHub API]
C --> D[Generate Static Pages]
D --> E[out/ directory]
E --> F[gh-pages deploys to GitHub Pages]
pnpm buildtriggers Next.js static export (output: "export")- Turbopack compiles TypeScript and bundles assets
generateStaticParams()inapp/work/[slug]/page.tsxcallsgetAllProjects()which fetches all repos from GitHub API- Each repo gets its own static HTML page at
/work/{slug} - Output is a fully static
out/directory (HTML, CSS, JS, images) pnpm run deploypushesout/to thegh-pagesbranch viagh-pages --nojekyll
Runtime Behavior
- Project listing page (
/work): Fetches projects client-side via/api/github-projectsroute for fresh data - Project detail pages (
/work/[slug]): Pre-rendered at build time with full README content - Contact form: Sends emails client-side via EmailJS SDK β no server roundtrip
- Navigation: Client-side routing via Next.js App Router with Framer Motion page transitions
π Data Fetching Strategy
1. GitHub Projects (Build-Time + Client-Side Hybrid)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β lib/github.ts β
β β
β fetchWithToken(url) β
β βββ Adds Bearer token if GITHUB_TOKEN is set β
β βββ Uses next: { revalidate: 3600 } (1-hour cache) β
β βββ Handles rate limiting gracefully β
β β
β getAllProjects() β
β βββ GET /users/{username}/repos?sort=updated&per_page=100 β
β βββ Filters out forked repos β
β βββ Fetches language stats per repo β
β βββ Generates OG image URL from GitHub β
β βββ Returns Project[] with title, description, etc. β
β β
β getProjectReadme(fullName, branch) β
β βββ GET /repos/{fullName}/readme?ref={branch} β
β βββ Decodes Base64 content β
β βββ Extracts preview text for meta descriptions β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Why hybrid?
- Build time (
generateStaticParams): Pre-renders all project detail pages with README content for instant loading and SEO - Client side (
GitHubProjectsSection): Fetches fresh project data on the/workpage so visitors always see the latest repos without rebuilding
2. Contact Form (Client-Side via EmailJS)
User submits form β EmailJS SDK β EmailJS Service β Your Gmail inbox
- No backend required β perfect for static deployment
- Template variables:
{{from_name}},{{from_email}},{{message}} - Success/error states with loading spinner
3. Static Data (data/index.tsx)
All personal info, skills, services, and social links are defined as typed constants:
export const personalInfo: PersonalInfo = { name, role, tagline, ... }
export const skills: Skill[] = [...]
export const services: Service[] = [...]
export const socialLinks: SocialLink[] = [...]
Why? Single source of truth. Change your bio in one file β every page updates.
π¨ Styling & Design System
Theme Architecture
The design system is defined in app/globals.css using Tailwind CSS v4's @theme directive:
@theme {
/* Background Layers */
--color-bg-base: #0a0e27; /* Deep dark blue */
--color-bg-elevated: #111827; /* Cards, footer */
--color-bg-overlay: #1f2937; /* Modals, popovers */
/* Brand Colors */
--color-primary-500: #3b82f6; /* Blue β CTAs, links */
--color-accent-500: #8b5cf6; /* Purple β gradients, highlights */
/* Text Hierarchy */
--color-text-primary: #e0e7ff; /* Headings */
--color-text-secondary: #94a3b8; /* Body text */
--color-text-tertiary: #64748b; /* Captions */
}
Visual Effects
| Effect | Implementation |
|---|---|
| Glassmorphism | .glass-card β rgba background + backdrop-filter: blur(12px) |
| Gradient Text | .gradient-text β background-clip: text with primaryβaccent gradient |
| Glow Effects | .glow-subtle/medium/strong β Layered box-shadow with brand colors |
| Grid Pattern | .bg-grid-pattern β CSS linear-gradient creating a subtle grid |
| Mesh Gradient | --gradient-mesh β Multiple radial-gradient layers for depth |
| Float Animation | @keyframes float β Gentle Y-axis oscillation on the hero image |
Typography
- Headings: Space Grotesk β Geometric, modern feel
- Body: Inter β Highly legible at all sizes
- Loaded via
next/font/googlefor zero layout shift (FOUT-free)
π§© Components Architecture
Page Sections
graph TD
A[Layout - layout.tsx] --> B[Navbar]
A --> C[Page Content]
A --> D[Footer]
C --> E[HeroSection]
C --> F[AboutSection]
C --> G[ServicesSection]
C --> H[GitHubProjectsSection]
C --> I[ContactSection]
C --> J["ProjectDetail [slug]"]
H --> K[ProjectCard]
H --> L[ProjectSkeleton]
J --> M[ReactMarkdown + remark-gfm]
UI Component Library (shadcn/ui)
All components live in components/ui/ β they are not installed as dependencies but copied directly for full customization:
| Component | Purpose |
|---|---|
Button | Primary CTAs with variants (default, outline, ghost) via CVA |
Card | Content containers with header/content/footer slots |
Badge | Technology tags, status indicators |
Dialog | Modal overlays (accessible, focus-trapped) |
Tabs | Content tabbing (e.g., skills categories) |
Tooltip | Hover information overlays |
Input / Textarea | Form fields with consistent styling |
GlassCard | Custom glassmorphic card with hover effects |
TypeAnimation | Typewriter effect for hero section role titles |
MarkdownComponents | Custom renderers for README code blocks, images, links |
π SEO & Performance
SEO Features
- Metadata in
lib/metadata.ts: Centralized Open Graph, Twitter Card, and description for every page - JSON-LD Structured Data:
Person,ProfessionalService, andItemListschemas - Dynamic Sitemap (
app/sitemap.ts): Auto-generated with all routes - Dynamic Robots (
app/robots.ts): Proper crawl directives - Canonical URLs: Prevent duplicate content
- Semantic HTML: Proper heading hierarchy, landmarks, and ARIA labels
Performance
- Static Export: Zero server overhead β served directly from CDN
- Turbopack: Up to 10x faster builds than Webpack
- Image Optimization:
next/imagewithunoptimized: truefor static export (images served as-is) - Font Optimization:
next/font/googlewithdisplay: swapand preloading - Code Splitting: Automatic per-route JavaScript bundles
- Tree Shaking: Only imported icons/components are bundled
π Deployment
GitHub Pages (Current Setup)
The project deploys to GitHub Pages via the gh-pages package:
# Build + Deploy (runs predeploy β build automatically)
pnpm run deploy
This command:
- Runs
next buildβ generatesout/directory - Pushes
out/to thegh-pagesbranch with--nojekyllflag - GitHub Pages serves the static files from that branch
Important Notes
.nojekyllfile inpublic/tells GitHub Pages to serve the_next/directory (which starts with an underscore and would normally be ignored by Jekyll)output: "export"innext.config.tsenables fully static HTML generationimages.unoptimized: trueis required because GitHub Pages doesn't support Next.js image optimization APIgenerateStaticParams()inapp/work/[slug]/page.tsxpre-renders all project detail pages
π Getting Started
Prerequisites
- Node.js β₯ 18
- pnpm (recommended) or npm
Installation
# Clone the repository
git clone https://github.com/AmrElshabrawyDev/amrelshabrawydev.github.io.git
cd amrelshabrawydev.github.io
# Install dependencies
pnpm install
# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your values (see below)
# Start development server
pnpm dev
Open http://localhost:3000 in your browser.
π Environment Variables
Create a .env.local file in the project root:
# GitHub API
GITHUB_USERNAME=YourGitHubUsername
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx # Optional: increases API rate limit from 60 to 5000 req/hr
# EmailJS (for contact form)
NEXT_PUBLIC_EMAILJS_SERVICE_ID=service_xxxxxxx
NEXT_PUBLIC_EMAILJS_TEMPLATE_ID=template_xxxxxxx
NEXT_PUBLIC_EMAILJS_PUBLIC_KEY=xxxxxxxxxxxxxxx
| Variable | Required | Description |
|---|---|---|
GITHUB_USERNAME | β | Your GitHub username for fetching repositories |
GITHUB_TOKEN | β | Personal access token β raises rate limit from 60 to 5,000 requests/hour |
NEXT_PUBLIC_EMAILJS_SERVICE_ID | β | EmailJS service ID (get from emailjs.com) |
NEXT_PUBLIC_EMAILJS_TEMPLATE_ID | β | EmailJS email template ID |
NEXT_PUBLIC_EMAILJS_PUBLIC_KEY | β | EmailJS public key for browser-side sends |
π Scripts
| Script | Command | Description |
|---|---|---|
dev | pnpm dev | Start development server with Turbopack HMR |
build | pnpm build | Create optimized static production build in out/ |
start | pnpm start | Start production server (for testing, not used with static export) |
lint | pnpm lint | Run ESLint for code quality checks |
deploy | pnpm run deploy | Build + push to gh-pages branch |
π License
This project is open source and available under the MIT License.
Built with β€οΈ by Amr Elshabrawy