You will refactor an existing React application to demonstrate a strong understanding of:
- Feature-based architecture
- Custom hook design and reuse
You will not create a new application from scratch. The goal is to improve structure, separation of concerns, and logic organization.
git clone https://github.com/ITC-Frontend-Advanced/React-Task-Architecture-Custom-Hooks.gitgit checkout appBefore making any changes, carefully analyze the existing codebase.
Understand how components, logic, and data flow are currently structured.
The repository contains two branches:
-
main
Contains this task description and instructions. -
app
Contains an existing React application with:- Mixed responsibilities
- Centralized logic
- Poor or flat structure
Your job is to refactor the application, not rewrite it.
You must reorganize the project into a feature-based architecture.
src/
ββ features/
β ββ users/
β β ββ components/
β β ββ hooks/
β β ββ services/
β β ββ index.ts
ββ shared/
β ββ components/
β ββ hooks/
β ββ utils/
ββ app/
ββ App.tsx
- No feature logic inside
App.tsx - No API or business logic inside UI components
- Each feature must be isolated and self-contained
You must extract at least two custom hooks from the existing code.
- Handles data fetching
- Manages loading and error states
- Includes cleanup when necessary
Examples:
useCanvasuseFetchuseMobile
- Hooks must be generic and reusable
- Hooks must not depend on specific UI components
Your submission must include:
- β Refactored code pushed to GitHub
- β Clean, feature-based folder structure
- β
A
README.mdfile explaining:- What was refactored
- Why the new structure is better
- List of extracted custom hooks
- How to run the project
- UI improvements are not required
- Styling changes are not required
- Focus on structure and logic only
4 Jan 2026 β 11:59 PM