How dsan01/dscode works
Project Type and Purpose
• This is a Jamstack-style static website built with the Astro framework.
• Its purpose is to generate a multilingual portfolio or services site, sourcing content from local markdown files (src/data/project/...) and static TypeScript data (src/data/static/*). It uses Astro’s island architecture to render most of the page at build time, with interactive bits powered by React (TSX components).
File Structure Analysis
• Top-level:
• public/ – truly static files (images, favicon, etc.).
• astro.config.mjs, package.json – build/config.
• src/:
• assets/ – raw images, 404 graphics.
• components/ – UI split into generics, primitives, sections, and ui.
• data/ – content sources:
– project/* (multilingual markdown),
– static/ (TS data for services and trajectory).
• pages/ – route files (Astro templates) including dynamic [slug].astro.
• layouts/ – top-level layout wrapper.
• lib/ – helper code (DOM selectors, Strapi client stub).
• i18n/ – internationalization utilities and UI strings.
• store/ – client-side state management for filters.
• styles/, types/, tsconfig.json – styling and TypeScript support.
Key Insights from README
• This project started from Astro’s “basics” template; core behaviors (build, dev server, preview) follow Astro’s standard CLI.
• No cloud-native or back-end service beyond static files; dynamic behavior is limited to client islands and optional Strapi fetching.
a. Main Components
1. Content Sources
• Local Markdown files (src/data/project/*)
• Static TS data (src/data/static/*)
2. Astro Build Engine
• Reads astro.config.mjs
• Parses pages and components, applies layouts
• Generates static HTML/CSS/JS in dist/
3. Component Library
• Astro components (.astro) for static parts
• React/TSX components for interactive islands
4. Internationalization Layer
• src/i18n/* utilities inject translations at build time
5. Client-Side Runtime
• Small React/Preact islands for UI state (filter store, modals, carousel)
6. Static Assets
• public/ folder served untouched
7. (Optional) External API
• src/lib/strapi.ts indicates potential Strapi CMS integration
b. Relationships & Data Flows
• At Build Time:
• Content Sources → Astro Build Engine → Pages & Layouts → Static HTML/CSS
• i18n Utilities transform text for each locale → Inject into pages/components
• At Client Runtime:
• User → interacts with React/TSX islands → state in store/ → UI updates
• Static assets and JS bundles served by CDN
• (If used) API calls to Strapi → dynamic content fetched in islands
c. Architectural Patterns & Principles
• Jamstack: Pre-built assets, decoupled front end, served via CDN
• Component-Based UI: Clear separation into generics/primitives/sections/ui
• Island Architecture: Only hydrate interactive pieces of the page
• Directory-Driven Routing: Astro pages folder automatically defines routes
d. Key Technologies
• Astro (Static site generator)
• TypeScript, React/Preact for interactive islands
• Markdown for content
• CSS (global.css)
• (Optional) Strapi API client