D&D Ecotourism & Real Estate – Multilingual Corporate Website
November 24, 2025
Overview
Most “multilingual websites” look fine until you add the third language, a couple of SEO requirements, and a contact flow that actually needs to be reliable. Then everything turns into brittle middleware rules, duplicated strings, and pages that don’t scale.For D&D Ecotourism & Real Estate, the goal was a platform that stays stable as content grows: type-safe translations, predictable routing, and server-side handling for lead capture (validation, delivery, and failure modes). The architecture was designed so adding a locale is a controlled change, not a rewrite.The frontend is the proof of full‑stack delivery: a fast, accessible UI on top of the routing/i18n foundation, while the backend-side integrations handle the real production needs (forms, email delivery, and SEO metadata).
Key Features
Internationalization (i18n) System
Multi-language support: French, English, and Portuguese with seamless language switching
Type-safe translations: Custom TypeScript implementation ensuring compile-time type checking for translation keys, preventing runtime errors
Smart locale detection: Middleware-based routing that detects user language preferences via:
Browser Accept-Language headers
Cookie-based preference storage
Fallback to default locale
Dynamic routing: Locale-aware URL structure (
/[locale]/page
) with automatic redirection
Next.js App Router Architecture
Server Components: Optimized server-side rendering for improved performance and reduced client-side JavaScript
Static Site Generation: Implemented
generateStaticParams()
for pre-rendering all locale variants at build time
Dynamic Metadata: SEO-optimized metadata generation per locale using
generateMetadata()
for improved search visibility
API Routes: RESTful API endpoints with proper error handling and validation
TypeScript Implementation
Strict type checking: Full type safety across the entire codebase with TypeScript 5 strict mode
Type-safe i18n: Custom translation system with TypeScript generics ensuring translation key validation at compile time
Type guards: Locale validation functions preventing runtime errors
Comprehensive typing: Well-structured type definitions for props, API responses, and configuration objects
Contact Form & Email Integration
Server-side form processing: Robust contact form API with comprehensive input validation
Email integration: Dual email sending (notification + confirmation) via Resend API
Error handling: Proper HTTP status codes and user-friendly error messages
Type-safe requests: Full TypeScript typing for API handlers and request/response objects
Technologies Used
Next.js 16: App Router with Server Components, Middleware, and Static Site Generation
TypeScript 5: Strict mode enabled for maximum type safety
React 19: Modern React patterns with Server Components and Client Components
Tailwind CSS 4: Utility-first styling with responsive design and mobile-first approach
Resend API: Email service integration for contact form functionality
Technical Highlights
Next.js Expertise
App Router with Server Components for performance-first rendering
Locale-aware routing and detection without fragile string parsing
Static generation and metadata for SEO across locales
API endpoints for form processing with validation and predictable responses
TypeScript Expertise
Strict type safety that catches translation mistakes at build time
A type-safe i18n system with generics and guards
Clear interfaces for routing, config, and server responses
Modern React Patterns
Server Components by default, client-only where interactivity is needed
Async server rendering patterns for speed and simplicity
Minimal client state for language switching and UX polish
Challenges and Learnings
Type-Safe Internationalization
One of the main challenges was building a type-safe i18n system that would catch translation errors at compile time rather than runtime. This was solved by creating a custom TypeScript implementation using generics and type guards, ensuring that all translation keys are validated during development.
Intelligent Locale Detection
Implementing middleware-based locale detection required careful consideration of user preferences, browser settings, and fallback mechanisms. The solution involved creating sophisticated routing logic that respects user choices while providing a seamless experience.
Performance Optimization
Balancing server-side rendering with client-side interactivity required strategic use of Server Components and Client Components. This led to significant performance improvements while maintaining a responsive user experience.
API Development Best Practices
Building robust API endpoints with proper validation, error handling, and email integration required careful attention to security and user experience. The implementation includes comprehensive input validation and appropriate HTTP status codes.
Key Achievements
Built a production-ready multilingual website with seamless language switching and intelligent locale detection
Implemented a type-safe i18n system preventing translation errors at compile time, reducing bugs and improving developer experience
Created intelligent routing middleware that enhances user experience through automatic locale detection based on browser preferences
Developed a robust API with proper validation, error handling, and email integration
Optimized for performance using Next.js static generation and server components, resulting in fast page loads
Ensured type safety throughout the entire application with strict TypeScript, catching errors before deployment
Skills Demonstrated
Next.js: App Router, Server Components, Middleware, API Routes, Static Generation, Dynamic Routing
TypeScript: Type Safety, Generics, Type Guards, Interface Design, Strict Mode, Type Inference
React: Server Components, Client Components, Hooks, Modern Patterns, Async Components
Web Development: RESTful APIs, Form Handling, Email Integration, SEO Optimization, Responsive Design
Architecture: Scalable Code Structure, Separation of Concerns, Best Practices, Performance Optimization