GithubHelp home page GithubHelp logo

segmed_segmail's Introduction

segmed_segmail

Setup

This demo app comes with everything to run it. You can just run:

npm install
npm run start:dev

Тhis should verify that a dummy data file exists, and that you can use it for the application. If you get an error that you do not have an API key, you will need to go to https://newsapi.org/ and register for an API key. Once you have done that and you have your API key, create a .env file:

touch .env

And add the API key to it:

# inside .env
NEWS_API_KEY={your API key goes here}

From there, you can run the start:dev npm command again.

Project Structure

This is a React project built with Typescript and packaged with Webpack. The main entry point is src/index.tsx, which is just used to initialize the <App> component. The driver component is found in src/components/index.tsx -> App. This component stores all of the state for the application and initializes the Lunr.js index.

App conditionally renders either a Preview component or the FilterPane, TagManager, and RecordList. RecordList is a simple table that renders a filtered subset of results returned from the Lunr index. TagManager is a simple component that encapsulates displaying and creating new tags. FilterPane has the 2 fields that allow the user to provide search terms for Lunr.

Why Lunr

Since this is meant to emulate a search application, the logical approach would be to incorporate a search engine/information retrieval engine. The most popular open source solutions are Lucene, Elasticsearch and Solr, but those all act as external DBs. In this case, we use a lightweight Lucene clone written in JS. This provides us with a query syntax familiar to users of Lucene and provides us with a functioning inverted-index for searching without having to roll our own.

segmed_segmail's People

Contributors

martoio avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.