Giter VIP home page Giter VIP logo

boss's Introduction

Total alerts Language grade: JavaScript

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • NodeJS
  • Node Package Manager(NPM)
  • Git
  • PostgreSQL

Installing

A step by step series of examples that tell you have to get a development environment running

  1. Download ZIP file or clone the repository to create your own copy.
git clone https://github.com/coding-blocks/boss.git

  1. Move to the boss repository
cd ./boss

  1. Install all project dependency packages via NPM
npm install

  1. Create a secrets.json file in the root directory taking hint from the secrets-sample.json file or You can also create a copy of secrets-sample.json file and rename it as secrets.json in the root directory. ( Don't worry secrets.json is already added to .gitignore file so it won't be commited )

  2. Create a Client on Coding Blocks OneAuth using https://account.codingblocks.com/clients/add

Remember the Client ID and Client Secret and copy them to your secrets.json file.

Also, remember to change the callback URL to your desired url. You can use http://localhost:3232/login/callback if you are testing on your localhost system.

  1. Set up PostgreSQL
  • If you don't have PostgreSQL setup on your machine you can download it from here.
  • If you have renamed the secrets-sample.json file to secrets.json then
    • After Installation is complete create a new PostgreSQL user username with password as pass.
    • Create a new database in PostgreSQL server with name dbname.
  • If you have created a new secrets.json file then create the respective things accordingly.
  1. Start the server.
npm start

And see it working on http://localhost:3232

For Testing

BOSS_DEV=localhost node index.js

API

CLAIMS

List All Claims

GET /api/claims?[status=accepted]

Add a claim

POST /api/claims/add
BODY
{
  user: "championswimmer",
  issueUrl: "http://github.com/coding-blocks/lab/issues/7",
  pullUrl: "http://github.com/coding-blocks/lab/pull/7",
  bounty: 20
}

boss's People

Contributors

aannaassalam avatar abhishek97 avatar ananay avatar ankiiitraj avatar architkshk avatar b30wulffz avatar bhavyaagg avatar championswimmer avatar codingblocks-bot avatar dhroov7 avatar hashtalmiz avatar iamravitejag avatar imdhruvgupta avatar jatinkatyal13 avatar jeetintyagi avatar mansiagarwal451 avatar mukulsaini avatar nikhilhassija avatar nshul avatar paras151 avatar prabalsingh24 avatar prateekiiest avatar prathambatra avatar pulkitmittal19 avatar rahgurung avatar shakeabi avatar thenamankumar avatar v27u27 avatar witty123 avatar yashkumarverma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

boss's Issues

Support error handling in responses

Currently, if some error occurs with the api request, the request waits for timeout to occur, that's not good.

So I propose we should return some error to describe the failure.

add sort by project name (in issue url)

Keeping this open you can add either

  • filter by project
  • a search box where we can search project name

You can make it on frontend as a live filter, or make make the search as a rest query and make the backend send fresh list of claims which fulfill the search param

add login with oneauth support, add roles

  • there should be roles and users
  • users can login via oneauth
  • users with admin role can edit claims. others cannot
  • if github information is available from oneauth, add github username automatically to claim add form

Add a readme on how to set up this project and contribute

While i was trying to resolve an issue, I found that there are no proper Getting Started instructions to begin working on this project.
I had to personally set up the database using PostgreSQL. (There is no mention in the Readme.md of this project like there is in the shortlr project)
I had to hardcode a workaround the required oneauth authorisation because if you attempt to authorise the localhost then callback URL doesn't match
If you are working on issue related to claims, then claims are added wrt the username of the github handle used in oneauth, so basically hardcode that too..

I don't know if there was any other proper method to start on the project. Any suggestions would be helpful for others who want to begin contributing to this project.

Next Button Not disabled

As we browse the leaderboard as the leaderboard ends the next button should be disabled but currently it takes us to a blank page with just the table headers

Last Page:

image

After the last page on clicking on Next(which should have been disabled at end of leaderboard):

image

API throws an error when adding a claim without a PR URL

Claims need to be submitted for only opening issues as well. Since they do not include a PR URL, the application should allow the PR URL field to be left blank.

a) In the case of "/api/claims/add", the server throws an error (shown below)
b) In the case of "/claims/add", the request "freezes up", doesn't add the claim and then cloudflare sends the thing shown below

Request output for a)
image

Request output for b)
image

Proposed solution: Add necessary validation to all the fields and make the PR request field optional.

Apparently, creating too many of these requests on "/claims/add" can be DoS primitive.

stats page

create a page called 'stats' that shows

  • total bounties claimed
  • total bounties accepted
  • total no of claims filed
  • total no of participants (anyone who has 1 claim, irrespective of accepted is participant)

total bounties means sum of bounty points

we are using semantic-ui so read up semantic docs, and make cards for each stat and make a nice UI for the page (not just a boring table ๐Ÿ˜† )

Allow adding a claim even without adding the PR URL

An error is shown when the PR URL is not given and the user tries to submit the claim. If the error has to be shown, then show it dynamically(e.g., Display message like "Field required") i.e., before the user submits the claim.

In reference to issue #49

Filter Claims

We currently just list all the claims. The loggedIn user might be interested in his own claims. There should be an option to filter claims.

  • Show Claims filtered By username
  • Filter Claims by status { Accepted, Rejected , Claimed }

add a script to run migrations

  • migrations are in /db/migrations/<old-version>-to-<new-version>.sql

  • add a script called migratedb (use node itself, or shell - whatever you prefer, do not write in python/ruby or anything that is not required to run the rest of the project)

  • pickup db name user pass etc from secrets.json (example format is secrets-sample.json)

  • running migratedb --from 0.0.1 --to 0.0.3 should run all migrations like 001-to-002 and 002-to-003

  • just running migratedb should open interactive mode. chose which migration to run from a list of migrations.

  • if there are any DELETE/DROP commands in migrations, confirm with Y/N prompt in shell before executing that line

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.