How thematrix2/bookstore-info-system works
This is a bookstore information system with a React storefront and employee admin panel backed by a Go HTTP API. Shoppers browse books and catalog metadata, authenticate, manage a cart, and place and track orders; employees manage catalog records, users, and order, payment, and delivery statuses. The frontend routes requests through a shared API client; the backend routes them through handlers, services, and repositories to the database. The route and wiring map is visible in the application entry point; several feature implementations are unsampled, so their internal calls are not expanded.
Main entry points: client/pages Storefront · admin/pages Admin panel · App.tsx Route selection · services Domain services
Components 14
Web applications
- Storefront
frontend/src/apps/client/pages - Admin panel
frontend/src/apps/admin/pages - Route selection
frontend/src/App.tsx
Frontend core
- Auth state
frontend/src/shared/authStore.tsx - API client
frontend/src/shared/api.tsx - API mappers
frontend/src/mappers
HTTP API
- HTTP handlers
backend/handlers - Auth middleware
backend/middleware
Backend domain
- Domain services
backend/internal/services - Token service
backend/internal/services/jwt.go
Persistence
- Repositories
backend/repository - Database connection
backend/internal/db/db.go
Other components
- Shopper or employee
- PostgreSQL
Connections 17
- Shopper or employee → Route selection: uses
- Route selection → Storefront: routes to
frontend/src/App.tsx - Route selection → Admin panel: routes to
frontend/src/App.tsx - Route selection → Auth state: checks roles
frontend/src/App.tsx - Storefront → API client: fetches data
frontend/src/apps/client/pages/CartPage.tsx - Admin panel → API client: fetches data
frontend/src/apps/admin/pages/AuthorsAdminPage.tsx - Storefront → Auth state: uses
frontend/src/apps/client/pages/CartPage.tsx - Admin panel → Auth state: uses
frontend/src/apps/admin/pages/AuthorsAdminPage.tsx - Storefront → API mappers: maps responses
frontend/src/apps/client/pages/OrdersPage.tsx - Admin panel → API mappers: maps responses
frontend/src/apps/admin/pages/AuthorsAdminPage.tsx - API client → HTTP handlers: sends requests
frontend/src/shared/api.tsx - HTTP handlers → Domain services: calls
backend/handlers/author.go - Auth middleware → Token service: validates tokens
backend/middleware/auth.go - Domain services → Repositories: delegates data access
backend/cmd/app/main.go - Domain services → Token service: issues tokens
backend/internal/services/auth.go - Repositories → Database connection: uses connection
- Database connection → PostgreSQL: connects
README.md