How plmanuel/ordernet works
Project type and purpose
• This is a full-stack web application built with Astro (a static-and-SSR site generator) plus React/TSX components and a set of built-in API routes under src/pages/api.
• Judging by the pages (login.astro, usuarios.astro, catalogo.astro, pedidos.astro) and API endpoints (category, product, table, user), it appears to be a restaurant or inventory/order management dashboard.
File structure
• Top-level config:
• astro.config.mjs, tsconfig.json, package.json, pnpm-workspace.yaml
• Public assets: public/imgs, CSS under src/styles/global.css
• Frontend:
• src/pages/ holds your route files (.astro pages)
• src/components/ contains React/TSX UI pieces (tables, modals, forms) and some Astro components (.astro) for layouts/navigation
• src/layouts/ defines the page shells (Layout.astro, LayoutDashboard.astro)
• Backend/API:
• src/pages/api/ implements RESTful routes for auth (login, logout, refresh-token) and CRUD on category, product, table, user
• src/lib/ houses cross-cutting utilities for auth cookies and authenticated fetches
• No explicit ORM or DB code is visible, but the API layer presumably calls a database or external service.
README
• We’ll augment with the actual structure above to reflect our real components and services.
Detailed breakdown of components/subsystems
• Frontend:
• Layouts (Layout.astro, LayoutDashboard.astro)
• Pages (index.astro, login.astro, usuarios.astro, etc.)
• Components (CatalogGrid, ProductCard, tables, modals, forms)
• Auth Library:
• setAuthCookies.ts, clearAuthCookies.ts
• fetchWithAuth.ts (wraps fetch with token, handles refresh)
• API Endpoints: group them by resource (Auth, Category, Product, Table, User)
• Data Store: tables/collections for users, products, categories, tables, orders