/github-monitor

A tool that monitors your git hub

Primary LanguageHTML

github-monitor

Description

[Note] A GitHub's public APIs that retrieve repository information and commits, save the data in a persistent store (am using Postgres), and continuously monitor the repository for changes (am using Cronjob).

Installation

$ yarn install

Running the app

# development
$ yarn dev 

# production mode
$ yarn start

Test

# unit tests
$ yarn test

Endpoints

BaseURl

http://localhost:9100/api/v1

GET /repo/fresh/{owner}/{repo} (Fetches repo and its commits from Git hub database)

Request

name status type description
owner required parameter (String) Owner of the repo
repo required parameter (String) Name of the repo
page Optional query string (String) Page to start paginating in the commits
date Optional query string (String) the date to start fetching the commits
Responses
http code content-type response
201 text/plain;charset=UTF-8 successfully
500 application/json {"code":"500","message":"Bad Request"}
Example cURL
 curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:9100/api/v1/repo/fresh/chubukas/pageme
GET /repo/stored/{name} (Fetch stored repo from database)

Request

name status type description
name required parameter (String) Name of the repo
page Optional query string (String) Page to start paginating in the commits
date Optional query string (String) the date to start fetching the commits
Responses
http code content-type response
302 text/plain;charset=UTF-8 successfully
500 application/json {"code":"500","message":"Bad Request"}
Example cURL
 curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:9100/api/v1/repo/stored/pageme
GET /commit/repo/{repoName} (Fetch commits from a particular repo from database)

Request

name status type description
repoName required parameter (String) Name of the repo
page Optional query string (String) Page to start paginating in the commits
date Optional query string (String) the date to start fetching the commits
Responses
http code content-type response
302 text/plain;charset=UTF-8 successfully
500 application/json {"code":"500","message":"Bad Request"}
Example cURL
 curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:9100/api/v1/commit/repo/pageme
GET /commit/top-authors (Fetch top authors from all commits in database)

Request

name status type description
page Optional query string (String) Page to start paginating in the commits
date Optional query string (String) the date to start fetching the commits
Responses
http code content-type response
302 text/plain;charset=UTF-8 successfully
500 application/json {"code":"500","message":"Bad Request"}
Example cURL
 curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:9100/api/v1/commit/top-authors
GET /commit/repo-top-authors/{repoName} (Fetch top authors from commits from a particular repo in the database)

Request

name status type description
repoName required parameter (String) Name of the repo
page Optional query string (String) Page to start paginating in the commits
date Optional query string (String) the date to start fetching the commits
Responses
http code content-type response
302 text/plain;charset=UTF-8 successfully
500 application/json {"code":"500","message":"Bad Request"}
Example cURL
 curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:9100/api/v1/commit/repo-top-authors/pageme

Stay in touch

Contact and Support

If you have any questions or need assistance, please reach out to our support team:

License

ExpressJS is MIT licensed.