Git Product home page Git Product logo

opencollective-exercise's Introduction

OpenCollective exercise

Run in development

npm install
npm run dev

Run in production

npm install
npm run build
npm start

Design Decisions

My first obvious decision was to do the application in Javascript and base the project on Express and React. It's my current personal preference and it's used at OpenCollective.

I initially considered doing a full backend application without other frameworks but then didn't want to setup babel and webpack for the JSX support. I finally settled on Next.js, as it would provide a good basis and help keep the codebase simple. It's also used for the OpenCollective frontend which was a plus.

There are just two pages, an index page, and a search page.

There is an API endpoint to return the search results. For that, I had to go a bit out of the Next.js default setup and provide a custom index.js with an Express server.

The search endpoint is relying on a search function that is doing everything in memory, based on the CSV file:

  1. file is read from disk
  2. parsed as CSV
  3. data is transformed in objects
  4. there is a simple score system based on case-insensitive matching of the query against key fields
  5. results are sorted by their score
  6. there is a hard limit of 10 results

The final step was to wire the API data in the search page.

Live Version

This app was deployed with now on this URL: https://znarf-opencollective-exercise.now.sh/

This version is currently limited to the first 500 entries in the CSV (file size limit).

opencollective-exercise's People

Contributors

znarf 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.