How rarandeyo/yumemi-frontend-coding-test works
Project Type & Purpose
• The project is a full-stack web application built with Next.js. It focuses on visualizing the population trends of various Japanese prefectures.
• The README emphasizes that this is a coding challenge using technologies like Next.js, React, TypeScript, Tailwind CSS, and Recharts for the front end, while Hono (with Zod) is leveraged for API route handling in the server/edge layer.
Key Components from the File Structure
a. Frontend (Client-side/UI):
• Located in the “src/app” directory with React components for the UI. This includes “layout.tsx,” “page.tsx,” and several UI components (PopulationDashboard, PopulationGraph, PrefectureCheckboxes, SelectPopulationLabel) in the “src/components” folder.
• Styling is handled by Tailwind CSS (see “src/styles/globals.css” and “tailwind.config.ts”).
• The app uses Next.js’s App Router for page composition and dynamic routing.
b. API/Backend:
• Found under “src/app/api” where you see dynamic API routes (using [[...route]] conventions).
• The API endpoint for the population dashboard (including route handlers and tests) is defined here along with integration of Hono for handling requests at the Edge runtime.
• API request data handling is supported by API configuration (in “src/config”) and data fetching utilities (in “src/utils/yumemiApiFetcher.ts” and others).
c. Business Logic & Data Handling:
• “src/libs/apiClient.ts” and utility functions in “src/utils” help in fetching data, formatting chart data, and applying graph styles.
• Domain models and schemas are defined in “src/types” and “src/constants” to ensure correct data structure and consistency when processing population data.
d. State & Custom Hooks:
• Custom React hooks in “src/hooks” are used for managing UI state like selected prefectures or population labels, encapsulating business logic for frontend interactions.
e. Testing & Configuration:
• Every major module (app, API endpoints, components, config, hooks, utils) has associated “__tests__” directories, stressing solid unit testing practices with Vitest.
• Additional project configs include TypeScript (tsconfig.json), Biome, and PNPM configuration files along with CI workflows in “.github/workflows.”