Skip to content

ITC-Frontend-Advanced/React-Task-Architecture-Custom-Hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 

Repository files navigation

🧠 React Task: Architecture & Custom Hooks

πŸ“Œ Objective

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.


πŸ›  Project Setup

1️⃣ Clone the Repository

git clone https://github.com/ITC-Frontend-Advanced/React-Task-Architecture-Custom-Hooks.git

2️⃣ Checkout the App Branch

git checkout app

3️⃣ Analyze the Codebase

Before making any changes, carefully analyze the existing codebase.
Understand how components, logic, and data flow are currently structured.


πŸ“ Repository Structure

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.


🧩 Feature-Based Architecture

You must reorganize the project into a feature-based architecture.

Example Target Structure

src/
 β”œβ”€ features/
 β”‚   β”œβ”€ users/
 β”‚   β”‚   β”œβ”€ components/
 β”‚   β”‚   β”œβ”€ hooks/
 β”‚   β”‚   β”œβ”€ services/
 β”‚   β”‚   └─ index.ts
 β”œβ”€ shared/
 β”‚   β”œβ”€ components/
 β”‚   β”œβ”€ hooks/
 β”‚   └─ utils/
 └─ app/
     └─ App.tsx

Rules

  • No feature logic inside App.tsx
  • No API or business logic inside UI components
  • Each feature must be isolated and self-contained

πŸ” Custom Hooks Extraction

You must extract at least two custom hooks from the existing code.

Required Hooks

1️⃣ Data-Related Hook

  • Handles data fetching
  • Manages loading and error states
  • Includes cleanup when necessary

2️⃣ Logic-Related Hook

Examples:

  • useCanvas
  • useFetch
  • useMobile

Rules

  • Hooks must be generic and reusable
  • Hooks must not depend on specific UI components

πŸ“€ Deliverables

Your submission must include:

  • βœ… Refactored code pushed to GitHub
  • βœ… Clean, feature-based folder structure
  • βœ… A README.md file explaining:
    • What was refactored
    • Why the new structure is better
    • List of extracted custom hooks
    • How to run the project

πŸ“ Notes

  • UI improvements are not required
  • Styling changes are not required
  • Focus on structure and logic only

⏰ Deadline

4 Jan 2026 β€” 11:59 PM

About

This task is designed for developers who already know React and want to demonstrate real-world architecture skills and custom hook mastery.

Topics

Resources

Stars

Watchers

Forks