How kea-chunsam/playus-fe works
Main Components
a. Browser / Client
• React application (static HTML/CSS/JS served to the browser)
• React Router (AppRouter.js)
• Context providers (AuthContext, SearchContext)
• UI modules:
• Pages (src/pages/**)
• Reusable Components (src/components/**)
• Utilities (src/utils/**)
• Build tool & config: package.json, tailwind.config.js, postcss.config.js
• Testing: jest.config.js, __mocks__, src/App.test.js, src/setupTests.js
b. CI/CD Pipeline
• GitHub Actions workflows (.github/workflows/*.yml)
• Automated test → build → deploy to GitHub Pages (or S3/Netlify, per deploy.yml)
c. External Services
• OAuth Providers: Kakao Login, Naver Login
• Backend API(s):
• PlayUs-user-service (Spring Boot + Redis)
• Other microservices (party-service, diary-service, community-service, etc.)
• Docker + Redis for session/cache (local/dev environment)
Relationships & Data Flows
a. Client Startup Flow
1. User hits index.html (public/index.html) served from CDN/static host
2. React bundle loads (src/index.js → AppRouter)
3. React Router dispatches to Page components → loads data via utility API calls
b. Auth Flow
1. User clicks “Login” (LoginHeader component)
2. Front-end redirects to Kakao/Naver OAuth endpoints
3. OAuth responses returned to front-end redirect URI
4. Front-end exchanges code for JWT via PlayUs-user-service
5. AuthContext stores token, subsequent API calls include Authorization header
c. Data Fetching Flow
• Page components & child components call backend REST endpoints (e.g., GET /matches, POST /diary)
• Responses rendered in components (GameCard, RecordsAccordion, etc.)
d. Real-Time Chat (optional)
• Chatting page may open WebSocket connection to chat server (if implemented)
Architectural Patterns
• Single-Page Application
• Component-Based UI (atoms, molecules, organisms)
• Declarative Routing (React Router)
• Context API for global state
• CSS Modules & Tailwind for scoped styling
• CI/CD via GitHub Actions