How sharvesh3ker/hotel-web-app works
StayFinder is a hotel discovery and host-listing CRUD application. Guests browse, search and filter listings, paginate results, and open hotel details; hosts can sign in and create, edit, or delete listings, including image uploads. The frontend fetches hotel data from the backend, which the README describes as using PostgreSQL and native SQL. The README also documents demo listings when the backend is unavailable. Backend internals were not excerpted, so database and authentication relationships below rely on README statements rather than inspected server implementation.
Main entry points: App.jsx Route application · server.js Hotel and session API · HotelList.jsx Hotel catalog · hotelsSlice.js Hotel state and API
Components 16
Hotel discovery
- Hotel catalog
frontend/src/pages/HotelList.jsx - Hotel cards
frontend/src/components/HotelCard.jsx - Pagination
frontend/src/components/Pagination.jsx - Hotel details
frontend/src/pages/HotelDetail.jsx - OpenStreetMap
Frontend experience
- Route application
frontend/src/App.jsx - Site navigation
frontend/src/components/Header.jsx - Auth context
frontend/src/auth/AuthContext.jsx - Listing editor
frontend/src/pages/HotelForm.jsx - Hotel state and API
frontend/src/store/hotelsSlice.js - Redux store
frontend/src/store/store.js
Listing services
- Hotel and session API
backend/src/server.js - Image uploads
backend/src/uploads
Persistence and media
- Hotel database
backend/schema.sql
Other components
- Guest
- Host
Connections 21
- Guest → Route application: browses
README.md - Host → Route application: manages listings
README.md - Route application → Site navigation: renders
frontend/src/App.jsx - Route application → Hotel catalog: routes to
frontend/src/App.jsx - Route application → Hotel details: routes to
frontend/src/App.jsx - Route application → Listing editor: routes to
frontend/src/App.jsx - Hotel catalog → Hotel state and API: dispatches fetch
frontend/src/pages/HotelList.jsx - Hotel catalog → Hotel cards: renders
frontend/src/pages/HotelList.jsx - Hotel catalog → Pagination: renders
frontend/src/pages/HotelList.jsx - Hotel details → Hotel state and API: loads hotel
frontend/src/pages/HotelDetail.jsx - Hotel details → OpenStreetMap: embeds map
frontend/src/pages/HotelDetail.jsx - Listing editor → Hotel state and API: uses API helpers
frontend/src/pages/HotelForm.jsx - Hotel cards → Hotel and session API: updates listing
frontend/src/components/HotelCard.jsx - Hotel catalog → Hotel and session API: deletes listing
frontend/src/pages/HotelList.jsx - Hotel state and API → Hotel and session API: fetches listings
frontend/src/store/hotelsSlice.js - Redux store → Hotel state and API: registers reducer
frontend/src/store/store.js - Route application → Auth context: wrapped by
frontend/src/main.jsx - Hotel and session API → Hotel database: CRUD via SQL
README.md - Hotel and session API → Image uploads: stores uploads
- Host → Hotel and session API: signs in
README.md - Guest → OpenStreetMap: views location