GithubHelp home page GithubHelp logo

isabella232 / nixos-search Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nixos/nixos-search

0.0 0.0 0.0 1 MB

Search NixOS packages and options

Home Page: https://search.nixos.org

Nix 5.14% Elm 49.83% HTML 0.47% JavaScript 2.87% Less 4.65% Shell 0.17% Rust 36.58% Lua 0.29%

nixos-search's Introduction

search.nixos.org

This repository contains the scripts and the web application for search.nixos.org.

How this project came to be

Initial idea was to replace NixOS packages and options search which was fetching one JSON file which contained all packages (or options). This approach is good for its simple setup, but started to show its problems when packages number was getting bigger and bigger. I'm sure we could optimize it further, but ideas what all could we do if there would be some database in the back were to tempting not to try.

For backend we are using Elasticsearch instance which is kindly sponsored by bonsai.io. On the frontend we are using Elm.

How search works?

The use case we want to solve is that a visitor want to see if a package exists or to look up certain package's details.

A user wants to converge to a single result if possible. The more characters are added to a search query the more narrow is search is and we should show less results.

Very important is also ranking of search results. This will bring more relevant search results to the top, since a lot of times it is hard to produce search query that will output only one result item.

A less important, but providing better user experience. are suggestions for writing better search query. Suggesting feature should guide user to write better queries which in turn will produce better results.

Development

To start developing open a terminal and run:

$ nix-shell --run "yarn dev"

You can point your browser to http://localhost:3000 and start developing. Any changes to source files (./src) will trigger a hot reload of an application.

Deploying

  • On each commit to main branch a GitHub Action is triggered.
  • GitHub Action then builds production version of the web application using yarn prod command.
  • The built web application (in ./dist) is then deployed to Netlify.
  • GitHub Action can also be triggered via Pull Request, which if Pull Request was created from a non-forked repo's branch, will provide a preview url in a comment.

Adding flakes

To add your own flakes to the search index edit ./flakes/manual.toml.

Possible types are github, gitlab, and git (which is the fallback for any kind of git repository but requires to set a revision key manually as of now).

To test whether your flake is compatible with nix flake-info you can try running flake-info against it

$ nix run github:nixos/nixos-search#flake-info -- flake <your flake handle>

nixos-search's People

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.