How tux3er-isma/restaurantestarragona works
Purpose and Runtime
This is an Astro site for restaurant discovery, restaurant detail/reviews, user and restaurant dashboards, administration, and blog content. Astro file-based routes are the primary entry points; .astro server-rendered pages compose Astro and React JSX visual effects. Configuration is rooted in astro.config.mjs, auth.config.mjs, and src/env.d.ts.
Public Discovery Experience
The landing route builds a marketing/discovery experience with map, featured restaurants, opinion highlights, carousel, leaderboard, and footer. Its composition boundary is src/pages/index.astro, src/components/MainPage/Main/Main.astro, and src/components/MainPage/Header/Header-MP.astro. Static videos, fonts, map data, and restaurant imagery are served from public/assets/MainPage, public/Map/map.json, and public/assets/Gallery.
Restaurant Catalog, Search, and Detail Flow
Catalog-like data is exposed as JSON and consumed by dynamic restaurant and search routes. A visitor proceeds from search results to a restaurant-specific page, then sees gallery, details, aggregate opinion statistics, and reviews. Key paths: src/pages/search/[result].astro, src/pages/restaurant/[restaurant].astro, and src/components/Restaurant/Main/Main.astro. Static catalog endpoints are src/pages/restaurant/restaurants.json and src/pages/restaurant/bestRestaurant.json; image resolution is centralized in src/lib/restaurant-images.ts.
Identity and Account Boundaries
Separate auth pages support registration, login, password recovery/reset, code verification, Google login, and restaurant login/registration. UI is organized under src/pages/auth/login.astro, src/layouts/AuthLayout.astro, and src/components/Auth/BasicAuth.astro; state-changing actions cross into API routes such as src/pages/api/login.json.ts, src/pages/api/googleLogin.json.ts, and src/pages/api/validate-session.json.ts. src/lib/supabase.ts indicates Supabase is the persistence/auth integration boundary, while src/lib/email.ts supports email-based account workflows.
Dashboards and Role-Specific Workflows
Authenticated users and restaurant operators have distinct dashboard shells and sidebars, allowing profile/data/review management without sharing public-page composition. Core paths are src/pages/dashboard.astro, src/layouts/DashboardLayout.astro, and src/layouts/DashboardLayoutRestaurant.astro. Dashboard components divide general-user and restaurant-specific views under src/components/Dashboard/User and src/components/Dashboard/Sections.
Administration and Moderation
Admin routes provide user, restaurant, review, ranking, and blog-post operations. Administrative screens are rooted at src/pages/admin/welcomePage.astro, src/pages/admin/manage-restaurants.astro, and src/pages/admin/manage-reviews.astro; mutations are isolated behind endpoints in src/pages/api/admin/manage-restaurant-action.json.ts, src/pages/api/admin/manage-review-action.json.ts, and src/pages/api/admin/user-level-adjustment.json.ts. This is the main privileged control boundary.
Content, Media, and External Processing
Blog list/detail routes and CRUD endpoints form a separate editorial subsystem: src/pages/blog/index.astro, src/pages/blog/[stamp].astro, and src/lib/blog.ts. Reviews can pass through an AI revision endpoint at src/pages/api/AIReviewRevision.json.ts. User/profile and restaurant media upload/access flows use src/pages/api/uploadProfilePic.json.ts, src/pages/api/deleteProfilePic.json.ts, and src/pages/api/restaurant-image.ts; bundled gallery assets provide a fallback/static content layer.
Main entry points: supabase.ts Supabase · login.json.ts Session & login API · dashboard.astro User dashboard · DashboardLayoutRestaurant.astro Restaurant dashboard
Components 20
Public experience
- Landing discovery · Marketing, map, featured restaurant, and leaderboard composition.
src/pages/index.astro - Landing main
src/components/MainPage/Main/Main.astro - Landing header
src/components/MainPage/Header/Header-MP.astro - Maps & gallery assets · Videos, fonts, map data, and restaurant imagery.
public/assets/MainPage - Restaurant search
src/pages/search/[result].astro - Restaurant detail · Gallery, details, opinion statistics, and reviews.
src/pages/restaurant/[restaurant].astro - Restaurant view
src/components/Restaurant/Main/Main.astro - Restaurant catalog
src/pages/restaurant/restaurants.json - Restaurant images
src/lib/restaurant-images.ts
Identity & accounts
- Authentication UI · Registration, login, recovery, verification, and restaurant access.
src/pages/auth/login.astro - Session & login API · State-changing account and session operations.
src/pages/api/login.json.ts - Supabase · External authentication and persistence boundary.
src/lib/supabase.ts - Email workflows
src/lib/email.ts
Role dashboards
- User dashboard · Authenticated profile, data, and review management.
src/pages/dashboard.astro - Restaurant dashboard · Operator-specific management shell.
src/layouts/DashboardLayoutRestaurant.astro
Administration
- Admin screens · Privileged user, restaurant, review, ranking, and blog operations.
src/pages/admin/manage-restaurants.astro - Admin mutation API · Privileged restaurant, review, and user-level mutations.
src/pages/api/admin/manage-restaurant-action.json.ts
Content & media
- Blog subsystem · Editorial list, detail, and CRUD flow.
src/pages/blog/index.astro - AI review revision
src/pages/api/AIReviewRevision.json.ts - Profile media API · User and restaurant media upload, deletion, and access.
src/pages/api/uploadProfilePic.json.ts
Connections 23
- Landing discovery → Landing header: composes
- Landing discovery → Landing main: composes
- Landing main → Maps & gallery assets: loads
- Restaurant search → Restaurant catalog: queries
- Restaurant search → Restaurant detail: navigates to
- Restaurant detail → Restaurant view: composes
- Restaurant detail → Restaurant catalog: reads
- Restaurant view → Restaurant images: resolves images
- Restaurant images → Maps & gallery assets: uses gallery
- Authentication UI → Session & login API: submits to
- Session & login API → Supabase: authenticates
- Session & login API → Email workflows: triggers recovery mail
- User dashboard → Session & login API: validates session
- Restaurant dashboard → Session & login API: validates session
- User dashboard → Supabase: manages account data
- Restaurant dashboard → Supabase: manages restaurant data
- Admin screens → Admin mutation API: mutates
- Admin mutation API → Supabase: updates privileged data
- Blog subsystem → Supabase: persists posts
- AI review revision → Supabase: reads review context
- User dashboard → Profile media API: uploads media
- Restaurant dashboard → Profile media API: uploads media
- Profile media API → Supabase: stores media references