Home

Awesome

Build Status Coverage Status

How to setup local development environment

You need to complete several steps below to get yourself ready to develop PrePAN;

  1. Cloning this repository
  2. Bootstrapping
  3. OAuth setup

Clone this repository

$ git clone git://github.com/CPAN-API/prepan.git
$ cd prepan

Bootstrapping with script/setup.sh

Run script/setup.sh at the PrePAN root directory to bootstrap your environment.

$ script/setup.sh

This command does following things:

OAuth setup

PrePAN uses Twitter and GitHub to authenticate users. You have to, at first, create a new Twitter application.

Create a new Twitter Application

You can create a new Twitter application on https://dev.twitter.com/apps.

  1. Press "Create a new application" button
  2. Input some information for your application, for example:
  1. Press "Create your Twitter application" button

Next, you need to change settings for the app:

  1. Press "Settings" tab
  2. Change "Application Type" to:
  1. Save settings

Then, you can use this application to develop PrePAN.

Add OAuth config into config/development.pl

After create a twitter application, you need to add an OAuth config into config/development.pl.

Open config/development.pl and add a consumer key and a consumer secret for your application.

Example:

    Auth => {
        Twitter => {
            consumer_key       => 'abcdefghijk',          # your twitter consumer key
            consumer_secret    => 'consumersecrettttt',   # your twitter consumer secret
            callback_fail_path => '/auth/twitter/failed',
        },
    },

How to start local server

Execute the command below at PrePAN root directory:

$ carton exec -- plackup

You can access http://localhost:5000/. Enjoy Hacking!!

Local test setting

Run below command if you want to run tests.

$ carton exec -- prove -v t/**/*.t

Update dependency

Edit cpanfile and run following commands if you want to update dependency:

$ carton install
$ git add cpanfile cpanfile.snapshot
$ git commit

Contact

You can ask @prepanorg or @shiba_yu36 if you have a question.