Skip to content
프로젝트

yurisldk/realworld-react-fsd

GitHub에서 보기

소개

Feature-Sliced Design으로 구축한 실전형 React 애플리케이션입니다. 모듈형 모놀리스에서 마이크로 프런트엔드에 대응할 수 있는 아키텍처로 발전하고 있습니다.

웹 및 앱 개발

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

🙌 RealWorld example app 🍰 Feature-Sliced Design

A modern implementation of the RealWorld app built with React, TypeScript, React Router, React Query, and Zod.

Realworld example app

About the Project

This project is an educational and demonstration Medium-clone built with the Feature-Sliced Design (FSD) architectural approach and modern frontend tools. It is suitable for learning, experimentation, and as a template for large-scale applications.

Preview

Tech Stack

  • React 19
  • TypeScript
  • React Router 7
  • TanStack React Query 5
  • Zod 4
  • Webpack 5
  • Jest
  • Testing Library
  • MSW
  • ESLint
  • Prettier
  • Sass
  • Orval

Project Structure

  • src/app — application shell, root router, layout, providers, root error handling
  • src/pages — page-scoped route modules and page UI
  • src/shared — reusable API layer, utilities, router helpers, and shared UI

Architecture Notes

The codebase uses a page-scoped structure rather than a full multi-layer FSD tree.

  • The root router is defined in src/app/browser-router.tsx.
  • Pages expose route objects from src/pages/*/*.route.ts.
  • Route modules are lazy-loaded to keep the initial bundle smaller.
  • Data fetching is handled in route loaders with React Query.
  • Mutations are handled in route actions and usually validate formData with Zod before calling the API.
  • Shared routing helpers, API utilities, and common UI live in src/shared.

Runtime Patterns

  • Lazy route modules: page components, loaders, and actions are loaded on demand.
  • Route loaders: async page data is prepared through React Router loaders backed by React Query.
  • Route actions: form submissions and mutations are handled declaratively through React Router actions.
  • Auth middleware: route middleware restores the current user and protects auth-only flows.
  • Validation before API calls: form data is validated with Zod-based helpers before mutations run.
  • Optimistic UI: interactive actions such as follow and favorite use fetcher-driven optimistic state.
  • Error boundaries: the root router renders a dedicated fallback for route and auth failures.

Development Workflow

  • Webpack Dev Server is used for local development.
  • Husky hooks are configured for pre-commit and pre-push checks.
  • Generated API code is produced from OpenAPI through Orval and then normalized with a local Zod conversion step.
  • Root Dockerfile and nginx.conf are used for the containerized frontend build.

Dependency Graph

Dependency Graph

Bundle Analyze

Bundle Analyze

Scripts

  • yarn start — starts the development server.
  • yarn build:dev — builds the app in development mode.
  • yarn build:prod — builds the production bundle.
  • yarn analyze:prod — builds the production bundle with bundle analyzer enabled.
  • yarn test — runs Jest tests.
  • yarn eslint — lints and auto-fixes files under src.
  • yarn prettier — formats the repository with Prettier.
  • yarn graph — generates a dependency graph preview for src.[^1]
  • yarn generate — regenerates API artifacts from the OpenAPI schema.
  • yarn zod:mini — post-processes generated Zod artifacts.
  • yarn format:generated — formats generated API files.
  • yarn prepare — installs Husky hooks.

Run

Install dependencies:

yarn install

Run locally:

yarn start
  • Frontend: http://localhost:30401
  • Backend API: http://localhost:30400/api

[^1]: This assumes the GraphViz dot command is available - on most linux and comparable systems this will be. In case it's not, see GraphViz' download page for instructions on how to get it on your machine.

Docker Compose

Start locally with Docker:

docker compose --env-file .env.compose up -d --build

For backend integration, see node-express-realworld-example-app.

Stop:

docker compose --env-file .env.compose down

Deployment

Build image:

docker build --build-arg API_URL=http://localhost:30400/api -t realworld-frontend .

Released images are published to GitHub Container Registry:

docker pull ghcr.io/yurisldk/realworld:2.1.0
docker pull ghcr.io/yurisldk/realworld:latest

Release images are built with API_URL=http://localhost:30400/api by default.

관련 프로젝트 살펴보기

불러오는 중…