Implement React cat listing application for Medibank coding challenge#3
Implement React cat listing application for Medibank coding challenge#3
Conversation
Co-authored-by: medibank-digital <60204734+medibank-digital@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements a React application for the Medibank Coding Challenge using an MVC-style architecture that follows SOLID principles and incorporates Tailwind CSS for styling. Key changes include the establishment of the basic React/TypeScript project structure, the implementation of a Model-Controller-View layering for processing and displaying cat data grouped by owner gender, and updates to relevant configuration and documentation files.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/view/GenderSection.tsx | Introduces the GenderSection component to render cat names by gender |
| src/view/CatList.tsx | Implements the CatList component for fetching and displaying cat data |
| src/model/CatDataSource.ts | Provides a data source for fetching people data via Axios |
| src/controller/CatController.ts | Implements business logic to filter, group, and sort cats by owner gender |
| src/App.tsx, src/index.tsx, public/index.html | Sets up the entry point and mounting of the React application |
| postcss.config.js, package.json, README.md, src/index.css | Include supporting project configuration and styling details |
|
@copilot - Can you also please add:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: medibank-digital <60204734+medibank-digital@users.noreply.github.com>
I've implemented all the requested features (commit 6f93ef2):
All components now use Material UI with proper styling and the project has complete test coverage. The mock API can be run with |
Co-authored-by: medibank-digital <60204734+medibank-digital@users.noreply.github.com>
|
@copilot Can you give me the link where it is hosted on GitHub pages |
The application is hosted at: https://medibank-digital.github.io/coding-challenge-web This URL is defined in the package.json "homepage" field and the deployment is handled via the GitHub workflow in .github/workflows/deploy.yml, which builds and pushes to the gh-pages branch. |
|
@copilot can you review the code |
Overview
This PR implements a complete React solution for the Medibank coding challenge as specified in the requirements. The solution fetches cat data from the provided API endpoint and displays cats alphabetically under headings grouped by their owner's gender.
Architecture
The solution follows SOLID principles and uses a separation of concerns inspired by the MVC pattern:
Model
CatDataSource.tshandles data fetching from the API using AxiosController
CatController.tsprocesses the raw data from the modelView
CatList.tsx- Main component that coordinates data fetching and renderingGenderSection.tsx- Component that renders a gender section with its associated cat listFeatures
How to Run
npm installnpm startScreenshots
Note: Screenshots would be added here in a real PR
Testing
The application has been manually tested to ensure:
Next Steps
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.