How bakate/astro-theme-starter works
Project type and purpose
• This is primarily a static site generator built with Astro, TypeScript, Tailwind CSS, and MDX.
• It produces a personal portfolio and bilingual blog (EN/FR), with a small serverless contact-form endpoint.
Main components
a. Source Code Modules (developer-facing)
• Astro pages & routes (src/pages/…)
• Feature modules (src/features/blog, …/projects, …/tips, …/contact)
• Reusable UI components (src/components, src/components/ui)
• Layouts (src/layouts)
• Assets & styles (src/assets, src/styles, tailwind.config.mjs)
• i18n config (src/i18n)
• Build/config files (astro.config.mjs, content.config.ts, package.json)
b. Build Pipeline
• Astro compiler & renderer
• TypeScript transpiler
• Tailwind CSS → generated CSS
• MDX + remark plugins → HTML + interactive React components
c. Generated Output
• Static HTML pages (e.g. /blog, /projects, /tips, /contact)
• Static assets (CSS, JS bundles, images, favicons under /public)
d. Hosting & Delivery
• CDN / Static-site hosting (e.g., Vercel, Netlify, or S3 + CloudFront)
• GitHub repository / CI pipeline (optional)
e. Runtime Interactivity
• Client-side scripts: theme toggle, language selector, UI state stores
• Serverless function for contact form: src/pages/api/contact.ts
• External email service / form‐processing API
Relationships & Data Flow
• Developers → Source Code: Push to Git.
• CI/CD → Build Pipeline: On push, run bun install → bun astro build
• Build Pipeline → Generated Output: Produces a /dist folder containing HTML/CSS/JS/images.
• Hosting/CDN → End Users: Serves static assets; caches on edge.
• Browser → Static Pages: User navigates to pre-rendered pages.
• Browser → /api/contact: Form POST → Serverless function → External email API → Response back to browser.
Architectural patterns & design principles
• Separation of Concerns:
• Content in features/*/content (MDX)
• Presentation in Astro/React components (components, layouts)
• Styling via Tailwind CSS + shadcn/ui primitives
• Modular Feature Structure: Each feature (blog, tips, projects, contact) in its own folder with type definitions, service logic, components, and screens.
• Static-First / JAMstack: Pre-render most pages; only minimal serverless for dynamic form.
• Internationalization: UI strings centralized in src/i18n/ui.ts; content folders split by language.