Giter VIP home page Giter VIP logo

pursuit's Introduction

Pursuit

Build Status

Pursuit is a web application which hosts documentation for PureScript packages, and lets you search for code by names or types, via Hoogle.

Pursuit is currently deployed at http://pursuit.purescript.org.

Information for package authors can be found at http://pursuit.purescript.org/help.

Development

It's recommended to use stack: http://docs.haskellstack.org.

To build in development mode:

$ stack build

To run the server:

$ stack exec pursuit

To build in production mode:

$ stack build --flag pursuit:-dev

Database structure

Pursuit currently uses the filesystem as a database, since it requires no setup and it makes it easy to use Git and GitHub for backing up. The data directory is set via an environment variable (see Configuration).

The structure is as follows:

/
  cache/
    packages/
      purescript-prelude/
        0.1.0/
          index.html
          docs/
            Prelude/
              index.html
  verified/
    purescript-prelude/
      0.1.0.json
      0.1.1.json

The cache/ directory has files that mirror the URL structure of the web application, and contains files which do not change and may be served as-is without forwarding the request on to the Yesod application. See Handler.Caching for more details.

The verified/ directory stores uploaded packages. Each package has its own directory, and then there is a JSON file for each version. These JSON files each contain a serialized Package GithubUser; see Language.PureScript.Docs.Types in the compiler for details about these types.

The backup process simply involves rsyncing everything in the verified/ directory into a git repository, making a commit, and pushing it to GitHub.

Configuration

All configuration is done at startup via environment variables. The relevant code is in the Settings module.

All configuration variable names start with PURSUIT_ (eg, PURSUIT_STATIC_DIR). Most environment variables are not required, and have sensible defaults if not specified. The ones which are required are:

  • PURSUIT_GITHUB_CLIENT_ID: Github OAuth client id, for signing users in.
  • PURSUIT_GITHUB_CLIENT_SECRET: Github OAuth client secret, for signing users in.

See src/Settings.hs for more details.

One way to supply the application with environment variables (if you are on a system which uses Bash) is to use a script like the one in config/development.env.

pursuit's People

Contributors

hdgarrood avatar paf31 avatar joneshf avatar eskimor avatar cdepillabout avatar alexchandel avatar anttih avatar epost avatar michaelficarra avatar spicydonuts avatar

Watchers

Madeline Trotter avatar James Cloos 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.