How avyoraj/store-rating-app works
Store Rating Application is a React client backed by an Express API and PostgreSQL. Users discover stores, view ratings and reviews, and can authenticate to submit reviews; store owners manage their stores, while administrators manage users and stores. The backend routes requests to domain controllers, which query the shared database. Authentication and validation protect relevant operations. The README documents these product capabilities, but several page and controller implementations were not sampled, so their internal calls are not inferred; dashed edges indicate the client-to-API relationship is not shown in the excerpts.
Main entry points: database.js Connection pool · server.js API server · App.jsx Routes and shell · reviews.js Review routes
Components 24
React application
- Routes and shell
frontend/src/App.jsx - Auth state
frontend/src/context/AuthContext.jsx - API client
frontend/src/services/api.js - Store discovery
frontend/src/pages/StoresPage.jsx - Store details
frontend/src/pages/StoreDetailPage.jsx - Review form
frontend/src/components/review-form.tsx - User dashboard
frontend/src/pages/DashboardPage.jsx - Owner dashboard
frontend/src/pages/StoreDashboard.jsx - Admin interface
frontend/src/pages/AdminDashboardClean.jsx
Express API
- API server
backend/server.js - Store routes
backend/routes/stores.js - Review routes
backend/routes/reviews.js - User routes
backend/routes/users.js - Admin routes
backend/routes/admin.js - Category routes
backend/routes/categories.js - Store operations
backend/controllers/storeController.js - Review operations
backend/controllers/reviewController.js - Admin operations
backend/controllers/adminController.js - Category operations
backend/controllers/categoryController.js
Identity and access
- Authentication
backend/controllers/authController.js - Token authorization
backend/middleware/auth.js
PostgreSQL data
- Connection pool
backend/config/database.js - PostgreSQL
Other components
- Visitor or user
Connections 25
- Visitor or user → Routes and shell: uses
README.md - Routes and shell → Store discovery: routes to
frontend/src/App.jsx - Routes and shell → Store details: routes to
frontend/src/App.jsx - Routes and shell → Auth state: provides
frontend/src/App.jsx - Store details → Review form: offers reviews
- Auth state → API client: requests auth
frontend/src/context/AuthContext.jsx - Visitor or user → API client: uses API
- API server → Store routes: mounts
backend/server.js - API server → Review routes: mounts
backend/server.js - API server → User routes: mounts
backend/server.js - API server → Admin routes: mounts
backend/server.js - API server → Category routes: mounts
backend/server.js - Store routes → Store operations: dispatches
backend/routes/stores.js - Review routes → Review operations: dispatches
backend/routes/reviews.js - User routes → Authentication: dispatches
backend/routes/users.js - Admin routes → Admin operations: dispatches
backend/routes/admin.js - Category routes → Category operations: dispatches
backend/routes/categories.js - Review routes → Token authorization: authenticates
backend/routes/reviews.js - Store operations → Connection pool: queries
backend/controllers/storeController.js - Review operations → Connection pool: queries
backend/controllers/reviewController.js - Authentication → Connection pool: queries
backend/controllers/authController.js - Admin operations → Connection pool: queries
backend/controllers/adminController.js - Category operations → Connection pool: queries
backend/controllers/categoryController.js - Token authorization → Connection pool: checks users
backend/middleware/auth.js - Connection pool → PostgreSQL: connects
backend/config/database.js