How gramaphenia/sitio-oficial-hexagono works
Main Architectural Components
• Client/Browser: End users interact with the site via a browser.
• Next.js Application Server: This handles server-side rendering (SSR), static generation, and client-side interactions.
• App Routing Layer: Found in the src/app directory, it organizes pages by routes such as “desarrollo-a-medida”, “diseno-web”, “dominio”, “hosting”, “precios”, “seo”, and “sobre-nosotros”. Each route has its own layout and page file.
• API Endpoints: Located within src/app/api (for instance, the sitemap API at src/app/api/sitemap/route.ts) which provide dynamic data (e.g., sitemap generation).
• UI Components and Custom Modules: Directories like src/components/custom and src/components/ui house reusable components and custom elements—these represent the building blocks of the site (headers, footers, cards, menus, etc.).
• Data Layer: The src/data folder includes static data (for design, pricing, testimonials, etc.) that drives content on various pages.
• Utilities & Hooks: The src/hooks, src/lib, and src/utils directories include business logic, form handling (via React Hook Form), and validation (using Zod) that support interactive features in the user interface.
Relationships and Interactions
• The browser sends requests that the Next.js server routes to the appropriate page under src/app/(routes). Each route uses a layout component to provide a consistent structure.
• Within pages, UI components (located in the custom and ui directories) are composed together. They consume data provided from static files (in src/data) and possibly dynamic API responses.
• API endpoints (like the sitemap route) are called from within the application or via scheduled processes, showing the connection between client-facing components and backend logic.
• Global CSS files (src/app/globals.css) and Tailwind CSS configuration (tailwind.config.ts) ensure a consistent look across components.
Important Architectural Patterns and Design Principles
• Modular & Component-Based Architecture: With well-organized modules for pages, components, and data, this structure reinforces the idea of reusability and separation of concerns.
• Routing and Layout: The Next.js app folder structure promotes a clear mapping of URL routes to UI components, with dedicated layouts for each section.
• API Integration: Even though the application is primarily a frontend project, the inclusion of API endpoints shows an integration layer for dynamic content (e.g., sitemap generation).
• Responsive & Accessible Design: With focus on using Radix UI and Tailwind CSS, design accessibility and responsiveness are likely top priorities.