How mohamedsamara/astro-react-node works
This is an Astro server-rendered product catalog. The intended request flow is a browser request to a catalog page, product data retrieval through the API, and rendering as a product list or detail view. The sampled API code confirms that both endpoints read the local product JSON, and the API helper calls those endpoints. Page-to-component wiring is not shown in the sampled source, so those links are omitted; the README documents SSR but gives no further workflow detail.
Main entry points: api/products.ts API client · api/products.ts Products endpoint · [id].ts Product endpoint · server.mjs Node server
Components 15
Web experience
- Home page
src/pages/index.astro - Product listing
src/pages/products/index.astro - Product detail
src/pages/products/[id].astro - Default layout
src/layouts/Default.astro - Navigation
src/layouts/Navbar.astro - Product list
src/components/ProductList/index.tsx - Product details
src/components/ProductDetails/index.tsx
Catalog data
- API client
src/api/products.ts - Products endpoint
src/pages/api/products.ts - Product endpoint
src/pages/api/products/[id].ts - Product records
src/models/products.json - Product type
src/types/product.ts
SSR runtime
- Node server
server/server.mjs - Astro SSR handler
Other components
- Browser
Connections 6
- Browser → Node server: requests pages
- Node server → Astro SSR handler: dispatches SSR
- API client → Products endpoint: fetches list
- API client → Product endpoint: fetches item
- Products endpoint → Product records: reads records
- Product endpoint → Product records: finds item