How decseung/peach_market works
Purpose and Runtime
PeachMarket-React is a React single-page client for a social/community product with posts, profiles, chat, search, and account onboarding. The browser entry point is src/index.js, which mounts the root application in src/App.js; global styling is split across src/index.css and src/styles/global.js.
Application Composition and Navigation
src/App.js is the primary composition and routing boundary. Page-level features are organized by route/domain: home (src/pages/home/home.js), authentication (src/pages/login/login.js, src/pages/signup/signup.js), profile (src/pages/profile/profile.js), content authoring (src/pages/write/write.js), search (src/pages/search/searh.js), and chat (src/pages/chat/ChatLayout.js).
Responsive Shells and View Transitions
The UI has explicit desktop and mobile navigation structures. Desktop rendering is composed through src/components/desktop/DesktopLayout.js, src/components/desktop/DesktopLeftSidebar.js, and src/components/desktop/DesktopRightSidebar.js; mobile navigation is isolated in src/components/MobileNavbarWrapper.js. src/components/PageTransition.js and src/components/PeachLoader.js provide cross-page loading/transition presentation rather than feature-specific logic.
Authentication and User State
Authentication is a cross-cutting boundary centered on src/controllers/auth.js and client state in src/store/authStore.js. Firebase authentication integration is isolated under src/services/firebase/auth.js, with configuration in src/utils/firebase-config.js. Login, signup, and profile setup pages consume this identity flow through src/pages/login/login.js, src/pages/signup/signup.js, and src/pages/profile/setprofile.js.
API and Backend Boundary
Remote application operations are centralized in src/services/api.js and domain API modules: account (src/services/api/account.js), posts (src/services/api/post.js), comments (src/services/api/comment.js), chat (src/services/api/chat.js), and storage/bucket operations (src/services/api/bucket.js). This separation keeps page and component layers dependent on client service interfaces rather than direct transport details. src/utils/dio.js is a likely shared HTTP/client utility boundary.
Social Content and Profiles
The core social-content flow is: user identity → post retrieval/creation → preview/detail rendering → profile relationships. Home presentation begins at src/pages/home/home.js; reusable post views live in src/components/post/preview.js and src/components/post/postdetail.js. Profile screens and relationship lists are represented by src/pages/profile/profile.js, src/pages/profile/followers.js, and src/pages/profile/followings.js. Data model definitions are represented by src/models/user.js.
Realtime Chat
Chat has a separate layout and route decomposition: src/pages/chat/ChatLayout.js hosts list and room views in src/pages/chat/list.js and src/pages/chat/room.js. Reusable conversation rendering is in src/components/chat/chatroom-tile.js, while chat data/contracts are in src/models/chat.js and src/services/api/chat.js. src/services/ws.js is the websocket boundary, distinguishing realtime transport from request/response APIs.
Infrastructure and External Services
The client is built with the Node/npm ecosystem (package.json) and uses PostCSS/Tailwind configuration (postcss.config.js, tailwind.config.js). Static deployable assets and browser metadata reside under public/, including public/index.html, public/manifest.json, and public/robots.txt. Firebase is the explicitly evidenced external identity service; the API, bucket, and websocket modules indicate additional backend HTTP, object-storage, and realtime endpoints whose implementations are outside this repository.
Main entry points: App.js App Router · api.js API Client · ChatLayout.js Chat UI · auth.js Auth Controller
Components 20
UI & Routes
- Browser Entry
src/index.js - App Router
src/App.js - Responsive Shells · Desktop layouts and mobile navigation wrapper.
src/components/desktop/DesktopLayout.js - Transition UI
src/components/PageTransition.js - Home & Posts · Home route and reusable post preview/detail views.
src/pages/home/home.js - Post Authoring
src/pages/write/write.js - Profiles & Relationships · Profile, followers, and following routes.
src/pages/profile/profile.js - Search
src/pages/search/searh.js - Chat UI · Hosts conversation list and room views.
src/pages/chat/ChatLayout.js - Login & Signup
src/pages/login/login.js - Profile Setup
src/pages/profile/setprofile.js
Identity
- Auth Controller
src/controllers/auth.js - Auth Store
src/store/authStore.js - Firebase Auth
src/services/firebase/auth.js
Data & Realtime
- API Client · Central API and account, post, comment, chat, and bucket modules.
src/services/api.js - HTTP Utility
src/utils/dio.js - WebSocket Client
src/services/ws.js - User Model
src/models/user.js - Chat Model
src/models/chat.js - Backend Services · Remote API, object storage, and websocket endpoints are outside this repository.
Connections 25
- Browser Entry → App Router: mounts
- App Router → Responsive Shells: composes
- App Router → Transition UI: uses
- App Router → Home & Posts: routes to
- App Router → Post Authoring: routes to
- App Router → Profiles & Relationships: routes to
- App Router → Search: routes to
- App Router → Chat UI: routes to
- App Router → Login & Signup: routes to
- Login & Signup → Auth Controller: authenticates through
- Profile Setup → Auth Controller: uses identity
- Auth Controller → Auth Store: updates
- Auth Controller → Firebase Auth: delegates to
- Home & Posts → API Client: loads posts
- Post Authoring → API Client: creates posts
- Profiles & Relationships → API Client: loads accounts
- Profiles & Relationships → User Model: uses
- Search → API Client: queries
- Chat UI → API Client: loads conversations
- Chat UI → WebSocket Client: receives realtime events
- Chat UI → Chat Model: uses
- API Client → HTTP Utility: uses
- HTTP Utility → Backend Services: HTTP requests
- WebSocket Client → Backend Services: websocket connection
- Firebase Auth → Auth Store: identity state