A command line application to search different types of data and return the results in a human-readable format.
Using the provided data (tickets.json and users.json and organization.json) write a simple command line application to search the data and return the results in a human-readable format.
- Feel free to use libraries or roll your own code as you see fit. However, please do not use a database or full-text search product as we are interested to see how you write the solution.
- Where the data exists, values from any related entities should be included in the results,i.e. searching organization by id should return it's tickets and users.
- The user should be able to search on any field, full value matching is fine (e.g. "mar" won't return "mary").
- The user should also be able to search for empty values,e.g. where the description is empty. Search can get pretty complicated pretty easily, we just want to see that you can code a basic but efficient search application. Ideally, search response times should not increase linearly as the number of documents grows. You can assume all data can fit into memory on a single machine.
- node, Run
node --version
in terminal to verify - npm comes with node
Clone the repository
$ git clone https://github.com/ooanishoo/search-engine
$ cd search-engine
This is the directory/file structure once you clone the repository from the git.
βββ README.md
βββ data
β βββ organizations.json
β βββ tickets.json
β βββ users.json
βββ jest
β βββ setup.js
βββ jest.config.js
βββ package-lock.json
βββ package.json
βββ src
β βββ ask
β β βββ ask.spec.ts
β β βββ ask.ts
β βββ index.ts
β βββ search
β β βββ searchEntity.spec.ts
β β βββ searchEntity.ts
β βββ types
β β βββ index.ts
β βββ utils
β βββ index.spec.ts
β βββ index.ts
βββ tsconfig.json
Install dependencies
npm install
npm start
npm run dev
npm test
- inquirer: A collection of common interactive command line user interfaces.
- jsonfile: Easily read/write JSON files in Node.js
π€ Anish Maharjan
- Github: @ooanishoo
- LinkedIn: @ooanishoo
Give a βοΈ if this project helped you!
This README was generated with β€οΈ by readme-md-generator