This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
All source code lives under UMC-10th-mission-FE/. Run all commands from that directory.
# Install dependencies (pnpm)
pnpm install
# Start dev server
pnpm dev
# Type-check and build
pnpm build
# Lint
pnpm lintNo test suite is configured. Use pnpm build to catch type errors.
Create UMC-10th-mission-FE/.env.local with:
VITE_API_BASE_URL=http://localhost:8080
Stack: React 19 + TypeScript + Vite, TailwindCSS v4, TanStack Query v5, React Router v7, Axios, Zod + React Hook Form, Styled Components.
Entry point: src/main.tsx β src/App.tsx
React Router v7 with a nested layout structure:
AppRoot (QueryClientProvider + AuthProvider)
βββ HomeLayout (nav + sidebar + floating button)
βββ / (HomePage)
βββ /login, /signup, /v1/auth/google/callback
βββ /lps (LPListPage)
βββ /lps/:lpid (LPDetailPage)
βββ PrivateLayout (redirects to /login if no accessToken)
βββ /mypage
βββ /write
AuthContext(src/context/AuthContext.tsx) holdsaccessTokenin React state, initialized fromlocalStorage.- Tokens stored under keys in
src/constants/key.ts(accessToken,refreshToken). src/apis/axios.tsβ singleaxiosInstancewith two interceptors: attaches Bearer token on every request, auto-refreshes on 401 (deduped with a sharedrefreshPromise), clears storage and redirects to/loginon refresh failure.PrivateLayoutreadsaccessTokenfrom context and redirects unauthenticated users.
axios.tsβ configuredaxiosInstance(base URL fromVITE_API_BASE_URL)auth.tsβ sign-in, sign-up, logout, Google OAuth, my-info endpointslp.tsβ LP list (cursor-based), LP detail, LP comments
All hooks wrap TanStack Query:
useGetLpListβuseInfiniteQuerywith cursor pagination;queryKey: ["lps", sort]useGetLPDetailβuseQueryfor a single LPuseGetLpCommentsβ comments for an LPuseGetMyInfoβ acceptsaccessToken | null; skips the query when null
LPListPage combines useInfiniteQuery + react-intersection-observer: a sentinel <div ref={ref}> at the bottom triggers fetchNextPage() via useEffect when inView && hasNextPage && !isFetchingNextPage. Initial load shows a grid of <LpCardSkeleton> components; subsequent pages append more skeletons below the list while fetching.
CommonRes<T>β wrapper{ status, message, data: T }for all API responseslp.tsβLp,GetLpsResponseauth.tsβ auth DTOs
Tailwind v4 utility classes throughout. Color palette: #0f1014 backgrounds, #FF1493 accent/primary, #1a1a1a / #333 surfaces. LpCardSkeleton uses animate-pulse for loading states.