Skip to content

jramosg/laguntza-fisioterapia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

184 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ Laguntza Fisioterapia - Modern Astro Website

🌐 Live Site: www.laguntzafisioterapia.com

Built with Astro TypeScript License: MIT

A production-ready, multilingual Astro website showcasing modern web development best practices

Features β€’ Quick Start β€’ Tech Stack β€’ Documentation


πŸ“– About This Project

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.

What Makes This Project Special

  • 🌍 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

Who Is This For?

  • 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

✨ Features

Core Astro Features Demonstrated

  • ⚑ 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 .astro components with scoped styling
  • πŸ”§ TypeScript Integration - Full type safety across the project
  • πŸ“± MDX Support - Write content with components embedded

Internationalization (i18n)

  • 🌐 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

Production-Ready Features

  • 🎯 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

Developer Experience

  • πŸ”₯ 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

πŸ› οΈ Tech Stack

Framework & Build Tools

  • 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

UI & Styling

  • 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

Content & Data

  • MDX - Markdown with embedded components for blog posts
  • Astro Content Collections - Type-safe content management (future enhancement)
  • Static Assets - Optimized images and fonts

Interactive Features

  • GSAP - High-performance animations
  • Leaflet - Interactive maps (with Islands hydration)
  • Vanilla JavaScript - Minimal client-side JS for forms and interactions

Developer Tools

  • Prettier - Code formatting
  • ESLint - Code linting (configurable)
  • GitHub Actions - CI/CD automation

Deployment & Infrastructure

  • Nginx - Web server
  • Docker - Containerization
  • GitHub Actions - Automated deployment pipeline
  • VPS/Cloud Hosting - Production deployment

Why This Stack?

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

πŸš€ Quick Start

Prerequisites

  • Node.js v18.14.1 or higher (check .nvmrc for exact version)
  • pnpm v8 or higher (recommended) or npm
  • Git for version control

Installation

  1. Clone the repository:

    git clone https://github.com/jramosg/laguntza-fisioterapia.git
    cd laguntza-fisioterapia
  2. Install dependencies:

    pnpm install
    # or
    npm install
  3. Start the development server:

    pnpm dev
    # or
    npm run dev
  4. Open your browser:

    Navigate to http://localhost:4321

First Steps

  • πŸ“ Edit content in src/pages/[lang]/
  • 🎨 Customize theme in src/styles/theme.css
  • βš™οΈ Configure site settings in src/config/
  • πŸ–ΌοΈ Add images to src/images/ or public/assets/

Project Commands

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

Quick Customization Checklist

  • 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/

πŸ—οΈ Development Workflow

Local Development

pnpm dev

The development server includes:

  • πŸ”₯ Hot Module Replacement (HMR)
  • ⚑ Fast refresh for Astro components
  • πŸ” TypeScript checking
  • πŸ“¦ Automatic dependency updates

Building for Production

# Build the site
pnpm build

# Preview the production build
pnpm preview

The build process:

  1. Compiles TypeScript
  2. Processes and optimizes CSS
  3. Optimizes images
  4. Generates static HTML
  5. Creates /dist directory

Code Quality

# Format all files
pnpm format

# Check formatting
pnpm format:check

# Type checking
pnpm astro check

Testing Changes

  1. Make changes in src/
  2. Check in browser at localhost:4321
  3. Run pnpm format before committing
  4. Build and preview before deploying

Adding Dependencies

# Add a package
pnpm add package-name

# Add a dev dependency
pnpm add -D package-name

# Update dependencies
pnpm update

Debugging Tips

  • 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.mjs if needed

πŸ”§ CI/CD Pipeline

This project demonstrates a complete CI/CD workflow using GitHub Actions.

Continuous Integration

Format Check (runs on all pushes and PRs)

- Checkout code
- Setup Node.js (from .nvmrc)
- Install pnpm
- Cache dependencies
- Install dependencies
- Run Prettier check

Benefits:

  • βœ… Ensures code consistency
  • βœ… Catches formatting issues early
  • βœ… Fast feedback with caching

Continuous Deployment

Automated Deployment (runs on master with [deploy] tag)

- Format check passes
- Build Docker image
- Deploy to production server
- Health check verification

Workflow Triggers:

  1. Automatic: Push to master with [deploy] in commit message
  2. Manual: Via GitHub Actions UI

Deployment Flow:

Code Change β†’ Push β†’ Format Check β†’ [deploy] tag? β†’ Build β†’ Deploy β†’ Live
                          ↓
                       ❌ Fail β†’ No deployment
                       βœ… Pass β†’ Continue

Best Practices Demonstrated

  • πŸ”’ 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

Setup for Your Project

  1. Add GitHub Secrets (Settings β†’ Secrets):

    DEPLOY_HOST=your-server.com
    DEPLOY_USER=deploy-user
    DEPLOY_KEY=ssh-private-key
    
  2. Customize workflows in .github/workflows/

  3. Update deployment script for your infrastructure

🚒 Deployment

Docker Deployment

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:8080

The Docker setup:

  • Multi-stage build for minimal image size
  • Nginx for efficient static file serving
  • Optimized for production performance
  • Configurable via nginx/nginx.conf

CI/CD with GitHub Actions

The project includes automated workflows:

