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.
- Python 3.8+
- Django 4.2.15
- GitHub Personal Access Token
-
Clone the repository:
git clone https://github.com/DefinitelyNotAnAssassin/GithubDev.git cd backend -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.envfile in thebackenddirectory and add your GitHub Personal Access Token:GITHUB_TOKEN="your_github_token"
-
Run database migrations:
python manage.py migrate
-
Start the development server:
python manage.py runserver
- URL:
/API/get_repo_info/<username>/ - Method:
GET - Description: Fetches the repositories of a GitHub user.
- URL:
/API/getExtensions/ - Method:
GET - Description: Fetches the default ignore extensions and directories.
- URL:
/API/getLeaderboard/ - Method:
GET - Description: Fetches the leaderboard of users based on lines of code.
- URL:
/API/getLinesOfCode/<username>/ - Method:
GET - Description: Fetches the lines of code for a GitHub user.
- Fields:
username:CharFieldlines_of_code:IntegerFieldlines_of_code_per_language:JSONFieldrepositories:JSONFielddate_requested:DateTimeField
This project is licensed under the MIT License.