To install the project, follow these simple steps:
- Clone the project
- Run
npm install
to setup package dependencies - Run
npm start
to access the local host - Run
npm test
to access the tape tests
- A website that enables users to quickly find and select words from a list of suggestions, as they type.
- The list is dynamically generated from a pre-populated list of values (i.e. a dictionary file), leveraging searching and filtering.
- A large data file is required to search through - consider the best data structure for this.
- Consider how implementation affects user experience and web performance (e.g. time to load and search through the data file).
Your task is to build a site which will update as you type (an autocompleter), as per the description above.
-
We expect back-end testing using tape (test as many components as you can) and basic front-end testing. Please note that we expect tests on pure functions and not on the router or the DOM.
-
Host your project on heroku, see resource.
-
Use module.exports and require to break a single large server file into smaller modules.
-
Consider what would be a good server file structure based on what we have discussed over the week.
The team created a website that has an autocompleter for browsing through the UNESCO World Heritage Sites in the UK and providing a link to wikipedia upon searching.
The team had a dream of visiting the UNESCO World Heritage Sites across the world.
So... After a big brain-storm of ideas proposed, we decided to follow our dream of finding out what these World's Heritage Sites are...
But then when we found out it was 1000+ sites, so we changed our dream, and broke it down to searching for only the U.K's sites..
And it was a success.
We separated our public and our src folder that contained front-end and back-end files respectively.
Within public
Following the previous knowledge from week 1, we decided to keep focusing in running audits to make our app accessible for everyone. Hurray!
connected to the DOM
Tests creation through tape
While Reggie and Pat were working in requesting the pseudo-API, Rosa and Renata made simple tests for our main search function. At the begining the process was a little daunting but we really enjoy watching our tests pass and we feel a little more confident with TDD (even though we only tested very simple features)
handlers.js(back-end) with call.js (front-end)
After the Design Burst hosted by Bobby on wednesday afternoon we've decided to follow his challenges and advice in our design by implementing the following:
- ✅ Add a search (loupe) button
- ✅ Avoid scrollbars and have max 10 options showing (easy peasy as our data is not so long)
- ✅ Highlight the differences while typing input in the search box
- ✅ Add a pointer to inputs
- ✅ Highlight on hover the inputs
- ✅ Make the search bar well defined
-
the url for the call to the psuedo api had to be renamed to "endpoint" because it interfered with the url core module
-
we had to change indexOf to includes when checking for 'public' in the endpoint in the router file!
-
Took us a while to find this little gem (decodeURI()) (and when we say "us" we mean kin - thank you kin) to parse spaces in the urls
- had to add an event listener inside the populatedropdown function in order to be able to select options from the list
-
The Heroku app took ages to work! We would advise a) making sure you have admin access to fac18 b) making sure you are a contributor on the repo c) following thiswalk through: https://www.freecodecamp.org/news/how-to-deploy-a-nodejs-app-to-heroku-from-github-without-installing-heroku-on-your-machine-433bec770efe/
-
We started to write a function to capitalise the first letter of every word except 'and 'of' and 'to' before realising it was completely uneccessary - a lesson in not making uneccessary work for yourself
- Added keyboard functionality
- Disabled search going straight to wikipedia
- Autocompleter sorted (Disappears when you click on another page/option)
- Links to Wikipedia upon clicking a selection
- Styled page appropriately and clarified placeholder
- Making one for all sites internationally (The true dream)
- Using env for more security
🍻 😴