How alsiyabi17/smartfinder works
SmartFinder is a MERN restaurant discovery and reservation application. Users browse and filter restaurants, inspect details, save favorites, and can register, log in, manage profiles, and make reservations; admins manage restaurants and meals. The React app routes users to these experiences, Redux slices manage client state and API requests, and Express routes implement backend operations against MongoDB models. The README documents reservation and profile capabilities, but their complete client-side request flows are not shown in the sampled source.
Main entry points: App.jsx Route shell · restaurantSlice.js Restaurant state · server.js API server · authSlice.js Authentication state
Components 25
React application
- Route shell
Client/SmartFinder/src/App.jsx - Browse restaurants
Client/SmartFinder/src/pages/Restaurants.jsx - Home discovery
Client/SmartFinder/src/pages/Home.jsx - Restaurant details
Client/SmartFinder/src/pages/RestaurantDetails.jsx - Favorites
Client/SmartFinder/src/pages/Favorites.jsx - Register and login
Client/SmartFinder/src/pages/Register.jsx - Profile management
Client/SmartFinder/src/pages/Profile.jsx - Admin dashboard
Client/SmartFinder/src/pages/AdminDashboard.jsx
Client state and API
- Redux store
Client/SmartFinder/src/store.js - Restaurant state
Client/SmartFinder/src/features/restaurantSlice.js - Authentication state
Client/SmartFinder/src/features/authSlice.js - User state
Client/SmartFinder/src/features/userSlice.js - Axios API client
Client/SmartFinder/src/services/api.js
Express services
- API server
Server/server.js - Authentication routes
Server/routes/authRoutes.js - Restaurant and meal routes
Server/routes/restaurantRoutes.js - User routes
Server/routes/userRoutes.js - Reservation routes
Server/routes/reservationRoutes.js - JWT protection
Server/middleware/authMiddleware.js
MongoDB data
- User model
Server/models/User.js - Restaurant model
Server/models/Restaurant.js - Reservation model
Server/models/Reservation.js - Database connection
Server/config/db.js
Other components
- User or admin
- MongoDB
Connections 35
- User or admin → Route shell: uses
Client/SmartFinder/src/App.jsx - Route shell → Home discovery: routes to
Client/SmartFinder/src/App.jsx - Route shell → Browse restaurants: routes to
Client/SmartFinder/src/App.jsx - Route shell → Restaurant details: routes to
Client/SmartFinder/src/App.jsx - Route shell → Favorites: routes to
Client/SmartFinder/src/App.jsx - Route shell → Register and login: routes to
Client/SmartFinder/src/App.jsx - Route shell → Profile management: routes to
Client/SmartFinder/src/App.jsx - Route shell → Admin dashboard: routes to
Client/SmartFinder/src/App.jsx - Redux store → Restaurant state: registers
Client/SmartFinder/src/store.js - Redux store → Authentication state: registers
Client/SmartFinder/src/store.js - Redux store → User state: registers
Client/SmartFinder/src/store.js - Browse restaurants → Restaurant state: dispatches
Client/SmartFinder/src/pages/Restaurants.jsx - Home discovery → Restaurant state: dispatches
Client/SmartFinder/src/pages/Home.jsx - Restaurant details → Restaurant state: dispatches
Client/SmartFinder/src/pages/RestaurantDetails.jsx - Favorites → Restaurant state: dispatches
Client/SmartFinder/src/pages/Favorites.jsx - Admin dashboard → Restaurant state: dispatches
Client/SmartFinder/src/pages/AdminDashboard.jsx - Register and login → Authentication state: dispatches
Client/SmartFinder/src/pages/Register.jsx - Profile management → User state: dispatches
Client/SmartFinder/src/pages/Profile.jsx - Profile management → Authentication state: dispatches
Client/SmartFinder/src/pages/Profile.jsx - Restaurant state → Axios API client: requests
Client/SmartFinder/src/features/restaurantSlice.js - Authentication state → Axios API client: requests
Client/SmartFinder/src/features/authSlice.js - User state → Axios API client: requests
Client/SmartFinder/src/features/userSlice.js - Axios API client → API server: HTTP requests
README.md - API server → Authentication routes: mounts
Server/server.js - API server → Restaurant and meal routes: mounts
Server/server.js - API server → User routes: mounts
Server/server.js - API server → Reservation routes: mounts
Server/server.js - Authentication routes → User model: reads and creates
Server/routes/authRoutes.js - Restaurant and meal routes → Restaurant model: queries and saves
Server/routes/restaurantRoutes.js - User routes → JWT protection: protects routes
Server/routes/userRoutes.js - User routes → User model: reads and updates
Server/routes/userRoutes.js - JWT protection → User model: loads user
Server/middleware/authMiddleware.js - Reservation routes → Restaurant model: checks restaurant
Server/routes/reservationRoutes.js - Reservation routes → Reservation model: creates and reads
Server/routes/reservationRoutes.js - Database connection → MongoDB: connects