Code Monkey home page Code Monkey logo

healthcheck's Introduction

Note

Sponsored by the Open Source project Flagsmith https://github.com/Flagsmith/flagsmith

HealthCheck

RepoRater GitHub code size in bytes GitHub contributors Discord

How friendly is your GitHub Open Source Repo? This project will check to make sure you are using Best Practices to attract more users, contributors and Stars, as well as suggest steps as to how you can improve the Repo to achieve this.

Screenshot of repo checks

Features

  • GitHub OAuth
  • Integration with Flagsmith
  • Add GitHub repo URL
  • List of checks and show detailed report
  • Badges to show latest status in project's README
  • ...

Usage

  1. Login with your GitHub (only public info required)
  2. Add GitHub repo URL
  3. Run HealthCheck against repo and view the report (if you have permissions on the repo, you will see more statistics)
  4. Add a HealthCheck badge to your project

Quickstart guide for local development

Caution

Node v21+ is required

  1. Clone this GitHub Repo

  2. Install the dependencies with npm ci

  3. Copy .env.example to .env (you will need an environment key from Flagsmith, this is shown later on)

  4. Create a free account on Flagsmith https://www.flagsmith.com (you can also sign in with GitHub)

  5. Create an Organisation and Project

  6. Create the Feature Flags with these steps

    a. Create the feature tagline by clicking Create Feature

    Create feature screenshot

    b. Fill in the Feature Flag form with these details and click Create Feature

    Save feature flag screenshot

    c. (OPTIONAL) Import the flags to your Flagsmith account using the file src/config/flagsmith.json (note this will be per environment, for example development)

    Import flags on Flagsmith

  7. Flagsmith keys

    a. Get your environment client-side key from Flagsmith and add to .env file

    How to get environment key

    b. Also create your environment server-side key from Flagsmith and add to .env file

  8. To be able to log in using GitHub OAuth

    a. create a GitHub OAuth app on GitHub https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app

    GitHub OAuth app

    b. In your GitHub OAuth app, GitHub will generate the client id and client secret, add these to your the .env file

  9. Run the project with one of these

    a. If you have Postgres installed, you can run the app locally npm run dev OR

    b. Running with Docker Compose (Recommended if you don't have Postgres installed)

    1. Once you done above steps and have the .env file ready
    2. Run the command docker compose up -d
    3. Once the containers are ready, run the command npm run db:migrate:dev
    4. Visit http://localhost:3000 in your browser

    c. Running in Github Codespaces

    1. Start a new codespace
    2. Run npm ci and npm run dev
    3. When the project is running in the browser visit this and copy the generated URL. You will use this URL in place of localhost in step 8 above for creating your OAuth app
    4. Update the environment file with your client id and secret. Make sure to also update the NEXTAUTH_URL= to the generated codespace URL as well.
    5. Continue with step 9b to run the docker container and database migration.

healthcheck's People

Contributors

eddiejaoude avatar github-actions[bot] avatar pradumnasaraf avatar bashamega avatar dan-mba avatar amandamartin-dev avatar bridgetamana avatar zemerik avatar the-mzakrzewski avatar padamsinha2511 avatar sarajaoude avatar gewenyu99 avatar wotta avatar

Stargazers

Quinn McHugh avatar Stephen Adeniji avatar Liam Jacobs avatar Shubham Samanta avatar Zaheer khan avatar  avatar Shashank avatar René Nielsen avatar Kaan Yagci avatar Sandalots avatar Kevin Krieger avatar Dunsin avatar Emily Marie Ahtúnan avatar Calvin Wilkinson avatar Radosław Kaczmarczyk avatar Gautam Malhotra avatar Whitney Grenaway avatar Varsha U N avatar Vaishnav Jois avatar Dean Lofts avatar Vijay Kv avatar Rupali Haldiya avatar Olabode Lawal-Shittabey avatar Raju kadel avatar Ali avatar  avatar Bob⚡James avatar Francesco Ciulla avatar  avatar Ayush Kumar Shaw avatar  avatar Hubert avatar chief karim avatar Dnyaneshwar Shinde avatar Alena Tikhomirova avatar Kamal Kanti Chakma avatar Guilherme Branco Stracini avatar Mithu Brtamuli avatar  avatar  avatar Rajneesh  avatar Manthan Ankolekar avatar Aniezeofor Chibueze Michael avatar Mangabo  Kolawole avatar Björn Büttner avatar Aayush Rathore avatar Neeraj M R avatar Satyam Pandey avatar  avatar Roxana Muntian avatar  avatar

Watchers

 avatar  avatar

healthcheck's Issues

[FEATURE] Check labels

Description

  • Get existing labels
  • Filter for not default
  • Perform check and result

Screenshots

No response

Additional information

No response

[FEATURE] Customise Badge

Description

Allow user to customise their badge

We use this library https://www.npmjs.com/package/badge-maker which has options to change the style of the badge - these can be passed in via get params on the url

The file that will need updating is src/app/api/badges/report/[id]/route.js

Screenshots

No response

Additional information

I would like to work on this

test

What would you like to share?

test

Additional information

No response

Add repo, allow to keep private

Description

Currently this option to hide the repo is disabled, add functionally to the checkbox

  1. save checkbox
  2. settings page to manage checkbox
  3. public repo list to only show public reports

Screenshots

No response

Additional information

No response

Update the preview image in the site

Description

The preview image on the site is outdated. I think it is better if we can update it.

Screenshots

No response

Additional information

No response

[DOCS] Quickstart guide

Description

Feature list

Screenshot 2024-07-07 at 14 59 32

Create feature flag

Screenshot 2024-07-07 at 14 59 23

Get environment key

Screenshot 2024-07-07 at 15 06 26

Screenshots

No response

Additional information

No response

[DOCS] Node Version

Description

To run the Health Check website, we need ‘v21+‘ of node, or else users will not be able to add their repo on the app. To fix this issue, we can add the version of node required somewhere in the README to avoid confusion.

Screenshots

image

Additional information

No response

Integrate the health check badge

Description

I think we should add the health check badge in the readme.

Screenshots

No response

Additional information

Code for badge in the README

![HealthCheck](https://healthcheck.eddiehubcommunity.org/api/badges/report/clzr3h1ti0000daor5pydhz8y)

It will look like
HealthCheck

[FEATURE] CRUD repo + save GitHub API data

Description

For authenticated users

  • CRUD repo url
  • Get GitHub data
  • Save GitHub data to database
  • Save checks to database
  • Display checks

Screenshots

No response

Additional information

No response

[FEATURE] Adding Docker to the project

Description

Long story short: Dockerize Project :)

Screenshots

No response

Additional information

I can create proper Docker images and Docker compose config.

Recheck is not working

Description

Hello:)

