Skip to content

behitek/behitek.github.io

Repository files navigation

Behitek Portfolio - Astro Edition

A blazing-fast, modern portfolio website for an AI Engineer, built with Astro 4.x and TailwindCSS.

🌐 Live Site: behitek.com 🎨 Framework: Astro 4.x πŸ’… Styling: TailwindCSS 3.x πŸ“ Content: MDX for blog posts


✨ Features

Core Features

  • ⚑ Lightning Fast: < 1s load time with minimal JavaScript
  • πŸŒ™ Dark Mode: Smooth theme switching with persistence
  • πŸ“± Fully Responsive: Mobile-first design
  • 🎨 Modern UI: Glass morphism, gradient accents, smooth animations
  • πŸ” SEO Optimized: Complete meta tags, OpenGraph, Twitter cards
  • πŸ“Š RSS Feed: Subscribe to blog updates
  • β™Ώ Accessible: WCAG 2.1 AA compliant

Blog Features

  • πŸ“ 10+ technical articles about AI/ML, NLP, RAG, Python
  • 🌐 Bilingual Support: English & Vietnamese posts (tagged)
  • 🏷️ Smart Filtering: Filter by language and category
  • πŸ“– Table of Contents: Auto-generated with active section highlighting
  • πŸ“ˆ Reading Progress: Visual progress bar
  • πŸ’¬ Comments: Giscus (GitHub Discussions)
  • πŸ”— Share Buttons: Twitter, LinkedIn, Copy link
  • ⏱️ Reading Time: Estimated time for each post

Project Showcase

  • πŸš€ Featured projects: LCOJ, Inverted HyDE, hoc-bash
  • πŸ“‚ Categorized: Product, Research, Tutorial, Tool, Fun
  • 🏷️ Tech stack tags
  • πŸ”— Links to GitHub, live demos, blog posts

Technical Highlights

  • 🎯 TypeScript for type safety
  • 🎨 Custom Tailwind theme with emerald green branding
  • πŸ“¦ Content Collections for type-safe content
  • πŸ–ΌοΈ Optimized images with Astro Image
  • πŸ€– Google Tag Manager integration
  • πŸš€ GitHub Actions deployment

πŸš€ Quick Start

Prerequisites

  • Node.js 20.x or higher
  • npm or pnpm

Installation

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

Development Commands

npm run dev          # Start dev server (http://localhost:4321)
npm run build        # Build for production
npm run preview      # Preview production build
npm run astro        # Run Astro CLI commands

πŸ“ Project Structure

/
β”œβ”€β”€ public/              # Static assets
β”‚   β”œβ”€β”€ images/          # Images (copied from old site)
β”‚   β”‚   β”œβ”€β”€ blog/        # Blog post images
β”‚   β”‚   └── me.jpeg      # Profile picture
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ CNAME            # Custom domain config
β”‚   └── .nojekyll        # GitHub Pages config
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/      # Reusable components
β”‚   β”‚   β”œβ”€β”€ Navbar.astro
β”‚   β”‚   β”œβ”€β”€ Footer.astro
β”‚   β”‚   β”œβ”€β”€ ThemeToggle.astro
β”‚   β”‚   β”œβ”€β”€ BlogCard.astro
β”‚   β”‚   β”œβ”€β”€ ProjectCard.astro
β”‚   β”‚   β”œβ”€β”€ LanguageBadge.astro
β”‚   β”‚   β”œβ”€β”€ TableOfContents.astro
β”‚   β”‚   β”œβ”€β”€ Giscus.astro
β”‚   β”‚   └── SEO.astro
β”‚   β”‚
β”‚   β”œβ”€β”€ layouts/         # Page layouts
β”‚   β”‚   β”œβ”€β”€ BaseLayout.astro
β”‚   β”‚   └── BlogPostLayout.astro
β”‚   β”‚
β”‚   β”œβ”€β”€ pages/           # Routes
β”‚   β”‚   β”œβ”€β”€ index.astro           # Homepage
β”‚   β”‚   β”œβ”€β”€ blog/
β”‚   β”‚   β”‚   β”œβ”€β”€ index.astro       # Blog listing
β”‚   β”‚   β”‚   └── [...slug].astro   # Blog post pages
β”‚   β”‚   β”œβ”€β”€ projects.astro
β”‚   β”‚   β”œβ”€β”€ contact.astro
β”‚   β”‚   β”œβ”€β”€ 404.astro
β”‚   β”‚   └── rss.xml.ts            # RSS feed
β”‚   β”‚
β”‚   β”œβ”€β”€ content/         # Content collections
β”‚   β”‚   β”œβ”€β”€ blog/        # Blog posts (MDX)
β”‚   β”‚   β”‚   └── inverted-hyde.mdx
β”‚   β”‚   β”œβ”€β”€ projects/    # Projects (JSON)
β”‚   β”‚   β”‚   β”œβ”€β”€ lcoj.json
β”‚   β”‚   β”‚   β”œβ”€β”€ inverted-hyde.json
β”‚   β”‚   β”‚   └── hoc-bash.json
β”‚   β”‚   └── config.ts    # Content collection schemas
β”‚   β”‚
β”‚   β”œβ”€β”€ styles/          # Global styles
β”‚   β”‚   └── global.css   # Tailwind + custom styles
β”‚   β”‚
β”‚   └── utils/           # Utility functions
β”‚       β”œβ”€β”€ constants.ts
β”‚       └── helpers.ts
β”‚
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml   # GitHub Actions deployment
β”‚
β”œβ”€β”€ astro.config.mjs     # Astro configuration
β”œβ”€β”€ tailwind.config.mjs  # Tailwind configuration
β”œβ”€β”€ tsconfig.json        # TypeScript configuration
└── package.json

