GitHub API integration with website

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Integrating GitHub API with Website

GitHub API exposes data from public and private repositories: commits, PRs, issues, releases, contributors. Used for developer portfolios, project documentation, displaying status of open-source libraries.

Authentication

import { Octokit } from '@octokit/rest';

const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });

Personal Access Token or GitHub App for higher rate limits (5,000 req/hr vs 60 req/hr for unauthenticated).

Common Scenarios

Displaying Open Source Project Activity:

async function getRepoStats(owner: string, repo: string) {
  const [repoData, contributors, releases] = await Promise.all([
    octokit.repos.get({ owner, repo }),
    octokit.repos.listContributors({ owner, repo, per_page: 10 }),
    octokit.repos.listReleases({ owner, repo, per_page: 5 }),
  ]);

  return {
    stars:        repoData.data.stargazers_count,
    forks:        repoData.data.forks_count,
    openIssues:   repoData.data.open_issues_count,
    contributors: contributors.data.map(c => ({
      login:  c.login,
      avatar: c.avatar_url,
      commits: c.contributions,
    })),
    latestRelease: releases.data[0]?.tag_name,
  };
}

Auto-Updating Changelog from GitHub Releases:

async function getChangelog(owner: string, repo: string): Promise<Release[]> {
  const releases = await octokit.repos.listReleases({ owner, repo, per_page: 20 });
  return releases.data
    .filter(r => !r.prerelease && !r.draft)
    .map(r => ({
      version:     r.tag_name,
      date:        r.published_at!,
      description: r.body ?? '',  // Markdown
      url:         r.html_url,
    }));
}

GitHub Webhooks

Route::post('/webhooks/github', function (Request $request) {
    $signature = $request->header('X-Hub-Signature-256');
    $payload   = $request->getContent();
    $expected  = 'sha256=' . hash_hmac('sha256', $payload, config('services.github.webhook_secret'));

    if (!hash_equals($expected, $signature)) abort(401);

    $event = $request->header('X-GitHub-Event');

    match($event) {
        'push'         => HandleGithubPush::dispatch($request->json()),
        'release'      => UpdateChangelog::dispatch($request->json()),
        'pull_request' => NotifyPRActivity::dispatch($request->json()),
        default        => null,
    };

    return response('ok');
});

Timeline

Displaying repository statistics: 1–2 days. Full integration with webhooks: 3–4 days.