1. Format Check (.github/workflows/format.yml)

  • Triggers on every push and PR
  • Validates code formatting with Prettier
  • Uses pnpm with dependency caching

2. Deployment (.github/workflows/deploy.yml)

  • Triggers on push to master with [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

Alternative Deployment Options

Netlify

# Already configured via netlify.toml
# Connect repository to Netlify for automatic deployments

Vercel

vercel --prod

Static Hosting

Upload the dist/ folder to any static hosting service:

  • GitHub Pages
  • Cloudflare Pages
  • AWS S3 + CloudFront
  • DigitalOcean App Platform

Environment Variables

For production deployments, set these if needed:

# Example environment variables
PUBLIC_SITE_URL=https://www.laguntzafisioterapia.com
PUBLIC_ANALYTICS_ID=your-id

Add to your hosting platform's environment variables or .env file.

πŸ“ Project Structure

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

Key Directories Explained

/src/components/

Modular, reusable Astro components organized by function. Each component is self-contained with its logic and styles.

/src/config/

Centralized configuration makes it easy to update site-wide settings without touching component code.

/src/i18n/

Translation system supporting multiple languages. Add new languages by extending ui.ts.

/src/pages/

Astro's file-based routing. Files here become routes automatically. [lang]/ creates dynamic language routes.

/src/styles/

Global CSS and theme system using CSS custom properties for easy customization.

Astro-Specific Files

  • astro.config.mjs - Main Astro configuration
  • src/env.d.ts - TypeScript environment types
  • .astro files - Astro component format (HTML-like with frontmatter)

🎨 Customization Guide

Theme Customization

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 */
}

Adding a New Language

  1. Add language to astro.config.mjs:
i18n: {
  locales: ['eu', 'es', 'en'], // Add 'en'
  defaultLocale: 'eu'
}
  1. Add translations to src/i18n/ui.ts:
export const ui = {
  en: {
    'nav.home': 'Home',
    // ... more translations
  }
}
  1. Create pages in src/pages/en/

Customizing Navigation

Edit src/config/nav.ts:

export const navItems = {
  eu: [
    { title: 'Hasiera', slug: '/eu/' },
    { title: 'Guri buruz', slug: '/eu/about' },
    // Add your items
  ]
}

Adding a New Page

  1. Create an Astro file in src/pages/[lang]/your-page.astro
  2. Use an existing layout:
---
import Page from '../../layouts/Page.astro';
---

<Page title="Your Page Title">
  <!-- Your content -->
</Page>
  1. Add to navigation in src/config/nav.ts

Modifying the Contact Form

The contact form is in src/components/forms/ContactForm.astro. To connect it to your backend:

  1. Set the form action endpoint
  2. Configure form handling (e.g., Formspree, Netlify Forms, custom API)
  3. Update validation as needed

Styling Best Practices

  • Use CSS custom properties for colors, spacing, and typography
  • Keep component styles scoped with <style> tags in .astro files
  • Use utility classes sparingly - prefer component-specific styles
  • Follow mobile-first responsive design

πŸ“š Learning Resources

Astro Documentation

Key Concepts in This Project

1. File-Based Routing

src/pages/[lang]/about.astro β†’ /{lang}/about
src/pages/[lang]/index.astro β†’ /{lang}/

2. Component Structure

---
// Component Script (runs at build time)
const { title } = Astro.props;
---

<!-- Template (HTML) -->
<h1>{title}</h1>

<style>
  /* Scoped styles */
  h1 { color: var(--color-primary); }
</style>

3. Islands Architecture

Only hydrate interactive components:

<!-- Static (no JS) -->
<Header />

<!-- Interactive (hydrates in browser) -->
<LeafletMap client:load />

4. Internationalization Pattern

// src/i18n/utils.ts
export function useTranslations(lang: string) {
  return function t(key: string) {
    return ui[lang][key] || ui[defaultLang][key];
  }
}

Related Projects

Performance Tips

  1. Minimize JavaScript: Use static components when possible
  2. Optimize Images: Use Astro's image optimization
  3. Lazy Load: Use client:visible for below-fold components
  4. CSS Optimization: Astro automatically scopes and optimizes CSS
  5. Prefetching: Consider adding prefetch for key pages

🀝 Contributing

Contributions are welcome! Whether you're fixing a bug, adding a feature, or improving documentation.

How to Contribute

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/your-feature-name
  3. Make your changes
  4. Format your code
    pnpm format
  5. Commit with a descriptive message
    git commit -m "Add: description of your changes"
  6. Push to your fork
    git push origin feature/your-feature-name
  7. Open a Pull Request

Contribution Guidelines

  • βœ… 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

Areas for Contribution

  • πŸ› Bug fixes
  • ✨ New features
  • πŸ“ Documentation improvements
  • 🌍 Additional language translations
  • β™Ώ Accessibility enhancements
  • ⚑ Performance optimizations
  • 🎨 UI/UX improvements

Reporting Issues

Found a bug? Please open an issue with:

  • Clear description
  • Steps to reproduce
  • Expected vs actual behavior
  • Screenshots (if applicable)

πŸ’¬ Community & Support

πŸ“Š Project Stats

  • 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)

⭐ Showcase

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

🎯 Use Cases

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

License

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

Releases

No releases published

Packages

 
 
 

Contributors