How creadordesistemas/activa-asesores-mejorado works
1. Overall shape
- This is a Next.js 14 App Router site, not a monolithic SPA.
- The repo is split into server-rendered route segments under app/, shared UI components under components/ui, and a small backend/API surface in app/api.
- Most of the site is a corporate/SEO content site with many landing pages, plus a small admin/config area and contact/chat endpoints.
2. Request entry and global shell
- app/layout.js is the root shell for every route, and the README indicates it provides the shared Navbar + Footer.
- app/globals.css defines global styling and design tokens, while Tailwind is the main styling system.
- Framework-level fallbacks exist in app/error.js, app/loading.js, and app/not-found.js, so the app relies on Next’s route boundaries for runtime behavior.
3. Route composition model
- Each folder under app/ is a route segment with its own page component, e.g. /contacto, /quienes-somos, /aviso-legal, and the larger content trees under /energia and /gestiones.
- Most pages appear to be independent content pages rather than feature screens sharing a lot of client-side state.
- This structure is well suited to an architecture diagram centered on route groups rather than app modules.
4. Content clusters and SEO landing pages
- The repo contains a large /energia cluster with calculators, company pages, rates, and invoice-related pages.
- There is also a /gestiones cluster for administrative energy procedures like supply changes and power increases.
- These clusters look like SEO-driven landing pages: each page is likely self-contained, server-rendered, and optimized for search rather than built from a single dynamic data model.
5. Shared UI layer
- components/ui holds reusable interface building blocks: Navbar, Footer, LegalLayout, TestimonialsScroll, WhatsAppBubble, PhoneCTAClient, CookieBanner, and ContactForm.
- LegalLayout is the clearest boundary for repeated legal pages, indicating the legal pages share a common presentation pattern.
- Navbar and Footer are the core structural components that frame all routes through the root layout.
6. Client-side behavior
- Several components are clearly client-side interaction layers: CookieBanner, PhoneCTAClient, WhatsAppBubble, TestimonialsScroll, and likely ContactForm.
- These components handle session/UI concerns such as consent, CTA interactions, sticky messaging, scrolling testimonials, and user input.
- They sit on top of otherwise mostly static pages, so the site mixes server-rendered content with lightweight client widgets.
7. Configuration and site-wide state
- lib/config.json, lib/config-helper.js, and components/ui/ConfigContext.js form a configuration layer for site settings.
- This suggests some copy, contact details, or feature flags can be managed centrally and propagated to UI through context.
- The presence of admin config endpoints reinforces that site configuration is a first-class concern, not hardcoded everywhere.
8. Backend/API surface
- The app exposes route handlers in app/api/contact/route.js, app/api/chat/route.js, app/api/admin/auth/route.js, and app/api/admin/config/route.js.
- In architectural terms, Next.js route handlers are the backend boundary for the frontend.
- The contact/chat routes likely receive form or conversational payloads from the UI, while the admin routes handle protected configuration and authentication workflows.
9. Persistence and external service boundary
- The repo includes lib/supabase.js plus supabase/schema.sql, which makes Supabase the explicit backend datastore/service.
- That means the system boundary is: browser → Next.js UI/API → Supabase for authentication/configuration/data persistence where needed.
- The admin routes are the likeliest consumers of this backend layer, especially for auth and configuration management.
10. Administration area
- app/admin/page.js is a dedicated admin route, separate from the public marketing site.
- Together with the admin API routes, this forms a small private operational surface for managing site settings or access.
- In a diagram, this should be shown as a distinct branch from public content routes, even though it runs inside the same Next.js app.
11. SEO, metadata, and discovery
- app/sitemap.js, public/robots.txt, and public/llms.txt indicate the repo is intentionally optimized for search and machine-readable discovery.
- The README also notes per-page metadata, so each route likely owns its own title/description/OpenGraph metadata.
- This is important architecturally because content routes are designed as indexable landing pages, not just navigable screens.
12. Deployment/runtime context
- The README recommends Vercel, which fits the Next.js App Router model and route-handler API style.
- The app is therefore best thought of as a serverless-capable Next.js frontend with embedded API routes, rather than a separate frontend and backend deployment.
- Tailwind and Google Fonts are present, but they mainly affect presentation, not the core architecture.
Main entry points: layout.js App shell · energia/page.js Energía hub · alta-suministro-luz/page.js Gestiones hub · sitemap.js SEO discovery
Components 20
Public site
Marketing, informational, and legal routes exposed to visitors.
- Home · Primary public landing page.
app/page.js - Info pages · General informational pages such as about and service overview.
app/quienes-somos/page.js - Contact · Public contact route for user inquiries.
app/contacto/page.js - Legal pages · Shared legal and policy pages for compliance and trust.
app/aviso-legal/page.js
Energy content
SEO landing-page clusters for energy services and utilities.
- Energía hub · Entry point for the energy content cluster.
app/energia/page.js - Calculators · Consumption and power calculators presented as focused landing pages.
app/energia/calculadora-consumo-luz/page.js - Company pages · Utility-company specific SEO pages under the energy cluster.
app/energia/companias/endesa-luz/page.js - Rates & bill · Tariff and invoice interpretation pages.
app/energia/tarifas-luz-baratas/page.js - Gestiones hub · Administrative energy-procedure cluster for common service changes.
app/gestiones/alta-suministro-luz/page.js
Admin ops
Private admin surface and backend endpoints.
- Admin area · Dedicated private admin route for operational management.
app/admin/page.js - Admin API · Protected auth and configuration endpoints for the admin surface.
app/api/admin/auth/route.js - Public API · Contact and chat endpoints used by public-facing forms and assistants.
app/api/contact/route.js - Supabase · External datastore and service boundary for auth and configuration.
lib/supabase.js
Shared platform
Root shell, reusable UI, configuration, persistence, and discovery.
- App shell · Global route shell that frames all pages with shared navigation and footer.
app/layout.js - Global styles · App-wide styling and design tokens.
app/globals.css - Route fallbacks · Framework-level error, loading, and not-found boundaries.
app/error.js - UI chrome · Shared structural components for navigation, footer, and legal page layout.
components/ui/Navbar.js - UI widgets · Client-side interaction layers such as consent, CTAs, testimonials, and contact forms.
components/ui/CookieBanner.js - Config layer · Centralized configuration and context used across the UI.
components/ui/ConfigContext.js - SEO discovery · Sitemap and crawler-facing files for search and machine discovery.
app/sitemap.js
Connections 25
- App shell → UI chrome: frames · Root layout provides the shared shell around routes.
- App shell → Global styles: applies · Global layout loads site-wide styles.
- App shell → Route fallbacks: bounds · Next route boundaries handle errors, loading, and 404s.
- App shell → Home: serves · Root shell wraps the public homepage.
- App shell → Info pages: serves · Root shell wraps informational routes.
- App shell → Contact: serves · Root shell wraps the contact page.
- App shell → Legal pages: serves · Root shell wraps compliance pages.
- App shell → Energía hub: serves · Root shell wraps the energy content cluster.
- App shell → Gestiones hub: serves · Root shell wraps the procedures cluster.
- UI chrome → UI widgets: composes · Shared shell is augmented by lightweight interaction widgets.
- UI chrome → Config layer: reads · UI chrome and widgets consume centralized site configuration.
- Home → UI widgets: uses · Homepage can mount engagement widgets and CTAs.
- Contact → Public API: submits to · Contact forms send payloads to public API routes.
- Info pages → Legal pages: navigates · Informational pages link into compliance pages and vice versa.
- Energía hub → Calculators: branches to · Energy hub leads into calculator pages.
- Energía hub → Company pages: branches to · Energy hub leads into company-specific landing pages.
- Energía hub → Rates & bill: branches to · Energy hub leads into tariff and billing pages.
- Energía hub → Gestiones hub: cross-links · Energy content connects to common administrative procedures.
- Gestiones hub → UI widgets: uses · Procedure pages can use the same CTA and contact widgets.
- Admin area → Admin API: calls · Admin UI depends on protected auth and config endpoints.
- Admin API → Supabase: persists · Admin workflows read and write configuration through Supabase.
- Public API → Supabase: persists · Public-facing form and chat data can flow to the backend boundary.
- SEO discovery → Home: indexes · Discovery files point search engines at public routes.
- SEO discovery → Energía hub: indexes · Discovery files cover the SEO landing-page clusters.
- SEO discovery → Gestiones hub: indexes · Discovery files include procedure landing pages.