How steinovehelset/djangobnb works
Djangobnb is a Next.js frontend for a Django-backed short-term rental marketplace. Visitors browse and filter properties, view landlord and property details, and can sign in to favorite listings, manage reservations or properties, and contact hosts through inbox conversations. The frontend centralizes authenticated API access and cookie-based session handling. The README also documents image uploads and live chat; the chat UI is present, but the sampled source does not establish its websocket wiring. Edges reflect excerpted code, SOURCE INDEX references, or README statements.
Main entry points: apiService.ts API client · PropertyList.tsx Property list · LoginModal.tsx Login and signup · actions.ts Session actions
Components 28
Property discovery
- Home page
app/page.tsx - Categories
app/components/Categories.tsx - Search modal
app/components/modals/SearchModal.tsx - Search state
app/hooks/useSearchModal.ts - Property list
app/components/properties/PropertyList.tsx - Property card
app/components/properties/PropertyListItem.tsx
Accounts and hosting
- Landlord detail
app/landlords/[id]/page.tsx - Favorites page
app/myfavorites/page.tsx - Favorite action
app/components/FavoriteButton.tsx - Property management
app/components/modals/AddPropertyModal.tsx - Listing categories
app/components/addproperty/Categories.tsx - My properties
app/myproperties/page.tsx - Login and signup
app/components/modals/LoginModal.tsx - Auth modal state
app/hooks/useLoginModal.ts
Reservations and messaging
- Property detail
app/properties/[id]/page.tsx - Reservation sidebar
app/components/properties/ReservationSidebar.tsx - My reservations
app/myreservations/page.tsx - Inbox
app/inbox/page.tsx - Conversation detail
app/components/inbox/ConversationDetail.tsx - Conversation page
app/inbox/[id]/page.tsx - Contact host
app/components/ContactButton.tsx
Frontend services
- Session actions
app/lib/actions.ts - API client
app/services/apiService.ts - Django REST API
- Chat websocket
- App layout
app/layout.tsx - Navigation
app/components/navbar/Navbar.tsx
Other components
- Visitor
Connections 36
- Visitor → Home page: opens
app/page.tsx - Home page → Categories: renders
app/page.tsx - Home page → Property list: renders
app/page.tsx - Categories → Search state: sets category
app/components/Categories.tsx - Search modal → Search state: sets query
app/components/modals/SearchModal.tsx - Property list → Search state: reads filters
app/components/properties/PropertyList.tsx - Property list → API client: fetches listings
app/components/properties/PropertyList.tsx - Property list → Property card: renders cards
app/components/properties/PropertyList.tsx - Property card → Favorite action: renders action
app/components/properties/PropertyListItem.tsx - Favorite action → API client: updates favorite
app/components/FavoriteButton.tsx - Property detail → API client: loads listing
app/properties/[id]/page.tsx - Property detail → Reservation sidebar: renders booking
app/properties/[id]/page.tsx - Reservation sidebar → API client: submits reservation
app/components/properties/ReservationSidebar.tsx - Landlord detail → API client: loads host
app/landlords/[id]/page.tsx - Landlord detail → Property list: lists host properties
app/landlords/[id]/page.tsx - Landlord detail → Contact host: offers contact
app/landlords/[id]/page.tsx - Favorites page → Property list: shows favorites
app/myfavorites/page.tsx - My properties → Property list: shows listings
app/myproperties/page.tsx - Property management → API client: creates listing
app/components/modals/AddPropertyModal.tsx - Property management → Listing categories: uses categories
app/components/modals/AddPropertyModal.tsx - Login and signup → Auth modal state: uses modal state
app/components/modals/LoginModal.tsx - Login and signup → API client: submits credentials
app/components/modals/LoginModal.tsx - Login and signup → Session actions: sets session
app/components/modals/LoginModal.tsx - My reservations → API client: loads reservations
app/myreservations/page.tsx - Inbox → API client: loads conversations
app/inbox/page.tsx - Inbox → Session actions: checks user
app/inbox/page.tsx - Conversation page → API client: loads conversation
app/inbox/[id]/page.tsx - Conversation page → Conversation detail: renders messages
app/inbox/[id]/page.tsx - Conversation detail → Chat websocket: live messaging
README.md - Contact host → API client: starts contact
app/components/ContactButton.tsx - API client → Session actions: gets access token
app/services/apiService.ts - API client → Django REST API: sends HTTP requests
app/services/apiService.ts - Session actions → Django REST API: refreshes token
app/lib/actions.ts - App layout → Navigation: renders navigation
app/layout.tsx - App layout → Search modal: renders modal
app/layout.tsx - App layout → Login and signup: renders auth
app/layout.tsx