This assignment is designed to assess your practical skills in React, Next.js, TypeScript, Tailwind CSS, and frontend optimizations. You will work on an existing Next.js application that contains layout/design issues and some configuration bugs. Your task is to identify and resolve these issues, and implement the listed features to enhance the overall user experience.
This repository contains a polished Next.js (App Router) application implementing the SolveEase Frontend Intern assignment. The app lists workers with filters, pagination, and a modern UI. It focuses on clean TypeScript, accessibility, and performance, with tasteful animations that respect user motion preferences.
- Filters: service (from
/api/services) and price/day (dual‑range slider with debounce and clamping) - Pagination: accessible controls with animated active state
- Loading skeletons and error retry flow
- Session storage caching to avoid redundant fetches
- Animations and polish:
- Card hover lift + image zoom
- Staggered list enter + page cross‑fade
- Page‑wide cursor glow (screen blend) with parallax title
- Reduced‑motion support (animations tone down/disable)
- Accessibility:
mainlandmark, list semantics, aria-live summary- Focus-visible rings and keyboardable slider
- Tests: 6 passing unit tests (loading, filtering, retry, pagination boundaries, clamping, a11y smoke)
- Next.js 15, React 19, TypeScript
- Tailwind CSS v4 via
@tailwindcss/postcss - Framer Motion for micro‑interactions
- Vitest + RTL for tests
- Node 20 LTS recommended on Windows for Tailwind v4 + lightningcss. Node 22 works with the configuration in this repo, but Node 20 is the safest baseline.
npm installnpm run dev
# http://localhost:3000npm run testnpm run lintnpm run build
npm start- If you hit a
lightningcss/../pkgerror:- Ensure npm scripts are enabled:
npm config get ignore-scripts→ if true, runnpm config set ignore-scripts false. - Rebuild:
npm rebuild lightningcss - Clean install: remove
node_modules,npm cache clean --force, thennpm ci(ornpm install). - Run dev. You can also try setting
CSS_TRANSFORMER_WASM=1for a WASM fallback. - Node 20 LTS is the most reliable baseline on Windows.
- Ensure npm scripts are enabled:
This project already includes a correct Tailwind v4 PostCSS shape in postcss.config.mjs:
export default {
plugins: {
'@tailwindcss/postcss': {},
},
}- Background: page‑wide neutral gradient (
from-neutral-900 via-neutral-950 to-black) with a clean, neutral panel. - Cards: white surfaces for contrast and readability; subtle lift/zoom on hover.
- Navbar: sticky with underline slide‑in and press glow on links.
- Cursor Glow: page‑wide overlay using blend mode; disabled in reduced‑motion.
- Reduced Motion: animations respect user preferences via
useReducedMotion.
GET /api/workers— returns workers list (backed byworkers.json).GET /api/services— returns unique services.
src/app/page.tsx— main page: data fetching, filters, pagination, animationssrc/components/Filters.tsx— service + price rangesrc/components/PriceRange.tsx— dual‑range slider componentsrc/components/Pagination.tsx— pagination with animated statessrc/components/Navbar.tsx— sticky navbar with link animationssrc/app/api/workers/route.ts— API route for workerssrc/app/api/services/route.ts— API route for services
- Push your branch to GitHub.
- On Vercel, import the repo and deploy with the Next.js preset (defaults are fine).
- Ensure
next.config.tsallows any remote images you add (already whitelistedrandomuser.me).
Not recommended for SSR — prefer Vercel/Netlify. If needed, export a static build with constraints (not covered here).
- Built with Next.js, Tailwind CSS, and Framer Motion.
- Inspired by modern interaction patterns showcased in Framer’s gallery.
- Correct the existing card grid layout.
- Improve the overall card design (UI/UX sensibility expected).
- Ensure the page is fully responsive across devices (desktop, tablet, mobile).
- Implement a navigation bar that remains fixed at the top while scrolling.
- Design should be clean and responsive.
- Implement optimizations such as:
- Lazy loading for images and non-critical components.
- Memoization to avoid unnecessary re-renders.
- Skeleton loading screens for better UX during data fetch.
- Add pagination for the workers listing page.
- Each page should load a suitable number of items (e.g., 9–12 cards per page).
- Implement filters for workers based on price/day and type of service.
- Filters should work seamlessly with pagination.
- Identify and fix any existing issues in
page.tsxor configuration files. - Resolve console warnings or errors.
- Ensure clean and maintainable code following best practices.
- Currently, the workers’ data is being imported directly from
workers.json. - Your task is to serve this data via /api/wprkers API route.
- Update the frontend page to fetch this data using
fetch(or any modern method such asuseEffect,useSWR, or React Query). - Donot delete the existing data loading logic, comment it out.
- Implement:
- Loading state (use skeleton screens).
- Error handling (show a friendly error message if API fails).
- Basic caching or memoization to prevent redundant calls.
- Use TypeScript and Tailwind CSS consistently.
- Follow component-driven development principles.
- Write clean, readable, and reusable code.
- Optimize for performance and accessibility.
- Maintain Git commit history (no single "final commit").
- Fork the assignment repo, make changes there.
- Fill in the Goggle Form with your details for submission.
- Code quality, readability, and structure.
- UI/UX improvements and responsiveness.
- Correctness of functionality (filters, pagination, sticky navbar, optimizations).
- Debugging and problem-solving approach.
- Git usage and commit practices.
- Handling of API calls, loading states, and error cases.
- You are free to use libraries like SWR or React Query, but keep the implementation clean.
- Focus on real-world production quality code, not just quick fixes.
- Add comment for any bug fix or optimization.
- Document any extra improvements you make in your submission.
Good luck 🚀
- Sticky navbar via
src/components/Navbar.tsx, included insrc/app/layout.tsx. - API integration: frontend fetches from
/api/workers; old JSON import kept commented insrc/app/page.tsx. - Loading skeletons and error state with Retry.
- Session-based caching and memoized derived lists.
- Pagination (12/page) with accessible controls.
- Filters: service (from
/api/services) + min/max price, integrated with pagination. - Accessibility: main landmark, list semantics, focus-visible, polite results summary.
- UI: neutral dark background, white cards, improved contrast.
- Tests: Vitest + RTL covering loading/success, filter, and error retry flows.
npm install
npm run dev
# open http://localhost:3000
npm run build
npm start
- dev: start Next dev server
- build: production build
- start: run built server
- lint: run ESLint
- test: run Vitest once
- test:watch: run Vitest in watch mode
- Next.js (App Router) + React 19 + TypeScript
- Tailwind CSS v4
- API routes:
src/app/api/workers/route.ts,src/app/api/services/route.ts - Page:
src/app/page.tsx - Components:
src/components/(Navbar.tsx,Pagination.tsx,Filters.tsx)
GET /api/workers— workers list (fromworkers.json)GET /api/services— unique services (optionally?stats=truefor stats)
- Vitest + React Testing Library + jsdom
vitest.config.tssrc/test/setup.tssrc/test/page.test.tsx
npm run test
npm run test:watch
- Loading → success
- Service filter → results summary
- Error state → Retry
- Pagination boundaries
- Price range clamping
- A11y smoke checks
- Keep JSON import commented (per assignment) to show migration.
- Use sessionStorage for simple session cache; consider SWR later.
- Memoize derived lists for performance.
- A11y-first roles/labels and focus-visible.
- Push your branch (
assignment/<your-full-name>) to GitHub. - On Vercel: New Project → Import repo.
- Framework preset: Next.js (defaults fine).
- Deploy. Copy the URL.
- Add the URL to this README and submit the Google Form.
Notes: next.config.ts allows images from randomuser.me. Update if adding more domains.
- Branch name format respected.
- Fill the provided Google Form with repo + deployed link.