/issue-wanted

🏷 Web application to help beginners to start contributing into Haskell projects

Primary LanguageHaskellMozilla Public License 2.0MPL-2.0

Issue Wanted

CircleCI Hackage MPL-2.0 license

issue-wanted is a web application focused on improving the open-source Haskell community by centralizing GitHub issues across many Haskell repositories into a single location. The goals of issue-wanted are to make it easier for programmers of all skill levels to find Haskell projects to contribute to, increase the number of contributions to open-source Haskell projects, and encourage more programmers to become a part of the Haskell community.

Architecture Description

Main work on this project was done during Google Summer of Code 2019. For anyone interested in the details of how issue-wanted was implemented and why certain design choices were made, check out these blog posts:

Backend

Prerequisites (what you need to have locally)

You will need to have the following installed on your system in order to build and test issue-wanted. Click on the links to learn how to install each one:

  1. ghc
  2. cabal or stack
  3. docker
  4. libpq-dev: run the command sudo apt install libpq-dev to install.

With docker installed, open up a terminal (make sure your in the issue-wanted directory) and run the command make postgres. This will setup the database for you and you should be ready to go!

Follow the instructions under How to run server and test the endpoints to see if everything is set up correctly.

Refer to issue #81 if you're still having trouble.

How to build

To build the project, open up a terminal in the base folder and run

stack build

or

cabal v2-build

How to generate Elm types

If any types are changed one should update the generated to Elm types by running:

stack run generate-elm

or

cabal v2-run generate-elm

How to run server

For testing the issue-wanted server follow these steps:

  1. Open up the terminal in the base folder and run stack build
  2. Run the command stack exec issue-wanted

The server will begin running at http://localhost:8080/.

API

Issue-wanted endpoints available:

Endpoint Description
/issues Returns all issues.
/issues/:id Returns a single issue with the corresponding id.
/issues?label=<label name> Returns a list of issues with the corresponding label.

Tip: If you stop running the server and then try to restart it, you may need to run the command fuser -n tcp -k 8080 to free the port.

How to run automatic tests locally

  1. In a separate terminal run make postgres (this command will run database in a Docker container)
  2. In the first terminal run stack test or cabal new-test

How to deploy new Docker image for CI

When stack snapshot is updated, you need to update Dockerfile accordingly and push new docker image to Docker Hub. This can only be done if you have access to the account credentials.

Perform the following commands:

docker build . -t kowainik/haskell-ci
docker push kowainik/haskell-ci

Frontend

Currently, frontend is implemented using Elm.

Prerequisites (what you need to have locally)

How to run

NOTE: All actions should be done in the frontend folder:

cd frontend/

First time

  • Get node modules: npm install
  • Proceed to Subsequent steps

Subsequent

  • in one tab: elm-app start
  • in another tab: npm run-script watch-css

Frontend will begin running at http://localhost:3000/.