# Building My Portfolio with Astro

| 4 min read | Oscar RC

A deep dive into the creation of my personal portfolio website using Astro, showcasing modern web development practices, performance optimization, and the unique features that make this site stand out.

## Building My Portfolio with Astro

Creating a personal portfolio is one of the most important projects for any developer. It’s not just a showcase of your work—it’s a demonstration of your skills, attention to detail, and understanding of modern web development practices. This is the story of how I built my portfolio using Astro and the decisions that shaped its development.

## Why Astro for a Portfolio?

When choosing a framework for my portfolio, I had several requirements:

Performance First

  • > Lightning-fast loading times
  • > Excellent Core Web Vitals scores
  • > Minimal JavaScript footprint
  • > SEO-optimized content

Developer Experience

  • > TypeScript support
  • > Modern tooling
  • > Easy content management
  • > Flexible component system

Content Management

  • > Blog posts and project showcases
  • > Easy to update and maintain
  • > Version control friendly
  • > Markdown support

Astro was the perfect choice because it excels at content-focused websites while providing the flexibility to add interactivity where needed.

## Architecture Decisions

### Static Site Generation (SSG)

I chose SSG for maximum performance. Since portfolio content doesn’t change frequently, pre-building pages at build time ensures the fastest possible loading experience.

### Content Collections

Astro’s Content Collections provide type-safe content management:

  • > Projects: Showcase my work with detailed descriptions
  • > Posts: Blog articles and technical insights
  • > Skills: Organized skill categories with proficiency levels

### Component Architecture

The site uses a modular component approach:

  • > Layout Components: Consistent page structure
  • > Content Components: Reusable content blocks
  • > Interactive Islands: Selective hydration for dynamic features

## Key Features Implemented

### Project Showcase

Each project includes:

  • > Enhanced Descriptions: Comprehensive technical details
  • > Live Previews: Browser mockups with tooltips
  • > Technology Tags: Clear tech stack indicators
  • > Repository Links: Direct access to source code
  • > Live Demo Links: Working applications

### Blog System

The blog features:

  • > Content Collections: Type-safe post management
  • > Enhanced Content: Detailed technical articles
  • > Tag System: Organized content categorization
  • > SEO Optimization: Proper meta tags and structured data

### Skills Section

Interactive skills display with:

  • > Categorized Skills: Organized by technology type
  • > Proficiency Levels: Visual skill indicators
  • > Dynamic Filtering: Easy skill discovery

### Performance Optimizations

  • > Image Optimization: Automatic WebP conversion and responsive images
  • > Code Splitting: Minimal JavaScript bundles
  • > Lazy Loading: Defer non-critical resources
  • > Caching Strategy: Optimized asset delivery

## Technical Implementation

### Content Management

// Content Collections Schema
const projectsCollection = defineCollection({
schema: ({ image }) =>
z.object({
title: z.string(),
description: z.string(),
cover: z.object({
src: image(),
alt: z.string(),
}),
repo: z.string(),
url: z.string().url().optional(),
tags: z.array(z.string()),
}),
});

### Component System

ProjectCard.astro
---
import { Image } from "astro:assets";
interface Props {
project: CollectionEntry<"projects">;
}
const { project } = Astro.props;
---
<article class="project-card">
<Image
src={project.data.cover.src}
alt={project.data.cover.alt}
width={400}
height={225}
/>
<h3>{project.data.title}</h3>
<p>{project.data.description}</p>
<div class="tags">
{project.data.tags.map(tag => (
<span class="tag">{tag}</span>
))}
</div>
</article>

### Interactive Features

---
// Tooltip with browser mockup
---
<div class="tooltip tooltip-top">
<div class="tooltip-content">
<div class="browser-mockup">
<div class="browser-header">
<div class="browser-controls">
<div class="control red"></div>
<div class="control yellow"></div>
<div class="control green"></div>
</div>
<div class="url-bar">{project.data.url}</div>
</div>
<Image
src={project.data.cover.src}
alt={project.data.cover.alt}
class="browser-content"
/>
</div>
</div>
<a href={project.data.url} class="btn btn-primary">
Visit Site
</a>
</div>

