Skip to content

Repository files navigation

GithubDev

A project inspired by ghloc.

This project aims to count all the lines of code in the repositories of a GitHub profile. It provides customization options to ignore specific directories and file extensions during the analysis. This allows users to get accurate statistics based on their preferences.

Setup

Prerequisites

  • Python 3.8+
  • Django 4.2.15
  • GitHub Personal Access Token

Installation

  1. Clone the repository:

    git clone https://github.com/DefinitelyNotAnAssassin/GithubDev.git
    cd backend
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Set up environment variables:

    Create a .env file in the backend directory and add your GitHub Personal Access Token:

    GITHUB_TOKEN="your_github_token"
  5. Run database migrations:

    python manage.py migrate
  6. Start the development server:

    python manage.py runserver

API Endpoints

Get Repositories

  • URL: /API/get_repo_info/<username>/
  • Method: GET
  • Description: Fetches the repositories of a GitHub user.

Get Extensions

  • URL: /API/getExtensions/
  • Method: GET
  • Description: Fetches the default ignore extensions and directories.

Get Leaderboard

  • URL: /API/getLeaderboard/
  • Method: GET
  • Description: Fetches the leaderboard of users based on lines of code.

Get Lines of Code

  • URL: /API/getLinesOfCode/<username>/
  • Method: GET
  • Description: Fetches the lines of code for a GitHub user.

Models

UserRecord

  • Fields:
    • username: CharField
    • lines_of_code: IntegerField
    • lines_of_code_per_language: JSONField
    • repositories: JSONField
    • date_requested: DateTimeField

License

This project is licensed under the MIT License.

About

A lines of code counter for a github profile

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages