How jkarelins/real-estate-site works
Project type and purpose
• This is a React-Redux single-page application (SPA) that serves as the client for a full-stack real-estate platform.
• Its purpose is to let different user roles (guests, private users, agents, managers) browse, search, post, and manage property adverts; schedule appointments; upload images; and make payments (Stripe) via an external API server.
File structure
• src/
• components/ – all UI pieces organized by feature (AddNewAdvert, AdvertCard, Header, Map, Payment, etc.)
• actions/ – Redux action creators (advert, appointment, user, payment, images, seo, etc.)
• reducers/ – Redux reducers matching those domains
• store.js – configures Redux store with Redux-Thunk middleware
• sitemap/ – server-side sitemap generator for SEO
• App.jsx, index.js – entry points
• serviceWorker.js, setupTests.js – PWA and testing support
• public/ – static host files (index.html, manifest.json, robots.txt, sitemap.xml)
• configuration at root (.babelrc, package.json, Docker, CI templates)
README for additional insights
• The client calls a separate Express-based API Server (runs on port 4000 by default) that persists to PostgreSQL (via Docker)
• External services: Cloudinary for image storage, Stripe for payments, Leaflet for maps.
• Deployed on Heroku as a static build and communicates with the API URL.
a. Main components
• Client-side SPA (React + Redux):
• UI Components
• Redux Store (Actions → Reducers → State)
• Thunks for async API calls
• API Server (Express + Node)
• Database (PostgreSQL)
• External services: Cloudinary, Stripe, Map Tile Server (for Leaflet)
• Deployment/Hosting: Heroku (Client & Server), Docker for local dev
b. Relationships and interactions
• User → Browser → SPA → dispatches Redux Action → Redux-Thunk → HTTP request to API Server
• API Server → reads/writes PostgreSQL → returns JSON
• Image uploads: Client → Cloudinary React widget → Cloudinary CDN
• Payments: Client → Stripe Checkout/API → Stripe backend
• Rendering: Client → Leaflet fetching tiles from Map provider
• SEO: sitemap generator runs on the server (or at build time) → publishes sitemap.xml to public/
c. Architectural patterns and design principles
• Flux pattern: unidirectional data flow (Components → Actions → Reducers → Store → Components)
• Separation of concerns: UI layer vs. state management vs. network layer
• Feature-based organization of components and Redux modules
• PWA/support for offline via service worker
d. Key technologies
• React, Redux, Redux-Thunk, React-Router (implied), Babel, Parcel/Webpack
• Express, PostgreSQL, Docker
• Cloudinary, Stripe, Leaflet
Essential details to capture
• How file structure maps to logical modules (e.g., src/actions ↔ API calls; src/reducers ↔ state slices; src/components ↔ UI screens).
• Clearly label user roles and which parts of the UI they interact with (e.g., Manager page vs. Agent vs. Public Search).
• External API URL configuration point in the client (highlight environment variable).