I have tried to recheck my new repo, but it didn't got updated.

Screenshots

No response

Additional information

No response

BUG: Description warning when repo URL is empty

Description

In the "description" check, it checks if the repo url exists in the description, but when the "url" is empty it should not perform this check

This condition should also have the extra condition added repo.homepage.length > 0

if (repo.description.includes(repo.homepage)) {

Making the final line become

- if (repo.description.includes(repo.homepage)) {
+ if (repo.homepage.length > 0 && repo.description.includes(repo.homepage)) {

Screenshots

Screenshot 2024-07-21 at 19 04 09

Additional information

You can visit this page on http://localhost:3000/account/repo/report/{ID}

[FEATURE] Repo rater badge

Description

Add the RepoRater badge to the README

[![RepoRater](https://repo-rater.eddiehub.org/api/badge?owner=EddieHubCommunity&name=HealthCheck)](https://repo-rater.eddiehub.org/rate?owner=EddieHubCommunity&name=HealthCheck)

RepoRater

Screenshots

No response

Additional information

No response

[FEATURE] Commits over time Graph

Description

Hello:)

I think it is a good idea to ad the commits over time, so we can see if they are inactive or active or stable.

Screenshots

image

Additional information

No response

[FEATURE] Deploy project to EddieHub servers

Description

It will be great to deploy the project, so we can start getting user's feedback

This should only be deployed after this issue of limits otherwise we could collect a lot of data #72

Screenshots

No response

Additional information

No response

BUG: Docker compose postgres doesn't run

Description

Using the docker compose command from the README, I get the following error - others are having a similar issue.

Can't reach database server at `localhost:5432`

Screenshots

Screenshot 2024-07-23 at 20 25 14

Additional information

No response

[FEATURE] Limit how many repos + checks can be added per user

Description

The data could get very large, so we need to have a limit of how many repos can be added

  1. display total and remaining (10 repos)
  2. disable add button and server action if limit reached
  3. limit how many checks can be done per repo, display total and remaining (10 checks)
  4. disable the run button and server action if limit reached

Qs.

  1. should the repo have a delete button? this can come later after it is deployed and we have user feedback
  2. should the checks have a delete button or expire after a certain amount of time? same as point 1 above

Screenshots

No response

Additional information

No response

Change in docker compose.yaml file

Description

As there is no bind or docker compose watch present the local developed code does not sync automatically with the container files.

Screenshots

No response

Additional information

No response

[FEATURE] Add a recheck button

Description

Hello:)

I think it is essential to have a recheck button that will re check the repo health.

I think it can be shown only to the owner of the repo( the user which added it).

Screenshots

image

Additional information

No response

[FEATURE] Project check

Description

In the repo json there is the property has_projects, these are the check conditions

  • false: success
  • true: check for project entries
    • if no entries: error
    • if has entries: success

Screenshots

No response

Additional information

No response

[FEATURE] Discussion check

Description

In the repo json there is the property has_discussion, these are the check conditions

  • false: success
  • true: check for discussion entries
    • if no discussions: error
    • if has discussion: success

Screenshots

No response

Additional information

No response

[FEATURE] GitHub API cache move to Flagsmith so can change often

Description

Currently the timeout on GitHub API cache is set with an environment variable, each time we get feedback and want to change it, we need to redeploy the app

Moving this to Flagsmith will allow us to change it frequently and immediately, plus we can have different values for maintainers, admins and certain user(s)

Screenshots

No response

Additional information

Official documentation on server side feature flags
https://docs.flagsmith.com/clients/server-side

[FEATURE] Community checks

Description

In addition to the project's checks, we should include the standard github commuity checks

Screenshots

Screenshot 2024-08-07 at 05 49 34

Additional information

No response

[FEATURE] Toggle checks on/off

Description

Some repos may not want certain checks, for example releases - they should be able to toggle this on/off

  • check list in config
  • settings for repo to toggle individual checks on/off
  • on results page display turned off checks in grey

Screenshots

No response

Additional information

No response

Missing UI margin

Description

I think there should be a margin below the add button.

Add margin top to footer, so every page it has a gap

Screenshots

image

Additional information

No response

Check items do not expand

Description

Each check item in the image below does not give the ability to be expanded for what I assume is more information.
When hovering the mouse over the expand icons all the way to the right of each item, the icon is not clickable and the mouse cursor does not change to signal that it is clickable.

Screenshots

image

Additional information

No response

[FEATURE] Ignore selected checks

Description

Allow the owner of the added repo (not repo owner) to select checks to be ignore

Screenshots

No response

Additional information

No response

The add button is not disabled

Description

Hello:)

I have noticed that without entering anything in the GitHub URL placeholder the button is still clickable. It should first test against a regex to see if there is a valid GitHub URL.

Screenshots

No response

Additional information

If you are stuck and don't know the correct regex this should work:

^https:\/\/github\.com\/[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+$

Navbar not updating the active state on click

Description

In the navbar when navigating to different routes , the active state of the element is not changed . Currently in code aria-current is used . If using that only, we want to update the state, we have to force render the component. Instead we can use useState and update the active state correctly. The problem is shown in the screenshot below.

Screenshots

Screenshot 2024-07-12 225009

Additional information

No response

Playwright tests fail as need default feature flags

Description

When running the automated tests on GitHub Actions, we do not want to load tests Flagsmith's servers, so we will run with default flags

You can run in offline mode, local evaluation mode or just use defaults

Discussion from the Flagsmith Discord server.

Note

Playwright GitHub Action will fail until this is fixed

What I am trying to use

await flagsmith.init({
environmentID: process.env.NEXT_PUBLIC_FLAGSMITH_ENVIRONMENT_ID,
defaultFlags: defaults,
});

Here are the official docs
https://docs.flagsmith.com/clients/javascript#providing-default-flags

Screenshots

No response

Additional information

No response

[OTHER] Prettier Integration

What would you like to share?

Hello:)

I have noticed that this repo is missing prettier. I think formatted code can help people read the code.

Additional information

I would like to work on this

[FEATURE] Wiki check

Description

In the repo json there is the property has_wiki, these are the check conditions

  • false: success
  • true: check for wiki pages
    • if no pages: error
    • if has pages: success

Screenshots

No response

Additional information

No response

[FEATURE] Add a copy button.

Description

Hello:)
I think it is a good idea to add a copy badge icon.

Screenshots

image

Additional information

I would like to work on this

[FEATURE] Sponsored Banner

Description

Our project is sponsored by Flagsmith, we should add this to a banner at the top of every page.

The content should be managed by Flagsmith, we will need 3 feature flags for the data

  • banner_description
  • banner_button_text
  • banner_button_url

Screenshots

Screenshot 2024-07-09 at 08 28 39

Additional information

Example code

import { XMarkIcon } from '@heroicons/react/20/solid'

export default function Example() {
  return (
    <div className="relative isolate flex items-center gap-x-6 overflow-hidden bg-gray-50 px-6 py-2.5 sm:px-3.5 sm:before:flex-1">
      <div
        aria-hidden="true"
        className="absolute left-[max(-7rem,calc(50%-52rem))] top-1/2 -z-10 -translate-y-1/2 transform-gpu blur-2xl"
      >
        <div
          style={{
            clipPath:
              'polygon(74.8% 41.9%, 97.2% 73.2%, 100% 34.9%, 92.5% 0.4%, 87.5% 0%, 75% 28.6%, 58.5% 54.6%, 50.1% 56.8%, 46.9% 44%, 48.3% 17.4%, 24.7% 53.9%, 0% 27.9%, 11.9% 74.2%, 24.9% 54.1%, 68.6% 100%, 74.8% 41.9%)',
          }}
          className="aspect-[577/310] w-[36.0625rem] bg-gradient-to-r from-[#ff80b5] to-[#9089fc] opacity-30"
        />
      </div>
      <div
        aria-hidden="true"
        className="absolute left-[max(45rem,calc(50%+8rem))] top-1/2 -z-10 -translate-y-1/2 transform-gpu blur-2xl"
      >
        <div
          style={{
            clipPath:
              'polygon(74.8% 41.9%, 97.2% 73.2%, 100% 34.9%, 92.5% 0.4%, 87.5% 0%, 75% 28.6%, 58.5% 54.6%, 50.1% 56.8%, 46.9% 44%, 48.3% 17.4%, 24.7% 53.9%, 0% 27.9%, 11.9% 74.2%, 24.9% 54.1%, 68.6% 100%, 74.8% 41.9%)',
          }}
          className="aspect-[577/310] w-[36.0625rem] bg-gradient-to-r from-[#ff80b5] to-[#9089fc] opacity-30"
        />
      </div>
      <div className="flex flex-wrap items-center gap-x-4 gap-y-2">
        <p className="text-sm leading-6 text-gray-900">
          <strong className="font-semibold">GeneriCon 2023</strong>
          <svg viewBox="0 0 2 2" aria-hidden="true" className="mx-2 inline h-0.5 w-0.5 fill-current">
            <circle r={1} cx={1} cy={1} />
          </svg>
          Join us in Denver from June 7 – 9 to see what’s coming next.
        </p>
        <a
          href="#"
          className="flex-none rounded-full bg-gray-900 px-3.5 py-1 text-sm font-semibold text-white shadow-sm hover:bg-gray-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-900"
        >
          Register now <span aria-hidden="true">&rarr;</span>
        </a>
      </div>
      <div className="flex flex-1 justify-end">
        <button type="button" className="-m-3 p-3 focus-visible:outline-offset-[-4px]">
          <span className="sr-only">Dismiss</span>
          <XMarkIcon aria-hidden="true" className="h-5 w-5 text-gray-900" />
        </button>
      </div>
    </div>
  )
}

https://tailwindui.com/components/marketing/elements/banners#component-8904b9d9a9fbb9a2313df3975112f9d7

Hide check count with eye icon is confusing

Description

The eye icon number shows the hidden checks, but it is confused with the watch count on the repo

Screenshots

Health check:
image

GitHub:
image

Additional information

No response

[FEATURE] Authentication

Description

  • Log in to the app with GitHub OAuth
  • Use Next-Auth
  • Prisma + migrations

Screenshots

No response

Additional information

No response

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.