How skillblogwebdev/rostelecom-shop works
This is a Next.js storefront: shoppers browse and search goods, manage cart/favorites/comparisons, authenticate, and proceed through delivery and payment. The architecture separates page/template presentation, Effector client state and effects, HTTP route handlers, and MongoDB-backed utilities. Sampled context effects show several client-to-route calls; the index confirms selected route-to-database dependencies. Many page and route implementations were not sampled, so their internal wiring is intentionally not inferred.
Main entry points: apiInstance.ts HTTP client · api-routes.ts Route utilities · index.ts MongoDB · ProductsPage.tsx Catalog pages
Components 23
Storefront UI
- Catalog pages
components/templates/ProductsPage/ProductsPage.tsx - Product pages
components/templates/ProductPage/ProductPage.tsx - Home page
components/templates/MainPage/MainPage.tsx - Cart and order
components/templates/CartPage/CartPage.tsx - Profile pages
components/templates/ProfilePage/ProfilePage.tsx - Saved lists
components/templates/FavoritesPage/FavoritesPage.tsx
Client state
- Goods state
context/goods/index.ts - Authentication
context/auth/index.ts - User state
context/user/index.ts - Cart state
context/cart/index.ts - Comparison state
context/comparison/index.ts - Favorites state
context/favorites/index.ts - Order state
context/order/index.ts - Profile state
context/profile/index.ts - HTTP client
api/apiInstance.ts
API services
- Goods routes
app/api/goods/filter/route.ts - Cart routes
app/api/cart/add/route.ts - Favorites routes
app/api/favorites/add/route.ts - Payment routes
app/api/payment/route.ts - User routes
app/api/users/refresh/route.ts - Route utilities
lib/utils/api-routes.ts
Persistence
- MongoDB
lib/mongodb/index.ts
Other components
- Shopper
Connections 26
- Shopper → Catalog pages: browses
- Shopper → Cart and order: manages cart
- Shopper → Profile pages: manages account
- Catalog pages → Goods state: loads products
components/templates/ProductsPage/ProductsPage.tsx - Catalog pages → Product pages: opens product
- Goods state → HTTP client: requests goods
context/goods/index.ts - Authentication → HTTP client: sends auth requests
context/auth/index.ts - Cart state → HTTP client: sends cart requests
context/cart/index.ts - Comparison state → HTTP client: sends list requests
context/comparison/index.ts - Favorites state → HTTP client: sends list requests
context/favorites/index.ts - Order state → HTTP client: sends payment requests
context/order/index.ts - Profile state → HTTP client: sends profile requests
context/profile/index.ts - User state → HTTP client: checks login
context/user/index.ts - HTTP client → Goods routes: requests goods
- HTTP client → User routes: requests user service
- HTTP client → Payment routes: creates payment
- Goods routes → MongoDB: queries goods
app/api/goods/filter/route.ts - Cart routes → MongoDB: uses database
app/api/cart/add/route.ts - Favorites routes → MongoDB: uses database
app/api/favorites/add/route.ts - Payment routes → MongoDB: uses database
app/api/payment/route.ts - User routes → MongoDB: uses database
app/api/users/refresh/route.ts - Goods routes → Route utilities: uses helpers
app/api/goods/filter/route.ts - Cart routes → Route utilities: uses helpers
app/api/cart/add/route.ts - Favorites routes → Route utilities: uses helpers
app/api/favorites/add/route.ts - Payment routes → Route utilities: uses helpers
app/api/payment/route.ts - User routes → Route utilities: uses helpers
app/api/users/refresh/route.ts