π Live Site: www.laguntzafisioterapia.com
A production-ready, multilingual Astro website showcasing modern web development best practices
Features β’ Quick Start β’ Tech Stack β’ Documentation
Laguntza Fisioterapia is a complete, production-ready website built with Astro for a physiotherapy clinic in Urnieta, Gipuzkoa (Basque Country, Spain). This project serves as both a functional business website and a reference implementation for building modern, multilingual static sites with Astro.
- π Real-world Production Site - Serving actual users at laguntzafisioterapia.com
- π― Complete Feature Set - From i18n to contact forms, blog, SEO, and deployment
- π Educational Resource - Well-structured code demonstrating Astro best practices
- ποΈ Scalable Architecture - Modular component system ready for expansion
- π Full CI/CD Pipeline - Automated testing, formatting, and deployment
- Astro Developers looking for a comprehensive example project
- Web Agencies needing a template for client websites
- Students learning modern static site generation
- Businesses seeking a customizable website foundation
- β‘ Zero-JS by Default - Astro's Islands Architecture with selective hydration
- ποΈ Component Islands - Interactive components only where needed (maps, forms)
- π¦ Content Collections - Type-safe content management (coming soon for blog posts)
- π¨ Astro Components - Reusable
.astrocomponents with scoped styling - π§ TypeScript Integration - Full type safety across the project
- π± MDX Support - Write content with components embedded
- π Dual Language - Full Basque (eu) and Spanish (es) support
- π Language Routing -
/[lang]/route pattern with Astro's file-based routing - π― Language Toggle - Smooth client-side language switching
- π Translation System - Centralized UI translations in
src/i18n/ - π Locale-aware URLs - SEO-friendly multilingual routes
- π― SEO Excellence - Meta tags, Open Graph, JSON-LD structured data
- πΊοΈ Interactive Maps - Leaflet integration with lazy loading
- π Contact Forms - Form handling with validation
- π° MDX Blog System - Markdown + JSX for rich blog content
- π¨ Theme System - Dark/light mode with CSS custom properties
- βΏ Accessibility - WCAG compliant, semantic HTML
- π Analytics Ready - Structured for Google Analytics/Tag Manager
- π₯ Hot Module Replacement - Instant feedback during development
- π― TypeScript - Full type safety with
astro check - π Prettier - Automated code formatting
- π³ Docker Support - Containerized deployment with Nginx
- π CI/CD Pipeline - GitHub Actions for testing and deployment
- π¦ pnpm - Fast, efficient package management
- Astro
v4.x- The web framework for content-driven websites- File-based routing
- Component Islands architecture
- Built-in optimization (CSS, images, fonts)
- Static Site Generation (SSG)
- TypeScript - Type safety and better DX
- pnpm - Fast, disk-space efficient package manager
- CSS Custom Properties - Theme system with CSS variables
- Modern CSS - Grid, Flexbox, Container Queries
- Responsive Design - Mobile-first approach
- No CSS Framework - Vanilla CSS for maximum control and performance
- MDX - Markdown with embedded components for blog posts
- Astro Content Collections - Type-safe content management (future enhancement)
- Static Assets - Optimized images and fonts
- GSAP - High-performance animations
- Leaflet - Interactive maps (with Islands hydration)
- Vanilla JavaScript - Minimal client-side JS for forms and interactions
- Prettier - Code formatting
- ESLint - Code linting (configurable)
- GitHub Actions - CI/CD automation
- Nginx - Web server
- Docker - Containerization
- GitHub Actions - Automated deployment pipeline
- VPS/Cloud Hosting - Production deployment
This stack prioritizes:
- β‘ Performance - Astro ships zero JavaScript by default
- π― SEO - Static HTML generation for optimal crawlability
- π§βπ» Developer Experience - TypeScript, hot reload, modern tooling
- π¨ Flexibility - No opinionated CSS framework, full control
- π° Cost Efficiency - Static hosting is cheap/free everywhere
- Node.js v18.14.1 or higher (check
.nvmrcfor exact version) - pnpm v8 or higher (recommended) or npm
- Git for version control
-
Clone the repository:
git clone https://github.com/jramosg/laguntza-fisioterapia.git cd laguntza-fisioterapia -
Install dependencies:
pnpm install # or npm install -
Start the development server:
pnpm dev # or npm run dev -
Open your browser:
Navigate to http://localhost:4321
- π Edit content in
src/pages/[lang]/ - π¨ Customize theme in
src/styles/theme.css - βοΈ Configure site settings in
src/config/ - πΌοΈ Add images to
src/images/orpublic/assets/
| Command | Action |
|---|---|
pnpm dev |
Start local dev server at localhost:4321 |
pnpm build |
Build production site to ./dist/ |
pnpm preview |
Preview production build locally |
pnpm format |
Format all files with Prettier |
pnpm format:check |
Check if files are formatted |
pnpm astro ... |
Run Astro CLI commands |
- Update company info in
src/config/company.ts - Replace logo in
src/images/logos/ - Update navigation in
src/config/nav.ts - Customize theme colors in
src/styles/theme.css - Add your content in
src/pages/[lang]/ - Update contact form endpoint in
src/components/forms/ContactForm.astro - Configure deployment in
.github/workflows/
pnpm devThe development server includes:
- π₯ Hot Module Replacement (HMR)
- β‘ Fast refresh for Astro components
- π TypeScript checking
- π¦ Automatic dependency updates
# Build the site
pnpm build
# Preview the production build
pnpm previewThe build process:
- Compiles TypeScript
- Processes and optimizes CSS
- Optimizes images
- Generates static HTML
- Creates
/distdirectory
# Format all files
pnpm format
# Check formatting
pnpm format:check
# Type checking
pnpm astro check- Make changes in
src/ - Check in browser at
localhost:4321 - Run
pnpm formatbefore committing - Build and preview before deploying
# Add a package
pnpm add package-name
# Add a dev dependency
pnpm add -D package-name
# Update dependencies
pnpm update- Use browser DevTools for client-side debugging
- Check Astro output in terminal for build errors
- Use
console.log()in component frontmatter (runs at build time) - Enable verbose logging in
astro.config.mjsif needed
This project demonstrates a complete CI/CD workflow using GitHub Actions.
Format Check (runs on all pushes and PRs)
- Checkout code
- Setup Node.js (from .nvmrc)
- Install pnpm
- Cache dependencies
- Install dependencies
- Run Prettier checkBenefits:
- β Ensures code consistency
- β Catches formatting issues early
- β Fast feedback with caching
Automated Deployment (runs on master with [deploy] tag)
- Format check passes
- Build Docker image
- Deploy to production server
- Health check verificationWorkflow Triggers:
- Automatic: Push to
masterwith[deploy]in commit message - Manual: Via GitHub Actions UI
Deployment Flow:
Code Change β Push β Format Check β [deploy] tag? β Build β Deploy β Live
β
β Fail β No deployment
β
Pass β Continue
- π Security: Secrets for deployment credentials
- β‘ Performance: Dependency caching for faster builds
- π― Reliability: Health checks after deployment
- π Visibility: Clear status checks on PRs
- π Automation: Reduces manual deployment errors
-
Add GitHub Secrets (Settings β Secrets):
DEPLOY_HOST=your-server.com DEPLOY_USER=deploy-user DEPLOY_KEY=ssh-private-key -
Customize workflows in
.github/workflows/ -
Update deployment script for your infrastructure
This project includes a production-ready Dockerfile with Nginx.
# Build the Docker image
docker build -t laguntza-fisioterapia .
# Run the container
docker run -p 8080:8080 laguntza-fisioterapia
# Access at http://localhost:8080The Docker setup:
- Multi-stage build for minimal image size
- Nginx for efficient static file serving
- Optimized for production performance
- Configurable via
nginx/nginx.conf
The project includes automated workflows:
- Triggers on every push and PR
- Validates code formatting with Prettier
- Uses pnpm with dependency caching
- Triggers on push to
masterwith[deploy]in commit message - Can also be triggered manually
- Builds and deploys to production server
Deployment Example:
git commit -m "Update services page [deploy]"
git push origin master# Already configured via netlify.toml
# Connect repository to Netlify for automatic deploymentsvercel --prodUpload the dist/ folder to any static hosting service:
- GitHub Pages
- Cloudflare Pages
- AWS S3 + CloudFront
- DigitalOcean App Platform
For production deployments, set these if needed:
# Example environment variables
PUBLIC_SITE_URL=https://www.laguntzafisioterapia.com
PUBLIC_ANALYTICS_ID=your-idAdd to your hosting platform's environment variables or .env file.
laguntza-fisioterapia/
βββ .github/
β βββ workflows/ # CI/CD pipelines
β βββ format.yml # Prettier formatting checks
β βββ deploy.yml # Automated deployment
βββ nginx/
β βββ nginx.conf # Production Nginx configuration
βββ public/ # Static assets (copied as-is)
β βββ robots.txt
β βββ site.webmanifest
β βββ assets/
β β βββ icons/ # Favicon and app icons
β βββ fonts/ # Web fonts
βββ src/
β βββ components/ # π§© Reusable Astro components
β β βββ blog/ # Blog-specific components
β β β βββ BlogPostPreview.astro
β β β βββ BlogPostsList.astro
β β βββ buttons/ # Button components
β β β βββ Burger.astro
β β β βββ Button.astro
β β βββ core/ # Layout & navigation
β β β βββ Header.astro
β β β βββ Footer.astro
β β β βββ Nav.astro
β β β βββ Container.astro
β β βββ form-fields/ # Form input components
β β β βββ FormInput.astro
β β β βββ FormSelect.astro
β β β βββ FormTextarea.astro
β β βββ forms/ # Complete forms
β β β βββ ContactForm.astro
β β βββ head/ # HTML <head> components
β β β βββ BaseHead.astro
β β β βββ OpenGraph.astro
β β β βββ StructuredData.astro
β β β βββ FAQSchema.astro
β β βββ sections/ # Page sections
β β β βββ AboutSection.astro
β β β βββ CtaCardSection.astro
β β β βββ TextSection.astro
β β β βββ heros/
β β β βββ HeroSection.astro
β β β βββ TextAndImageHero.astro
β β βββ theme-switcher/ # Dark/light mode
β β βββ ThemeProvider.astro
β β βββ ThemeSwitcher.astro
β βββ config/ # βοΈ Configuration files
β β βββ company.ts # Company information
β β βββ footer.ts # Footer links
β β βββ nav.ts # Navigation structure
β β βββ settings.ts # Site settings
β βββ i18n/ # π Internationalization
β β βββ ui.ts # Translation strings
β β βββ utils.ts # i18n helper functions
β βββ icons/ # SVG icons
β βββ images/ # Optimized images
β β βββ logos/ # Brand logos
β βββ layouts/ # π Page layouts
β β βββ Base.astro # Base HTML layout
β β βββ Page.astro # Standard page layout
β β βββ Post.astro # Blog post layout
β βββ pages/ # ποΈ File-based routing
β β βββ index.astro # Homepage (redirects)
β β βββ 404.astro # 404 page
β β βββ [lang]/ # Multilingual routes
β β βββ index.astro
β β βββ about.astro
β β βββ services.astro
β β βββ contact.astro
β β βββ gallery.astro
β β βββ opening.astro
β βββ styles/ # π¨ Global styles
β β βββ global.css # Global styles & utilities
β β βββ reset.css # CSS reset
β β βββ theme.css # Theme variables
β β βββ typography.css # Typography styles
β β βββ index.css # Style imports
β βββ utils/ # π§ Utility functions
β β βββ helpers.js
β βββ env.d.ts # TypeScript env definitions
β βββ types.ts # TypeScript types
βββ astro.config.mjs # Astro configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json # Dependencies & scripts
βββ pnpm-lock.yaml # Lockfile
βββ Dockerfile # Docker configuration
βββ netlify.toml # Netlify config (alternative)
βββ README.md # This file
Modular, reusable Astro components organized by function. Each component is self-contained with its logic and styles.
Centralized configuration makes it easy to update site-wide settings without touching component code.
Translation system supporting multiple languages. Add new languages by extending ui.ts.
Astro's file-based routing. Files here become routes automatically. [lang]/ creates dynamic language routes.
Global CSS and theme system using CSS custom properties for easy customization.
astro.config.mjs- Main Astro configurationsrc/env.d.ts- TypeScript environment types.astrofiles - Astro component format (HTML-like with frontmatter)
The entire visual theme is controlled by CSS custom properties in src/styles/theme.css:
:root {
--color-primary: #your-color;
--color-secondary: #your-color;
--font-family-sans: 'Your Font', sans-serif;
/* ... more variables */
}- Add language to
astro.config.mjs:
i18n: {
locales: ['eu', 'es', 'en'], // Add 'en'
defaultLocale: 'eu'
}- Add translations to
src/i18n/ui.ts:
export const ui = {
en: {
'nav.home': 'Home',
// ... more translations
}
}- Create pages in
src/pages/en/
Edit src/config/nav.ts:
export const navItems = {
eu: [
{ title: 'Hasiera', slug: '/eu/' },
{ title: 'Guri buruz', slug: '/eu/about' },
// Add your items
]
}- Create an Astro file in
src/pages/[lang]/your-page.astro - Use an existing layout:
---
import Page from '../../layouts/Page.astro';
---
<Page title="Your Page Title">
<!-- Your content -->
</Page>- Add to navigation in
src/config/nav.ts
The contact form is in src/components/forms/ContactForm.astro. To connect it to your backend:
- Set the form action endpoint
- Configure form handling (e.g., Formspree, Netlify Forms, custom API)
- Update validation as needed
- Use CSS custom properties for colors, spacing, and typography
- Keep component styles scoped with
<style>tags in.astrofiles - Use utility classes sparingly - prefer component-specific styles
- Follow mobile-first responsive design
- Astro Docs - Official documentation
- Astro Tutorial - Step-by-step guide
- Astro Patterns - Common patterns
- Astro Islands - Islands architecture
src/pages/[lang]/about.astro β /{lang}/about
src/pages/[lang]/index.astro β /{lang}/
---
// Component Script (runs at build time)
const { title } = Astro.props;
---
<!-- Template (HTML) -->
<h1>{title}</h1>
<style>
/* Scoped styles */
h1 { color: var(--color-primary); }
</style>Only hydrate interactive components:
<!-- Static (no JS) -->
<Header />
<!-- Interactive (hydrates in browser) -->
<LeafletMap client:load />// src/i18n/utils.ts
export function useTranslations(lang: string) {
return function t(key: string) {
return ui[lang][key] || ui[defaultLang][key];
}
}- Astro Themes - More Astro starter themes
- Astro Blog - Official blog example
- Awesome Astro - Curated Astro resources
- Minimize JavaScript: Use static components when possible
- Optimize Images: Use Astro's image optimization
- Lazy Load: Use
client:visiblefor below-fold components - CSS Optimization: Astro automatically scopes and optimizes CSS
- Prefetching: Consider adding prefetch for key pages
Contributions are welcome! Whether you're fixing a bug, adding a feature, or improving documentation.
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name
- Make your changes
- Format your code
pnpm format
- Commit with a descriptive message
git commit -m "Add: description of your changes" - Push to your fork
git push origin feature/your-feature-name
- Open a Pull Request
- β Follow existing code style (use Prettier)
- β Test your changes locally
- β Update documentation if needed
- β Keep PRs focused on a single feature/fix
- β Write clear commit messages
- π Bug fixes
- β¨ New features
- π Documentation improvements
- π Additional language translations
- βΏ Accessibility enhancements
- β‘ Performance optimizations
- π¨ UI/UX improvements
Found a bug? Please open an issue with:
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
- π§ Contact: info@laguntzafisioterapia.com
- π Issues: GitHub Issues
- π¬ Astro Discord: astro.build/chat
- Lines of Code: ~5,000+
- Components: 30+
- Languages Supported: 2 (Basque, Spanish)
- Performance Score: 95+ (Lighthouse)
- Build Time: ~10 seconds
- Bundle Size: < 50KB JS (minimal)
This project demonstrates:
- β Production-Ready Astro Site - Real business website in active use
- β Complete i18n Implementation - Multilingual routing and content
- β Modern DevOps - CI/CD, Docker, automated deployment
- β Performance First - Lighthouse scores 95+
- β Accessibility - WCAG compliant
- β SEO Optimized - Meta tags, Open Graph, structured data
- β Developer Experience - TypeScript, hot reload, linting
Perfect for:
- π₯ Healthcare/Medical Sites - Clinics, practices, health services
- π’ Small Business Websites - Services, contact, about pages
- π Multilingual Sites - International or regional businesses
- π Learning Astro - Real-world example with best practices
- π Starter Template - Fork and customize for your needs
This project is licensed under the MIT License.
Laguntza Fisioterapia
π Zubitxo Plaza, 3, 20130 Urnieta, Gipuzkoa
πΊοΈ View on Google Maps
Built with β€οΈ using Astro
β If this project helped you, consider giving it a star!
Live Website β’ Report Bug β’ Request Feature