Built a single-page app to enable users to search and browse historical information from a "messy" JSON dataset.
The JSON dataset contains ~40k historical events formatted messily. For example, some dates are represented as years only, while others in YYYY/MM/DD,and dates in the BC range are negative. Lastly, the citations are formatted in different ways and unusable.
Apploads events information into state by calling the API, renders all page elements (Search & Results components, number of events, and pagination), and handles search queries and page selectionsSearchcontains search input, listening to changes and sending submits back to the query handlerResultsrenders timeline based on current event results
cleanText.descriptionproduces a cleaner version of the event descriptions by removing most citation information. Rules used:- Remove all paired or nested
{and}tags - Remove all paired or nested
<aand</a>tags - Attempts were made to remove other citations, but they were too inconsistent for rules to capture.
- Remove all paired or nested
cleanText.dateproduces a cleaner version of event date. Rules used:- Negative Signs were replaced with "B.C."
- Only the year part of the date was used in the YYYY/MM/DD formatted dates.
json-serverto set up a simple API from static assets in repositoryaxiosfor API requestsreact-paginateto paginate the list of eventsvertical-timeline-component-for-reactto display event results in a digestible format
First install dependencies:
npm installThen start the server:
npm run server-devThen start build:
npm run build-dev
