Giter Site home page Giter Site logo

fiqus / coophub Goto Github PK

View Code? Open in Web Editor NEW
58.0 7.0 28.0 1.46 MB

Cooperatives repos over the world! 🌈🌎

Home Page: https://coophub.io

License: MIT License

Elixir 36.37% JavaScript 1.17% HTML 0.74% Makefile 0.30% CSS 48.77% TypeScript 12.46% Shell 0.18%
open-source repositories cooperatives elixir-lang phoenix-framework

coophub's Introduction

Coophub - Cooperatives repos over the world!

🔗 coophub.io

This web app uses the GitHub API and GitLab API to fetch, process and nicely display the projects/repositories of any subscribed cooperative from over the world.

Please note that it's strictly limited to cooperative enterprises.

The main goal is to gather in one place all the open source projects that can be used to start others, to be consumed, to learn or to just motivate collaboration.

Add your cooperative

  1. Fork this repo or edit this file
  2. Add your co-op in the cooperatives.yml file:
key_org_name:
  source: github|gitlab|git.coop
  login: <USERNAME_IN_THE_SOURCE>
  name: <NAME_OF_THE_COOP>
  url: <URL_OF_THE_COOP>
  description: <DESCRIPTION>
  location: <LOCATION>
  1. Add-commit-push and send us a Pull Request!

Changelog

See changelog file.

Development

Use GITHUB_OAUTH_TOKEN ENV var in order to authenticate with the GitHub APIv3. Read the guide.

With docker

If you want to set any environment, like GITHUB_OAUTH_TOKEN, create a .env file with the custom values that you want.

Available environments:

environment Default value
GITHUB_OAUTH_TOKEN
VERSION_ELIXIR 1.14
VERSION_NODE 18

Steps:

  • Clone this repository
  • Run the command docker compose up -d

Local

It uses the Elixir Phoenix Framework for the back-end and ReactJS for the front-end. Then, to run this app you will need:

  • Erlang OTP >= 18
  • Elixir >= 1.5
  • NodeJS >= 5.0

Run it!

  • Install dependencies with mix deps.get
  • Install Node.js dependencies with npm install
  • Start Phoenix server with mix phx.server

Now you can visit localhost:4000 from your browser.

API Endpoints

  • GET api/orgs (all the coops)
  • GET api/orgs/:name (detail of a coop)
  • GET api/orgs/:name/repos (repos of a coop)
  • GET api/repos (all coops repos)
  • GET api/search?q=term_to_search
  • GET api/topics (all the repos topics)
  • GET api/languages (all the programming languages with percentages)
  • GET api/languages/:lang (the repos using the lang)

Allowed query params

  • limit - Number
  • sort - popular or latest (default)
  • exclude_forks - boolean (false default)

Releasing a new version

  1. Update CHANGELOG.md with latest changes.
  2. Go to create a new release and complete the fields:
  • Tag version: vx.x.x (like v0.2.2).
  • Target: Always against master branch.
  • Release title: Same as tag version.
  • Description: Just copy/paste the latest changes from CHANGELOG.md.
  1. Click the Publish release button and check that a new github action was started for this release.
  2. When the github action finishes, a release asset should be attached (like coophub-20200330-034316-0635b9c7.tar.gz).
  3. Done! Just wait a few minutes and the new release will be deployed to https://coophub.io (you can check the version at site footer).

coophub's People

Contributors

ajbuchholz avatar altras avatar areq avatar chriscroome avatar cuococarlos avatar dependabot[bot] avatar diegomanuel avatar egesu avatar franciscocobas avatar gaiacoop avatar hg1g avatar ian-bloom avatar joelbrock avatar jonathanc0101 avatar lucasferraro avatar maianumerosky avatar mjoaaquin avatar mlambir avatar mufniarz avatar nmeyne avatar patcon avatar pbrudnick avatar pehuen-rodriguez avatar philippe-levan avatar sgobotta avatar shonfeder avatar sutty-coop avatar viniciuscb avatar vitormattos avatar zaneselvans 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

coophub's Issues

coophub.io is down?

The server hosting the site appears to be down?

lynx -head -dump  https://coophub.io/

Looking up coophub.io
Making HTTPS connection to coophub.io
Alert!: Unable to connect to remote host.

lynx: Can't access startfile https://coophub.io/
dig coophub.io +short
54.172.94.238
dig -x 54.172.94.238 +short
ec2-54-172-94-238.compute-1.amazonaws.com.
ping 54.172.94.238
PING 54.172.94.238 (54.172.94.238) 56(84) bytes of data.
^C
--- 54.172.94.238 ping statistics ---
88 packets transmitted, 0 received, 100% packet loss, time 89066ms

Add gitlab API

Note that an org could have both github and gitlab.

  • We can specify if the coop user is from github or/and gitlab.
  • When get the repos for the cache get from gitlab api too
  • Show an icon in the repos box in the UI to distinguish between github/gitlab

Repos by lang

