How devopsdock0125/tws-e-commerce-app_hackathon works
EasyShop is a Next.js storefront backed by MongoDB. The main customer journey is discovering and filtering products, adding items to a cart, then placing and reviewing orders; authentication protects account and commerce operations. The graph also captures catalog administration, profiles, and presentation/state layers. Some pages and integrations are represented from the README and tree only; those links are marked unverified rather than inferred as confirmed calls.
Main entry points: orders Orders API · cart Cart API · shops Catalog pages · products Product API
Components 26
Storefront
- Catalog pages
src/app/shops - Product search
src/components/SearchBar.tsx - Catalog filters
src/components/filters - Product details
src/app/products/[slug]/page.tsx - Product cards
src/components/cards
Cart and orders
- Cart state
src/lib/features/cart/cartSlice.ts - Cart API
src/app/api/cart - Checkout
src/app/checkout/page.tsx - Orders API
src/app/api/orders - Order history
src/app/profile/orders
Identity and profiles
- Sign-in and signup
src/app/(auth) - Authentication API
src/app/api/auth - JWT authorization
src/lib/auth/utils.ts - User profile
src/app/profile
API and persistence
- Product API
src/app/api/products - API fetch helper
src/lib/fetchDataFromApi.ts - Database connection
src/lib/db.ts - Product model
src/lib/models/product.ts - Cart model
src/lib/models/cart.ts - Order model
src/lib/models/order.ts - User model
src/lib/models/user.ts
UI and state
- UI primitives
src/components/ui - Loading skeleton
src/components/loader/Skeleton.tsx - Redux store
src/lib/store.ts
Other components
- Shopper
- MongoDB
Connections 37
- Shopper → Catalog pages: browses
- Shopper → Product search: searches
- Product search → Catalog pages: routes to
src/components/SearchBar.tsx - Shopper → Catalog filters: filters
- Shopper → Product details: views
- Catalog pages → Product API: loads products
- Product details → Product API: loads product
- Catalog pages → Product cards: renders
- Shopper → Cart state: updates cart
- Cart state → Cart API: syncs cart
- Shopper → Checkout: checks out
- Checkout → Orders API: creates order
- Shopper → Order history: reviews orders
- Order history → Orders API: loads orders
- Shopper → Sign-in and signup: authenticates
- Sign-in and signup → Authentication API: submits credentials
- Authentication API → JWT authorization: uses JWT
src/app/api/auth/login/route.ts - Authentication API → User model: reads and writes
src/app/api/auth/login/route.ts - Shopper → User profile: manages account
- Product API → Database connection: connects through
src/app/api/products/route.ts - Product API → Product model: queries
src/app/api/products/route.ts - Cart API → JWT authorization: requires auth
src/app/api/cart/route.ts - Cart API → Database connection: connects through
src/app/api/cart/route.ts - Cart API → Cart model: reads and writes
src/app/api/cart/route.ts - Cart API → Product model: looks up products
src/app/api/cart/route.ts - Orders API → JWT authorization: requires auth
src/app/api/orders/route.ts - Orders API → Database connection: connects through
src/app/api/orders/route.ts - Orders API → Order model: reads and writes
src/app/api/orders/route.ts - Orders API → Cart model: clears cart
src/app/api/orders/route.ts - Orders API → Product model: looks up products
src/app/api/orders/route.ts - Database connection → MongoDB: connects
src/lib/db.ts - API fetch helper → Sign-in and signup: provides API access
- Redux store → Cart state: registers state
- Product search → UI primitives: uses controls
src/components/SearchBar.tsx - Catalog filters → UI primitives: uses controls
- Product cards → UI primitives: uses controls
- Loading skeleton → UI primitives: shares presentation layer