How walidnoussir/samsar- works
Samsar connects renters and property owners through a React client and REST API. Renters browse/filter listings, inspect details, save favorites, and request or cancel reservations; owners publish and manage listings and review reservation requests. The API’s service layer applies domain rules and persists users, properties, favorites, and reservations. Image uploads are hosted by Cloudinary. Route and thunk wiring beyond sampled excerpts is represented only where the README or sampled code supports it; several backend routes and client feature modules were not inspected.
Main entry points: app.js Express API · api.js HTTP client · App.jsx Routes and layouts · propertyThunks.js Property state
Components 32
Client experience
- Routes and layouts
client/src/App.jsx - Browse listings
client/src/pages/Properties.jsx - Listing details
client/src/pages/PropertyDetails.jsx - Favorites
client/src/pages/Favorites.jsx - My reservations
client/src/pages/MyReservations.jsx - Owner workspace
client/src/pages/owner - Auth state
client/src/features/auth/authThunks.js - Property state
client/src/features/properties/propertyThunks.js - Favorite state
client/src/features/favorites/favoriteThunks.js - Reservation state
client/src/features/reservations/reservationThunks.js - HTTP client
client/src/services/api.js
API and services
- Express API
server/src/app.js - Auth routes
server/src/routes/auth.route.js - Property routes
server/src/routes/property.route.js - Favorite routes
server/src/routes/favorite.routes.js - Reservation routes
server/src/routes/reservation.route.js - Auth controller
server/src/controllers/auth.controller.js - Property controller
server/src/controllers/property.controller.js - Favorite controller
server/src/controllers/favorite.controller.js - Reservation controller
server/src/controllers/reservation.controller.js - Auth service
server/src/services/auth.service.js - Property service
server/src/services/property.service.js - Favorite service
server/src/services/favorite.service.js - Reservation service
server/src/services/reservation.service.js
Domain data
- Users
server/src/models/User.js - Properties
server/src/models/Property.js - Favorites
server/src/models/Favorite.js - Reservations
server/src/models/Reservation.js
External integrations
- MongoDB
- Cloudinary
Other components
- Renter
- Property owner
Connections 37
- Renter → Routes and layouts: uses
- Property owner → Routes and layouts: uses
- Routes and layouts → Auth state: restores session
- Routes and layouts → Favorite state: loads favorites
- Browse listings → Property state: requests listings
- Listing details → Property state: requests listing
- Favorites → Favorite state: manages favorites
- My reservations → Reservation state: manages requests
- Owner workspace → Property state: manages listings
- Owner workspace → Reservation state: reviews requests
- Auth state → HTTP client: sends requests
- Property state → HTTP client: sends requests
- Favorite state → HTTP client: sends requests
- Reservation state → HTTP client: sends requests
- HTTP client → Express API: HTTP requests
- Express API → Auth routes: mounts
- Express API → Property routes: mounts
- Express API → Favorite routes: mounts
- Express API → Reservation routes: mounts
- Favorite routes → Favorite controller: dispatches
- Auth routes → Auth controller: dispatches
- Property routes → Property controller: dispatches
- Reservation routes → Reservation controller: dispatches
- Auth controller → Auth service: calls
- Property controller → Property service: calls
- Property controller → Cloudinary: uploads images
- Favorite controller → Favorite service: calls
- Reservation controller → Reservation service: calls
- Auth service → Users: reads/writes
- Property service → Properties: reads/writes
- Favorite service → Favorites: reads/writes
- Reservation service → Reservations: reads/writes
- Reservation service → Properties: checks/updates
- Users → MongoDB: persists in
- Properties → MongoDB: persists in
- Favorites → MongoDB: persists in
- Reservations → MongoDB: persists in