Currently we can search by language i.e: /api/search=python but we can improve 2 things:

  • search over main languages (if a repo has a 1% of Python it is currently matching)
  • order the results by popularity.

Improve cachex warmer

The idea is to have the data available as soon as it comes from github API for each org.

Currently, the data is available when ALL the orgs and ALL their repos+languages were fetched.
That process can take a lot when starting the server!

Wrong Languages % in the index chart

There's a bug with the languages percentage for all the orgs (/api/languages):

  1. The calculation is being done with bytes, we should use the sum of org percentages.
    So, it does not affect if there is a repo with a LOT of bytes of one language, instead of the percentage of that language in the org.
  2. The GitLab API retrieves language percentages and not bytes, so the number of bytes couldn't be used to calculate totals anymore.

Proposed solution:

  • Calculate the total of lang % using the aggregation of org lang %.
  • Get rid of bytes where it is not needed.
  • Fix the index chart with the languages accumulating the org percentages (it will be impacted in react models, etc)

Support to declare ignored repos at cooperatives.yml

Cooperatives could decide to not display (ignore) particular repos.
A public repo may receive continuous updates but it's not a relevant repo, and that causes to be listed as latest/popular taking the place for other important repos.

May be good to support regex patterns!

missing endpoints

Endpoints:

  • GET repos/latest
  • GET repos/popular
  • GET orgs
  • GET orgs/:name
  • GET orgs/:name/latest
  • GET orgs/:name/popular

Support GitLab API for self-hosted git hosting

Similarily to #65, me as a user of coophub would like to connect this dashboard to a variety of GitLab communities on different servers, in order to achieve an aggregated higher-level view of the communities I am interacting with.

Support for site subdomains as matching keys for langs

Joining at: https://elixir.coophub.io
Should display results as in: https://coophub.io/languages/elixir

We could even match against topics too or even more, as a search term and simply display its results...
An URL like: https://docker.aws.deploy.coophub.io
Displays the results of: https://coophub.io/search?q=docker+aws+deploy
But that could be too much...! 😄

Just for langs seems to be a good first approach to this feature.
Suggestions welcomed!

Align GitHub's best practices for rate limits

https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits

https://developer.github.com/v3/#abuse-rate-limits

There are 2 points where we need to work:

Make requests for a single user or client ID serially. Do not make requests for a single user or client ID concurrently.

When you have been limited, use the Retry-After response header to slow down. The value of the Retry-After header will always be an integer, representing the number of seconds you should wait before making requests again. For example, Retry-After: 30 means you should wait 30 seconds before sending more requests.

Fix DateTime.from_iso8601/2 on get_repo_popularity/1

[error][2022-11-15 06:47:35.792] Task #PID<0.32181.3> started from #PID<0.32178.3> terminating
** (FunctionClauseError) no function clause matching in Calendar.ISO.parse_utc_datetime/1
(elixir 1.12.3) lib/calendar/iso.ex:510: Calendar.ISO.parse_utc_datetime(nil)
(elixir 1.12.3) lib/calendar/datetime.ex:1073: DateTime.from_iso8601/2
(coophub 0.4.3) lib/coophub/repos.ex:173: Coophub.Repos.get_repo_popularity/1
(coophub 0.4.3) lib/coophub/cache_warmer.ex:231: anonymous fn/1 in Coophub.CacheWarmer.put_popularities/1
(elixir 1.12.3) lib/enum.ex:1582: Enum."-map/2-lists^map/1-0-"/2
(elixir 1.12.3) lib/enum.ex:1582: Enum."-map/2-lists^map/1-0-"/2
(coophub 0.4.3) lib/coophub/cache_warmer.ex:214: Coophub.CacheWarmer.get_org_with_repos/2
(elixir 1.12.3) lib/enum.ex:1582: Enum."-map/2-lists^map/1-0-"/2
Function: #Function<14.67629458/0 in Coophub.CacheWarmer.warm_cache/0>
Args: []

Add last updated date in any place

Add the last updated date of the cache warmer in any place.
This is useful for checking next time the warmer will be run and to inform the visitors the last update of the repos if they see any discrepancy.

Complete tests

After #6 that added tests for API controller, we should complete other tests as well:

  • ReposTest
  • ReposWarmerTest

UI improvements - org page

  • Show main languages (issue #7). Click to see more (all) languages.
  • Show a badge if the org is_verified or not.
  • Sort repos by popularity (as it is now, but horizontal instead of vertical).
  • On loading keep footer at bottom.
  • Show quantity of repos.

Extract github API into its own module and refactor cache warmer to use it

Related to #4, as second step to archieve gitlab support (the first one was the PR #47).

The repos_warmer should be refactored to call behaviourized functions to fetch data from external sources. The first source will be github (and after this, in another issue, the gitlab one).

Each external source module should implement the required functions to fetch the remote data and return structs defined at #47 (Organization and Repository).

UI improvements - home page

  • App logo for home page + favicon.
  • App description for home page.
  • Show how many orgs and repos we have indexed at coophub so far.
    (keep adding)

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.