Directory Overview
The project follows Astro’s standard conventions with additional organization for internationalization and components:Key Directories
/src/assets/
Contains dynamic assets that are processed by Astro’s build system:
fonts/- Custom web fontsicons/- SVG icons and graphicsimages/- Photos and images used throughout the site
Assets in this directory are optimized during build time. Astro can automatically optimize images placed here.
/src/components/
Reusable Astro components that make up the wedding website. Each component represents a distinct section:
| Component | Purpose |
|---|---|
Header.astro | Site navigation and language switcher |
Footer.astro | Footer with contact information |
SectionPrincipal.astro | Hero section with couple names |
SectionCelebration.astro | Wedding date and venue details |
SectionForm.astro | RSVP confirmation form |
SectionGaleria.astro | Photo gallery |
SectionGift.astro | Gift registry information |
SectionHospedaje.astro | Accommodation recommendations |
SectionDressCode.astro | Dress code guidelines |
SectionContact.astro | Contact information |
SectionPlayList.astro | Music playlist suggestions |
SectionPreWeding.astro | Pre-wedding events |
SectionSugerencia.astro | Suggestions and tips |
SectionImgFondo.astro | Background image sections |
/src/i18n/
Internationalization (i18n) system supporting three languages:
es.json- Spanish translations (default)en.json- English translationsde.json- German translationsindex.ts- Translation utilities and language detection
How It Works
Spanish (
es) is the default language. URLs with /en/ or /de/ prefixes load English or German versions./src/layouts/
Contains layout components that wrap page content:
Layout.astro- Main layout with HTML structure, meta tags, and global styles
/src/pages/
Defines routes using Astro’s file-based routing:
API Routes
The/api/confirmar.ts endpoint handles RSVP form submissions:
- Method: POST
- Payload:
{ nombre: string, alergia?: string, asistencia: string } - Functionality: Sends confirmation emails via Nodemailer
- Prerender: Disabled (
prerender = false) for SSR
API routes use the
@astrojs/node adapter to enable server-side functionality in production./src/styles/
Global CSS and Tailwind configuration files.
/public/
Static files served directly without processing:
- Favicons
- Robots.txt (if needed)
- Other static assets that don’t require optimization
Configuration Files
astro.config.mjs
Main Astro configuration:
- Vite plugin: Integrates TailwindCSS 4.x
- Node adapter: Enables SSR in standalone mode
- Standalone mode: Generates a self-contained server for deployment
tsconfig.json
TypeScript configuration:
package.json
Project metadata and dependencies:
- Name:
boda(Spanish for “wedding”) - Type:
module(ES modules) - Version: 0.0.1
Routing & Internationalization
The site uses URL-based language detection:| URL | Language |
|---|---|
/ | Spanish (default) |
/en/ | English |
/de/ | German |
Adding a New Language
Architecture Patterns
Component Composition
The homepage (index.astro) imports and composes section components:
Server-Side Rendering (SSR)
The project uses hybrid rendering:- Static pages: Pre-rendered at build time (default)
- API routes: Server-rendered on-demand (SSR)
The
standalone mode in the Node adapter creates a production server that can handle both static files and SSR routes.Best Practices
- Component Organization: Keep section components focused on a single responsibility
- Translations: Always add new text to all language files (
es.json,en.json,de.json) - Assets: Place processed assets in
/src/assets/and static files in/public/ - Type Safety: Leverage TypeScript for better code quality and autocomplete
- Environment Variables: Never commit
.envfiles with real credentials
Next Steps
- Explore the development setup guide to get started
- Check out the internationalization documentation to add new languages
- Learn about the component architecture to build new sections
- Explore Astro’s documentation for advanced features