Small React + TypeScript map application built with Vite.
It loads fake location data from JSON, shows the data on a map, and renders a synchronized list with filtering and selection behavior.
There are two ways to run the project:
- with Docker
- with local development commands
Build and start the app:
docker compose up --buildOpen:
http://localhost:8080
Stop containers:
docker compose downInstall dependencies:
npm installRun the app:
npm run devOpen:
http://localhost:5173
npm run buildnpm test- Used
React + TypeScript + Vitefor a fast development workflow and simple build setup. - Used
Leaflet + react-leafletbecause it is lightweight, easy to integrate, and works well for this assignment. - Kept a component-based structure with clear separation between:
mapmap-list-itemmap-filters
- Split each UI unit into
controller,view,style, andtypefiles to keep logic, rendering, styles, and typing separate. - Kept page/app structure thin and pushed most UI behavior into components.
- Used a fake JSON file in
public/data/locations.jsonso the API flow stays simple and easy to replace later. - Added selection and hover syncing between map markers and list items to match the requested interaction behavior.
- Explicitly imported Leaflet marker image assets so default markers work correctly in production and Docker builds.
- Added
Vitestfor unit testing.
- Add routing so the app can scale beyond a single screen without overloading the root app component.
- Add configuration to switch map providers more easily, for example between Leaflet/OpenStreetMap, Google Maps, or Mapbox.
- Explore a more event-driven coordination layer between the map and the list, for example via listeners/pub-sub, so interactive parts could be decoupled further instead of relying only on shared React state.
- Use
AbortControllerin the data-fetching hook to cancel in-flight requests when the component unmounts or a newer request replaces the old one. - Extend tests for filtering, selection, and marker/list synchronization behavior.
- Add responsive polish and a small design system for shared spacing, typography, and interactive states.