Giter Club home page Giter Club logo

metacpan-grep-front-end's Introduction

metacpan-grep-front-end

Grep Front End code for grep.metacpan.org

Build Status Coverage Status

grep.metacpan

GETTING STARTED

grep.metacpan.org is currently not using metacpan-developer, but it should be pretty straight forward to setup a development environment and starting submitting Pull Request via GitHub.

Requirements

  • a git client (should be compiled with libpcre)
  • perl 5.36 or later (5.36 is the recommended version, consider using perlbrew)
  • App::cpanminus (read manual on metacpan )

git with pcre support

For macOS users, it's recommended to use homebrew to install git with pcre support

> brew install pcre
> export USE_LIBPCRE=yes
> brew reinstall --build-from-source git

You can check if git support pcre by using the '-P' option

# example:
> git grep -c -P "\w"

Cloning repositories

You should start forking the main metacpan-grep-front-end repository You can then clone it locally (where you should replace YOUR-GITHUB-USERNAME by your github username )

> git clone [email protected]:~YOUR-GITHUB-USERNAME~/metacpan-grep-front-end.git
> cd metacpan-grep-front-end
> git remote add upstream https://github.com/metacpan/metacpan-grep-front-end.git

The frontend is not using a database, but a git repo itself as a backend. For this the production is using one huge git repository (~20 Go) indexing all the CPAN in one place ! You can read more on this topic and find tools used to build this Git repo on the GitHub Repos page.

We do not want to use such a beast during development cycles, we only need a smaller version of it, you can simply clone it from this metacpan-cpan-extracted-lite. It should be clone at the same level of metacpan-grep-front-end itself (do not clone it inside the repository).

# clone at the same level of metacpan-grep-front-end
# cd .. # if you are in metacpan-grep-front-end repo
> git clone https://github.com/metacpan/metacpan-cpan-extracted-lite.git

# you should have something like this
> ls -d metacpan-*
metacpan-cpan-extracted-lite metacpan-grep-front-end

Installing dependencies

Now that you have the repository set, let's install all the perl modules required.

You can check your perl version. ( 5.036000 is the recommended one for now )

perl -E 'say $]'

All modules are listed in the cpanfile file itself. Running install.sh itself should do all the magic ( which does more than only installing the perl modules )

./install.sh

But if you prefer you can simply run manually:

> cpanm --installdeps --with-develop --with-recommends .

Starting the development server

Once you have installed all perl modules, you should be able to start the plack server by simply running:

> ./devel-server
Watching . bin/lib bin/app.psgi for file updates.
HTTP::Server::PSGI: Accepting connections at http://0:5010/

This would use plack to run the psgi app and listen by default on port 5010. Any change to any of the file, should automatically trigger a plack restart.

You should let that plack server run in a dedicated terminal then use another terminal for your own development. Note: errors would be logged in the 'devel-server' terminal.

You can now open your browser to this url, and you should be able to see the grep.metacpan.org homepage.

http://127.0.0.1:5010

Custom configurations

Each environment comes with its own environment, by default they all use values from the default configuration config.yml, but they can overwrite some values or provide some custom values using their own file.

config.yml
environments/development.yml
environments/metacpan.yml
environments/production.yml

If you need two tweak your development environment you should look at environments/development.yml You can even create your own environment if required.

From there you should be ready to

# hack, hack, hack...
-> Submit a Pull Request to GitHub
# continue to hack, hack, ...
have fun !

Travis CI

The project comes with a basic .travis.yml file.

If you want to start smoking your own branches, you simply need to link your GitHub account to your Travis CI account, then enable the repository in your Travis Dashboard

Note that any Pull Request submitted via GitHub would trigger a Travis smoke without any settings required from your side :-)

metacpan-grep-front-end's People

Contributors

atoomic avatar oalders avatar ssoriche avatar toddr avatar genio avatar grinnz avatar haarg avatar ranguard avatar book avatar reneeb avatar simbabque 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.