This is a Next.js project bootstrapped with create-next-app.
First, fork or zip project from github
requirement: node 18.xx or higher
npm install
npm run dev
# or
yarn install
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
A two page web application. / - home page which is on page.tsx /statistics - statistics page which is in app/statistics/page.tsx
used recharts for chart, next-js (A react-js frame work for building web user interfaces). shadcn u.i tailwind css server state management like react-query.
To run the tests, use the following commands:
# Install dependencies
npm install
# Run tests
npm test
# or
yarn install
yarn test
ChartsContainer test file in /components/__tests__/ChartsContainer.test.tsx
Renders loading state
Renders error state
Renders chart with data
These test cases cover the basic scenarios for loading, error, and rendering data for the `ChartsContainer` components.