This document explains how the Astro site is organized, how pages are composed, and where to make changes safely.
The site is a static Astro project with route-level pages in src/pages, shared page chrome in src/layouts, and reusable section components in src/components.
Architecture goals:
- Keep route files thin and composition-focused.
- Keep visual consistency centralized through global design tokens.
- Use static assets and Astro optimizations for predictable performance.
- Minimize runtime JavaScript and only use scripts for targeted interaction.
src/pages: Route entrypoints. Each file maps directly to a URL.src/layouts/Layout.astro: Shared HTML shell, metadata defaults, and global CSS tokens/utilities.src/components/common: Reused, cross-page components such as navigation and footer.src/components/sections: Home-page or feature sections designed for composition.src/assets: Source image assets processed by Astro's asset pipeline.public: Static files served directly (no processing), ideal for fixed paths and downloadable assets.documentation: Internal documentation for architecture, components, and development workflows.
The current design follows Astro's static-first rendering model:
- Most UI is server-rendered to static HTML at build time.
- Components are mostly presentational and CSS-driven.
- Small inline scripts are used only when interaction is required.
This keeps first render deterministic and reduces client-side execution overhead.
First-load orchestration policy:
- Critical above-the-fold visual sections may use a tiny inline script to gate animation start.
- Hero animation must start only after required assets are loaded (or errored) and the page load event has fired on first visit.
- Use a CSS ready-state class (for example,
.is-ready) to reveal and animate content in a controlled first frame.
Global visual language is defined in src/layouts/Layout.astro.
Core tokens currently in use:
--bg-color: main dark background.--text-white: primary text color.--accent-purple: brand accent.--border-color: high-contrast border and framing color.
Styling conventions:
- Favor token usage over hardcoded colors.
- Preserve sharp-edge brutalist style (no accidental border-radius creep).
- Reuse common utility classes before adding one-off alternatives.
- Scope component CSS to each
.astrofile unless a style is truly global.
Recommended route composition:
- Import
Layoutand shared blocks (Navbar,Footer). - Compose with section components.
- Keep page-level logic limited to route-specific data or orchestration.
Example conceptual structure:
<Layout title="Page Title">
<Navbar />
<main>
<SectionA />
<SectionB />
</main>
<Footer />
</Layout>Two image paths are used in this codebase:
Imagefromastro:assetsfor local source assets insrc/assets.- Native
imgfor public-path or dynamic list content.
Current policy:
- Non-critical and decorative images should use
loading="lazy"anddecoding="async". - Keep meaningful
alttext for accessibility and SEO. - Prefer
Imagefor build-time optimization when assets are local and static. - Above-the-fold assets tied to entrance animation can use
loading="eager"andfetchpriority="high". - If a first-frame placeholder flash appears, gate visibility until assets complete loading.
When to use eager loading:
- If a primary above-the-fold image is a true LCP element and lazy loading hurts perceived speed, switch only that image to eager after measurement.
Baseline standards:
- External links with
target="_blank"must includerel="noopener noreferrer". - Avoid inline event handlers (
onerror,onclick, etc.) in markup. - Use script listeners for fallback or interactive behavior.
- Keep DOM updates minimal and predictable.
- Prioritize text and structure render before decorative media.
- Avoid large blocking scripts and unnecessary hydration.
- Defer non-critical images via lazy loading.
- Self-host shared fonts from local dependencies to avoid third-party font waterfall on first load.
- Restrict font subsets/weights to what the UI actually uses.
- Rebuild and verify after introducing heavy media or animation changes.
When major architecture decisions are made, document them in PR notes and reference this file.
Recommended decision-note template:
- Context and problem.
- Chosen approach.
- Alternatives rejected.
- Trade-offs and follow-up actions.