## Design Philosophy

### Minimalist Approach

The design focuses on:

  • > Clean Typography: Readable and professional
  • > Consistent Spacing: Visual rhythm and hierarchy
  • > Subtle Animations: Enhanced user experience
  • > Responsive Design: Works on all devices

### Color Scheme

  • > Dark Mode: Easy on the eyes for developers
  • > Accent Colors: Strategic use of color for emphasis
  • > High Contrast: Excellent readability
  • > Accessibility: WCAG compliant color choices

### Typography

  • > System Fonts: Fast loading and native feel
  • > Hierarchy: Clear content structure
  • > Readability: Optimized for long-form content
  • > Code Blocks: Proper syntax highlighting

## Performance Results

### Core Web Vitals

  • > LCP: < 1.2s (Excellent)
  • > FID: < 100ms (Excellent)
  • > CLS: < 0.1 (Excellent)
  • > Lighthouse Score: 100/100

### Bundle Analysis

  • > JavaScript: < 10KB initial load
  • > CSS: < 5KB critical path
  • > Images: Optimized and responsive
  • > Total Size: < 100KB for initial page

## Content Strategy

### Project Documentation

Each project includes:

  • > Technical Architecture: Detailed implementation
  • > Key Features: Highlighted capabilities
  • > Challenges: Problems solved and lessons learned
  • > Technologies: Complete tech stack
  • > Impact: Real-world applications and results

### Blog Content

Technical articles covering:

  • > Web Development: Modern practices and techniques
  • > AI Integration: Browser-based AI applications
  • > Performance: Optimization strategies
  • > Tools: Development workflow improvements

## Lessons Learned

### What Worked Well

  • > Astro’s SSG: Perfect for content-focused sites
  • > Content Collections: Excellent developer experience
  • > Performance: Exceeded expectations
  • > Maintainability: Easy to update and extend

### Challenges Overcome

  • > Image Optimization: Complex responsive image requirements
  • > Interactive Features: Balancing performance with functionality
  • > Content Management: Organizing large amounts of content
  • > SEO: Ensuring proper search engine optimization

### Future Improvements

  • > Analytics: User behavior insights
  • > A/B Testing: Content optimization
  • > Internationalization: Multi-language support
  • > Advanced Features: Enhanced interactivity

## Development Workflow

### Version Control

  • > Git: Complete project history
  • > Branches: Feature development
  • > Commits: Atomic changes
  • > Documentation: Comprehensive README

### Deployment

  • > GitHub Pages: Free hosting
  • > GitHub Actions: Automated deployment
  • > CDN: Global content delivery
  • > SSL: Secure connections

### Maintenance

  • > Regular Updates: Dependencies and content
  • > Performance Monitoring: Continuous optimization
  • > User Feedback: Iterative improvements
  • > Security: Regular security audits

## Impact and Results

### Professional Benefits

  • > Portfolio Showcase: Comprehensive project display
  • > Technical Demonstration: Skills and capabilities
  • > Professional Presence: Online identity
  • > Career Opportunities: Enhanced visibility

### Technical Achievements

  • > Performance: Industry-leading speed
  • > SEO: Excellent search rankings
  • > Accessibility: Inclusive design
  • > Maintainability: Easy to update and extend

## Conclusion

Building this portfolio with Astro has been an excellent experience. The framework’s focus on performance, developer experience, and content management made it the perfect choice for a portfolio website.

The combination of static site generation, content collections, and selective hydration has resulted in a website that loads instantly, ranks well in search engines, and provides an excellent user experience.

The project demonstrates not just technical skills, but also attention to detail, user experience design, and modern web development practices. It serves as both a showcase of capabilities and a practical demonstration of Astro’s potential for content-focused websites.

This portfolio represents more than just a collection of projects—it’s a testament to the power of modern web development tools and the importance of performance, accessibility, and user experience in creating exceptional digital experiences.

More from this series
Comments