My solution for Check24 Holiday Challenge.
- Frontend: ReactJS, Material UI
- Backend: NodeJS, ExpressJS, Python (to populate the database from csv files)
- Database: PostgreSQL
- Container: Docker
-
Clone the repository with the submodules (frontend and backend)
git clone --recurse-submodules git@github.com:jazli1999/CheckMine.git
-
Put
hotels.csv
andoffers.csv
underCheckMine/CheckMine-Backend/scripts
, which later will be used to populate the database -
Run with docker
cd CheckMine docker-compose -f docker-compose.yml up
NOTE: First time runing docker-compose could take very long (~1h15min on my MacBook Air), to populate the database. offers.csv
is loaded into database by chunks, and progress is indicated with tqdm
. However tqdm
dose not work very well with docker-compose as stated in this issue, so I used a workaround to directly print the tqdm
object. It does not look very good, but it works and displays the importing progress.
-
A deploy can be found here. On some requests (e.g. with airport FRA), the performance may not look ideal (~5s), because I chose the cheapest plan on DigitalOcean. But for most cases, loading time should be ~1s.
When running locally (or with proper CPU/network hardware support), the solution should have a satisfactory performance for all scenarios (see Performance).
-
Also a screen recording here in case neither the deploy nor the installation works.
When running on my laptop, requests take ~200ms on average (by observation). When running in docker, it is slightly slower, ~400ms.
Table partition is adopted for performance optimization in this solution.
When populating the database, a new column duration
is added, which is calculated by inboundarrivaldatetime - outbounddeparturedatetime
.
The offer
table is first partitioned by departure airport, and those large partitions (e.g. offers for FRA
) with still millions of offers are partitioned again by durations.
Data are fetched with server-side pagination, avoiding large network traffic.
View optimized for almost any screen size (PC, tablet, mobile).
- A "Clear" button is provided to clear the form.
- A "See offers from other hotels" link is provided on the hotel offer page, for users to easily navigate back.
- Request overview is displayed in hotel offer page, so the user don't have to go back-and-forth to confirm they have input the correct information.