How dr3nulja/raamatupood works
RaamatuPood is a full-stack bookstore: shoppers discover books, manage a cart, check out with shipping and Stripe, then review orders and manage their profile; administrators manage catalog metadata and orders. The graph also includes the documented Auth0 sign-in/profile flow, reviews, localization, and API security. Source excerpts are selective, so some subsystem links rely on README statements; unsampled route internals are not inferred.
Main entry points: callback/route.ts Auth callback · page.tsx Catalog browsing · orders/route.ts Order API · AdminDashboardView.tsx Admin dashboard
Components 31
Book discovery
- Catalog browsing
app/catalog/page.tsx - Book details
components/BookDetailsClient.tsx - Book reviews
app/api/reviews/route.ts - Catalog API
app/api/books/route.ts - Catalog types
lib/api/catalogTypes.ts
Cart and checkout
- Cart state
stores/cartStore.ts - Cart API
app/api/cart/route.ts - Session cart
lib/cart/sessionCart.ts - Checkout page
app/checkout/page.tsx - Checkout action
app/actions/checkout.tsx - Checkout logic
lib/checkout/createCheckout.ts - Order API
app/api/orders/route.ts
Identity and accounts
- Auth routes
app/auth/login/route.ts - Auth callback
app/auth/callback/route.ts - Auth flow
lib/auth/flow.ts - Auth0 client
lib/auth0.ts - Profile management
app/api/profile/route.ts - Account and orders
components/account/ProfilePage.tsx
Store operations
- Admin dashboard
components/admin/AdminDashboardView.tsx - Book management
components/admin/AdminBooksView.tsx - Category and author management
components/admin/MetadataManager.tsx - Order management
components/admin/AdminOrdersView.tsx
Shared platform
- MySQL database
- API security
lib/security/api-guard.ts - Translations
hooks/useTranslation.ts - UI button
components/ui/Button.tsx - Prisma client
lib/prisma.ts
Other components
- Shopper
- Administrator
- Stripe payments
- Auth0 identity
Connections 43
- Shopper → Catalog browsing: browses
README.md - Catalog browsing → Catalog API: fetches books
app/catalog/page.tsx - Catalog browsing → Catalog types: uses types
app/catalog/page.tsx - Shopper → Book details: views book
README.md - Book details → Book reviews: reads and submits
components/BookDetailsClient.tsx - Shopper → Book reviews: rates books
README.md - Shopper → Cart state: manages cart
README.md - Cart state → Session cart: reads and writes
stores/cartStore.ts - Cart state → Cart API: syncs cart
- Shopper → Checkout page: checks out
README.md - Checkout page → Checkout action: submits checkout
app/checkout/page.tsx - Checkout action → Checkout logic: creates checkout
app/actions/checkout.tsx - Checkout logic → Stripe payments: processes payment
README.md - Shopper → Order API: views orders
README.md - Order API → MySQL database: reads and writes orders
app/api/orders/route.ts - Shopper → Auth routes: signs in
README.md - Auth routes → Auth0 client: configures login
app/auth/login/route.ts - Auth0 client → Auth0 identity: authenticates
README.md - Auth callback → Auth0 client: uses configuration
app/auth/callback/route.ts - Auth callback → Auth flow: checks profile state
app/auth/callback/route.ts - Auth callback → Session cart: parses cart
app/auth/callback/route.ts - Auth callback → MySQL database: merges user cart
README.md - Shopper → Account and orders: manages account
README.md - Account and orders → Profile management: updates profile
- Administrator → Admin dashboard: manages store
README.md - Admin dashboard → Book management: manages books
README.md - Admin dashboard → Category and author management: manages metadata
components/admin/MetadataManager.tsx - Admin dashboard → Order management: manages orders
README.md - Catalog API → MySQL database: reads catalog
app/api/books/route.ts - Book reviews → MySQL database: reads and writes reviews
app/api/reviews/route.ts - Cart API → MySQL database: reads and writes cart
app/api/cart/route.ts - Book management → MySQL database: manages inventory
README.md - Category and author management → MySQL database: manages metadata
- Order management → MySQL database: manages orders
- Catalog API → API security: wraps requests
app/api/books/route.ts - Cart API → API security: wraps requests
app/api/cart/route.ts - Book reviews → API security: wraps requests
app/api/reviews/route.ts - Order API → API security: wraps requests
app/api/orders/route.ts - Order API → Prisma client: uses client
app/api/orders/route.ts - Prisma client → MySQL database: accesses
README.md - Catalog browsing → Translations: localizes UI
app/catalog/page.tsx - Checkout page → UI button: renders controls
app/checkout/page.tsx - Category and author management → UI button: renders controls
components/admin/MetadataManager.tsx