Skip to content

lencodes/schiphol-assignment

Repository files navigation

How to run this application

  • Clone this repository
  • Run $ pnpm i
  • Run $ pnpm run dev and navigate to http://localhost:5173/ to view the application

How to test this application

  • Run $ pnpm run test to run the Vitest tests based in /tests
  • Update REJECT_FETCH to true on line 3 in flightsApiService.ts to trigger the ErrorBoundary

Design choices log

  • Initiated the project using Vite, for its lightweight bundle and strong performance
  • Initiated testing using Vitest (because we're already using Vite)
  • Did not initiate a framework like NextJS or Remix due to the small size of this project
  • Initiated prettier for consistent formatting throughout the codebase
  • Developed all changes on the develop branch, not using a feature branch due to the size of this project
  • Using plain css and plain classes to keep it simple, using prefixes to ensure scope safety
  • Created a dummy flightsApiService including a fake loading time, returning the provided flights.json
  • Slightly updated the flights data to have a few items with different originalTime from expectedTime
  • With a more sophisticated API-service (using e.g. Tanstack Query to wrap the fetch) we would not need the useEffect in SearchFlights.tsx (see why that's relevant here)
  • There are many ways to catch errors, in this example I've used the Error Boundary method from the React docs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published