How keviniciodev/e-commerce works
This is a Next.js T-shirt storefront with a product catalog and an admin product-creation workflow. The catalog page requests products through a Server Action, which delegates retrieval to the product service and database. Admin users submit a form through a Server Action; the service validates and adapts product data before inserting it. The graph also shows the shared navigation and theme capability. Relationships are limited to calls and rendering/import references visible in excerpts, the source index, or README; unsampled features are not inferred.
Main entry points: ProductService.ts Product service · product-actions.ts Product actions · app/page.tsx Product catalog · new/page.tsx New product page
Components 14
Storefront UI
- Product catalog
app/page.tsx - New product page
app/admin/products/new/page.tsx - Navigation
src/shared/components/Navbar.tsx - Theme toggle
src/shared/components/ThemeToggle.tsx - Theme provider
src/shared/providers/theme-provider.tsx
Product Domain
- Product form
src/features/products/components/ProductForm.tsx - Product actions
src/features/products/actions/product-actions.ts - Product validation
src/features/products/schemas/productSchema.ts - Product service
src/features/products/services/ProductService.ts
Persistence
- Database client
src/db/index.ts - Products table
src/db/schema/products.ts
Other components
- Store visitor
- Admin user
- PostgreSQL
Connections 13
- Store visitor → Product catalog: views
app/page.tsx - Product catalog → Product actions: loads via
app/page.tsx - Admin user → New product page: opens
- New product page → Product form: renders
app/admin/products/new/page.tsx - Product form → Product actions: submits to
src/features/products/components/ProductForm.tsx - Product actions → Product service: calls
src/features/products/actions/product-actions.ts - Product service → Product validation: validates with
src/features/products/services/ProductService.ts - Product service → Database client: queries
src/features/products/services/ProductService.ts - Product service → Products table: reads and writes
src/features/products/services/ProductService.ts - Database client → PostgreSQL: connects to
src/db/index.ts - Store visitor → Navigation: uses
- Navigation → Theme toggle: renders
src/shared/components/Navbar.tsx - Theme provider → Theme toggle: provides theme