This is the starter repository for the FocusForge. You will be working directly inside this codebase.
FocusForge is a productivity application that helps developers manage their daily tasks and stay focused. The application is functional — but the code behind it tells a different story.
A previous developer built the entire dashboard in a single file: DashboardPage.jsx.
It works. Open it, and you'll see everything in one place — the header, the stats cards, the task input, the filters, the task list. Every piece of UI, every handler, every style, all 250+ lines of it, living in one component.
Right now that's manageable. But imagine:
- A new developer joins the team and needs to fix the filter logic
- A designer wants to update just the stat cards
- You need to reuse the task row in a different page
Every one of those changes means digging through the same monolithic file, trying not to break something three sections away. This is how codebases become things people dread touching.
Your job is to fix the architecture before it gets worse.
- Node.js 18+ installed
- npm or yarn
# Clone the repo (or navigate to the challenge folder)
git clone <repo-url>
cd focusforge-broken
# Install dependencies
npm install
# Start the development server
npm run devThe app will be running at http://localhost:5173.
focusforge-broken/
├── src/
│ ├── pages/
│ │ └── DashboardPage.jsx ← 🚨 Everything lives here
│ ├── data/
│ │ └── tasks.js ← Seed data
│ ├── App.jsx
│ └── main.jsx
├── index.html
├── package.json
└── vite.config.js
Open src/pages/DashboardPage.jsx and study it carefully.
You need to:
- Identify distinct UI sections — header, stats, task input, filters, task list, individual task row
- Extract each section into its own component with a single, clear responsibility
- Identify which components can be reused across the app (hint:
StatCardandTaskItemare prime candidates) - Pass data down via props — components should receive what they need, not reach for global state
- Organize components into a logical folder structure
- Keep
DashboardPage.jsxas the state manager — it should compose components, not render raw HTML
When you are done, the app should look and behave identically to when you started. The only thing that should change is the structure of the code.
src/
├── pages/
│ └── DashboardPage.jsx ← Lean: only state + composition
├── components/
│ ├── dashboard/ ← Page-specific components
│ │ ├── DashboardHeader.jsx
│ │ ├── StatsRow.jsx
│ │ ├── AddTaskInput.jsx
│ │ ├── TaskFilterBar.jsx
│ │ └── TaskList.jsx
│ └── shared/ ← Reusable across pages
│ ├── StatCard.jsx
│ └── TaskItem.jsx
└── data/
└── tasks.js
Once complete:
- Push your refactored code to a new GitHub repository
- Deploy the app (Vercel, Netlify, or GitHub Pages)
- Open a Pull Request with a description explaining your component decisions
- Record a 3–5 minute walkthrough video demonstrating your refactored structure
See the full assignment brief for detailed submission instructions.
Start by reading DashboardPage.jsx top to bottom. Draw a box around every logical section. Give each box a name. That name is your component.