🎨 Design System

Color Palette

Primary (Emerald Green):
  - #10B981 (Main)
  - #059669 (Dark)
  - #34D399 (Light)

Accent:
  - #06B6D4 (Cyan) - For highlights
  - #8B5CF6 (Purple) - For AI/ML content

Neutral (Slate):
  - Light mode: #FFFFFF background, #0F172A text
  - Dark mode: #0F172A background, #F8FAFC text

Typography

  • Headings: Inter (Google Fonts)
  • Body: System fonts for performance
  • Code: JetBrains Mono / Fira Code

Components

  • Glass Morphism: Navbar with backdrop blur
  • Bento Grid: About section layout
  • Cards: Elevated cards with hover effects
  • Badges: Language (EN/VI) and category badges
  • Buttons: Primary (filled) and secondary (outlined)

πŸ“ Content Management

Adding Blog Posts

  1. Create new MDX file in src/content/blog/:
---
title: "Your Post Title"
description: "Brief description"
date: 2025-11-12
author: "Hieu Nguyen"
language: "en"  # or "vi"
category: "AI/ML"  # AI/ML, Python, Tutorial, Data
tags: ["tag1", "tag2"]
image: "/images/blog/your-image.jpg"
draft: false
---

Your content here...
  1. Add images to public/images/blog/
  2. Blog post will be automatically generated at /blog/your-post-slug

Adding Projects

  1. Create JSON file in src/content/projects/:
{
  "title": "Project Name",
  "description": "Project description",
  "category": "Product",
  "tech": ["Python", "FastAPI", "Docker"],
  "links": {
    "website": "https://example.com",
    "github": "https://github.com/..."
  },
  "featured": true,
  "order": 1
}
  1. Project will appear on homepage and projects page

πŸ”§ Configuration

Giscus Comments

  1. Enable GitHub Discussions in your repository
  2. Visit giscus.app
  3. Configure and get your repo ID and category ID
  4. Update src/components/Giscus.astro:
script.setAttribute('data-repo', 'behitek/behitek.github.io');
script.setAttribute('data-repo-id', 'YOUR_REPO_ID');
script.setAttribute('data-category-id', 'YOUR_CATEGORY_ID');

Google Tag Manager

Update in src/layouts/BaseLayout.astro:

<script is:inline>
  (function(w,d,s,l,i){...})(window,document,'script','dataLayer','YOUR_GTM_ID');
</script>

Custom Domain

Update public/CNAME with your domain:

behitek.com

πŸš€ Deployment

GitHub Pages (Recommended)

  1. Push to main branch or designated branch
  2. GitHub Actions will automatically build and deploy
  3. Enable GitHub Pages in repo settings:
    • Settings β†’ Pages
    • Source: GitHub Actions

Manual Deployment

# Build
npm run build

# Deploy dist/ folder to your hosting provider

πŸ“Š Performance

Lighthouse Scores (Target)

  • Performance: 95+
  • Accessibility: 95+
  • Best Practices: 95+
  • SEO: 100

Bundle Size

  • JavaScript: ~5-10 KB (vs 200 KB with Docusaurus)
  • CSS: ~20 KB (with TailwindCSS purging)
  • First Load: < 1 second

πŸ› οΈ Tech Stack

  • Framework: Astro 4.x
  • Styling: TailwindCSS 3.x
  • Content: MDX with Content Collections
  • Fonts: Google Fonts (Inter)
  • Icons: Emoji + SVG
  • Comments: Giscus
  • Analytics: Google Tag Manager
  • Hosting: GitHub Pages
  • CI/CD: GitHub Actions

πŸ“š Migration from Docusaurus

See MIGRATION_GUIDE.md for detailed migration steps.

Summary:

  • Copy blog posts from /blog/*.md to /src/content/blog/*.mdx
  • Update frontmatter format
  • Fix image paths: /img/blog β†’ /images/blog
  • Remove <!--truncate--> tags
  • Test each post

🀝 Contributing

This is a personal portfolio, but suggestions and bug reports are welcome!

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

πŸ“„ License

Β© 2025 Hieu Nguyen. All rights reserved.


πŸ™ Acknowledgments


πŸ“§ Contact


Built with ❀️ by Hieu Nguyen