Astro Configuration
The main configuration file isastro.config.mjs at the project root.
Complete Configuration
Configuration Breakdown
Integrations
The site uses two main integrations:@astrojs/tailwind
@astrojs/tailwind
Enables Tailwind CSS for utility-first styling. Configured in
astro.config.mjs:9.The integration automatically:- Processes Tailwind directives in CSS files
- Applies the configuration from
tailwind.config.mjs - Enables JIT compilation for faster builds
- Purges unused CSS in production builds
@astrojs/react
@astrojs/react
Enables React component rendering within Astro pages. Configured in
astro.config.mjs:10.Allows you to:- Import and use React components in
.astrofiles - Hydrate React components on the client with
client:*directives - Share state between React components
Output Mode
server output mode enables:
- Server-side rendering (SSR) for all pages
- API routes that execute at request time
- Dynamic rendering based on request context
- No pre-rendering unless explicitly configured per-route
/api/videos.json and /api/thumbnail-proxy endpoints which must run serverless functions.
Vercel Adapter
@astrojs/vercel) transforms your Astro site for Vercel deployment:
- Converts pages to serverless functions
- Optimizes static assets
- Enables edge caching
- Supports Vercel-specific features (Edge Functions, ISR, etc.)
Markdown Configuration
github-light theme. This ensures code examples are readable and well-formatted.
Package Configuration
Thepackage.json file defines dependencies and build scripts.
Dependencies
Core Framework
Core Framework
- astro (^5.16.4) - The Astro framework
- @astrojs/vercel (^8.0.0) - Vercel deployment adapter
UI Integrations
UI Integrations
- @astrojs/react (^4.4.2) - React integration
- react / react-dom (^18.3.1) - React libraries
- @astrojs/tailwind (^5.1.5) - Tailwind CSS integration
- tailwindcss (^3.4.17) - Tailwind CSS framework
Feature Libraries
Feature Libraries
- @joycostudio/marquee (^0.0.13) - Marquee/scrolling text component
- youtube-sr (^4.3.12) - YouTube search and video fetching (no API key required)
- @sentry/astro (^9.46.0) - Error tracking and monitoring
Security
Security
- path-to-regexp (>=6.3.0) - Security override for path matching
Build Scripts
| Script | Command | Description |
|---|---|---|
dev | astro dev | Start development server on localhost:4321 |
start | astro dev | Alias for dev command |
build | astro build | Build production site to dist/ directory |
preview | astro preview | Preview production build locally |
astro | astro | Run Astro CLI commands |
Vercel automatically runs
npm run build during deployment, which executes astro build.Tailwind Configuration
Thetailwind.config.mjs file customizes the Tailwind CSS framework.
Key Features
Content Paths: Tells Tailwind where to scan for class names. This ensures only used utility classes are included in the final CSS bundle, reducing file size. Custom Font: Sets Inter as the primary sans-serif font with system font fallbacks. Brand Colors: Defines a consistent color palette:bg-brand/text-brand- Main brand red (#9e1e3e)bg-brand-light- Lighter variant (#b84660)bg-brand-dark- Darker variant for hover states (#841834)
TypeScript Configuration
Thetsconfig.json extends Astro’s base TypeScript configuration:
- Strict type checking
- Module resolution for Astro components
- JSX support for React integration
Environment Variables
Currently, the site does not require environment variables for core functionality.YouTube Integration
Theyoutube-sr library used in /api/videos.json doesn’t require API keys, so no YouTube API credentials are needed.
Future Environment Variables
If you need to add environment variables:API Routes Configuration
API routes require special configuration to run as serverless functions.Disable Pre-rendering
Each API route must explicitly disable pre-rendering:Caching Headers
Implement appropriate cache headers for performance:Build Output
When you runnpm run build, Astro generates:
dist/ directory is what gets deployed to Vercel.
Production Optimization
Astro automatically optimizes for production:- CSS Minification: All CSS is minified and bundled
- JavaScript Bundling: Client-side JS is optimized and tree-shaken
- Image Optimization: When using Astro’s image components
- Asset Hashing: Cache-busting filenames for static assets
- Tailwind Purging: Unused CSS utilities are removed
Related Resources
- Deploy to Vercel - Step-by-step deployment guide
- Astro Configuration Reference
- Vercel Adapter Documentation