How shathing/shathing-frontend works
Shathing is a localized frontend for neighborhood item sharing. Its main flow is browsing and filtering share listings, opening a detail, and—when authenticated—creating or editing a post with region/category selection and image upload. Authentication and protected profile/chat areas extend that flow; chat loads history over REST and exchanges live messages over STOMP. Evidence is strongest for sampled listing, post, region, auth, and chat-hook code; other documented capabilities are represented at their supported route or directory paths.
Main entry points: page.tsx Post editor · share.ts Share API · config.ts HTTP client · ClientShareItemList.tsx Share listing
Components 26
App routing
- Locale proxy
src/proxy.ts - Locale routing
src/i18n/routing.ts - Home landing
src/app/[locale]/(with-layout)/page.tsx
Sharing workflow
- Share listing
src/app/[locale]/(with-layout)/share/ClientShareItemList.tsx - Share detail
src/app/[locale]/(with-layout)/share/[id]/page.tsx - Post editor
src/app/[locale]/(with-layout)/(protected)/post/page.tsx - Region selector
src/components/Region.tsx - Category selector
src/components/Category.tsx - Post selection state
src/stores/useShareItemPostStore.ts - Share API
src/apis/share.ts - Image upload API
src/apis/file.ts
Identity and access
- Authentication pages
src/app/[locale]/auth/AuthForm.tsx - Auth API
src/apis/auth.ts - Protected layout
src/app/[locale]/(with-layout)/(protected)/layout.tsx - Profile page
src/app/[locale]/(with-layout)/(protected)/me/page.tsx
Chat
- Chat interface
src/app/[locale]/(with-layout)/(protected)/chat/ChatPanel.tsx - Chat room list
src/app/[locale]/(with-layout)/(protected)/chat/ChatList.tsx - Room messages hook
src/hooks/chat/useChatRoomMessages.ts - Chat REST API
src/apis/chat.ts
Client platform
- App providers
src/providers/index.tsx - Query cache
src/providers/ReactQueryProvider.tsx - HTTP client
src/apis/config.ts
Other components
- Visitor
- R2 / CDN
- Spring backend
- STOMP service
Connections 30
- Visitor → Locale proxy: opens localized app
- Locale proxy → Locale routing: uses locale rules
src/proxy.ts - Visitor → Home landing: browses
- Home landing → Share listing: opens listings
- Share listing → Share API: fetches pages
src/app/[locale]/(with-layout)/share/ClientShareItemList.tsx - Share API → HTTP client: sends requests
src/apis/share.ts - HTTP client → Spring backend: calls REST
- Share listing → Share detail: opens item
- Share detail → Share API: loads item
src/app/[locale]/(with-layout)/share/[id]/page.tsx - Visitor → Post editor: creates or edits
- Post editor → Share API: loads and saves
src/app/[locale]/(with-layout)/(protected)/post/page.tsx - Post editor → Image upload API: requests upload
src/app/[locale]/(with-layout)/(protected)/post/page.tsx - Image upload API → R2 / CDN: uploads image
- Post editor → Region selector: renders selector
src/app/[locale]/(with-layout)/(protected)/post/page.tsx - Post editor → Category selector: renders selector
src/app/[locale]/(with-layout)/(protected)/post/page.tsx - Region selector → Post selection state: updates selection
src/components/Region.tsx - Category selector → Post selection state: updates selection
src/components/Category.tsx - Visitor → Authentication pages: authenticates
- Authentication pages → Auth API: submits credentials
- Auth API → HTTP client: sends requests
src/apis/auth.ts - Protected layout → Authentication pages: redirects unauthenticated
- Visitor → Profile page: views profile
- Visitor → Chat interface: opens chat
- Chat interface → Chat room list: shows rooms
- Chat interface → Room messages hook: loads room messages
- Room messages hook → Chat REST API: fetches history
src/hooks/chat/useChatRoomMessages.ts - Chat REST API → HTTP client: sends requests
- Room messages hook → STOMP service: subscribes and publishes
src/hooks/chat/useChatRoomMessages.ts - STOMP service → Spring backend: exchanges live messages
- App providers → Query cache: installs provider
src/providers/index.tsx