diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..bfb97d3f --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,24 @@ +# Code of Conduct + +Diversity is one of our huge strengths, but it can also lead to communication issues and unhappiness. To that end, we have a few ground rules that we ask people to adhere to. This code applies equally to founders, contributors and those seeking help and guidance. + +This isn’t an exhaustive list of things that you can’t do. Rather, take it in the spirit in which it’s intended - a guide to make it easier to enrich all of us and the technical communities in which we participate. + +If you believe someone is violating the code of conduct, we ask that you report it by emailing github.stats.extended@gmail.com. + +- **Be friendly and patient.** +- **Be welcoming.** We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability. +- **Be considerate.** Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language. +- **Be respectful.** Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one. Members of the community should be respectful when dealing with others. +- **Be careful in the words that you choose.** We are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren't acceptable. This includes, but is not limited to: + - Violent threats or language directed against another person. + - Discriminatory jokes and language. + - Posting sexually explicit or violent material. + - Posting (or threatening to post) other people's personally identifying information ("doxing"). + - Personal insults, especially those using racist or sexist terms. + - Unwelcome sexual attention. + - Advocating for, or encouraging, any of the above behavior. + - Repeated harassment of others. In general, if someone asks you to stop, then stop. +- **When we disagree, try to understand why.** Disagreements, both social and technical, happen all the time. It is important that we resolve disagreements and differing views constructively. Remember that we’re different. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes. + +Based on the [Django Code of Conduct](https://www.djangoproject.com/conduct/). \ No newline at end of file diff --git a/backend/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 97% rename from backend/CONTRIBUTING.md rename to .github/CONTRIBUTING.md index 604e7b87..8b44fff6 100644 --- a/backend/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing to [GitHub Stats Extended](https://github.com/martin-mfg/github-readme-stats) +# Contributing to GitHub Stats Extended ## Local Development diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 00000000..e9204546 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,3 @@ +# Security Policy + +Please report any security vulnerabilities to github.stats.extended@gmail.com. I will try to respond as quickly as possible, but since I am maintaining this project in my free time, please allow some time for a response. \ No newline at end of file diff --git a/frontend/LICENSE b/LICENSE similarity index 94% rename from frontend/LICENSE rename to LICENSE index 15500cbf..97688dbd 100644 --- a/frontend/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Abhijit Gupta +Copyright (c) 2020 Anurag Hazra, Abhijit Gupta, martin-mfg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/backend/readme.md b/README.md similarity index 62% rename from backend/readme.md rename to README.md index c998308f..32a47282 100644 --- a/backend/readme.md +++ b/README.md @@ -1,23 +1,31 @@
GitHub Readme Stats -

GitHub Stats Extended

+

GitHub Stats Extended

Dynamically generate GitHub stats for your READMEs.

-
-This project is an [extended version](docs/fork.md) of [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). It generates various stats cards, e.g. about your GitHub contributions, your top languages, etc. You can customize the cards via multiple parameters. + +This project is an [extended version](docs/fork.md) of [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). It generates [various stats cards](#card-types), e.g. about your GitHub contributions, your top languages, etc. You can [customize](#advanced-customization) the cards via multiple parameters. # Table of Contents -- Quick Start -- Card Types -- Advanced Customization -- Self-Hosting -- Acknowledgement -- Contributing -- Features +- [Quick Start](quick-start) +- [Card Types](#card-types) +- [Advanced Customization](#advanced-customization) +- [Self-Hosting](#self-hosting) +- [Acknowledgements](#acknowledgements) +- [Contributing](#contributing) # Quick Start -Use the [GitHub-Stats-Extended Wizard](https://monorepo-test-backend-seven.vercel.app/frontend) to create your custom stats card. Copy the generated markdown code and paste it into your [GitHub profile README](https://docs.github.com/en/account-and-profile/how-tos/profile-customization/managing-your-profile-readme#adding-a-profile-readme). Done! +- Copy and paste this into your markdown: + ```markdown + [![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats) + ``` +- Change the `?username=` value to your GitHub username. +- Done! + +----------------------- + +As more comfortable alternative, use the [GitHub-Stats-Extended Wizard](https://monorepo-test-backend-seven.vercel.app/frontend) to create your custom stats card. Copy the generated markdown code and paste it into your [GitHub profile README](https://docs.github.com/en/account-and-profile/how-tos/profile-customization/managing-your-profile-readme#adding-a-profile-readme). Done! # Card Types - Show your GitHub statistics: @@ -47,8 +55,8 @@ Use the [GitHub-Stats-Extended Wizard](https://monorepo-test-backend-seven.verce # Advanced Customization The [GitHub-Stats-Extended Wizard](https://monorepo-test-backend-seven.vercel.app/frontend) offers some essential customization options. For more advanced customization check out the [advanced documentation](docs/advanced_documentation.md). -# Acknowledgement -This project is based on [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). On top of their functionality, I added several new features and improvements. See [TBD](docs/fork.md) for a full list of changes. The frontend I added to the project is based on [GitHub Trends](https://github.com/avgupta456/github-trends). Big thanks to @anuraghazra, @avgupta456, @rickstaa, @qwerty541 and everyone else who worked on these projects! ❤️ +# Acknowledgements +This project is based on [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). On top of their functionality I added several new features and improvements. See [Fork Information](docs/fork.md) for a list of changes. The frontend I added to the project is based on [GitHub Trends](https://github.com/avgupta456/github-trends). Big thanks to @anuraghazra, @avgupta456, @rickstaa, @qwerty541 and everyone else who worked on these projects! ❤️ # Self-Hosting Since the GitHub API only allows a limited number of requests per hour, my public instance of GitHub-Stats-Extended could possibly hit the rate limiter. If you host your own instance you do not have to worry about anything. Also, if you don't want to give my GitHub-Stats-Extended instance access to your private contributions but still want to include these contributions in your stats, you can simply host your own instance. diff --git a/backend/CODE_OF_CONDUCT.md b/backend/CODE_OF_CONDUCT.md deleted file mode 100644 index 1afc2ecb..00000000 --- a/backend/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,76 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at hazru.anurag@gmail.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq diff --git a/backend/LICENSE b/backend/LICENSE deleted file mode 100644 index 9d09f475..00000000 --- a/backend/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Anurag Hazra, martin-mfg - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/backend/SECURITY.md b/backend/SECURITY.md deleted file mode 100644 index 9fb7339a..00000000 --- a/backend/SECURITY.md +++ /dev/null @@ -1,39 +0,0 @@ -# GitHub Readme Stats Security Policies and Procedures - -This document outlines security procedures and general policies for the -GitHub Readme Stats project. - -- [Reporting a Vulnerability](#reporting-a-vulnerability) -- [Disclosure Policy](#disclosure-policy) - -## Reporting a Vulnerability - -The GitHub Readme Stats team and community take all security vulnerabilities -seriously. Thank you for improving the security of our open source -software. We appreciate your efforts and responsible disclosure and will -make every effort to acknowledge your contributions. - -Report security vulnerabilities by emailing the GitHub Readme Stats team at: - -``` -hazru.anurag@gmail.com -``` - -The lead maintainer will acknowledge your email within 24 hours, and will -send a more detailed response within 48 hours indicating the next steps in -handling your report. After the initial reply to your report, the security -team will endeavor to keep you informed of the progress towards a fix and -full announcement, and may ask for additional information or guidance. - -Report security vulnerabilities in third-party modules to the person or -team maintaining the module. - -## Disclosure Policy - -When the security team receives a security bug report, they will assign it -to a primary handler. This person will coordinate the fix and release -process, involving the following steps: - - * Confirm the problem. - * Audit code to find any potential similar problems. - * Prepare fixes and release them as fast as possible. diff --git a/docs/advanced_documentation.md b/docs/advanced_documentation.md new file mode 100644 index 00000000..bcb16f43 --- /dev/null +++ b/docs/advanced_documentation.md @@ -0,0 +1,720 @@ +# Table of Contents +- [GitHub Stats Card](#github-stats-card) +- [GitHub Extra Pins](#github-extra-pins) +- [GitHub Gist Pins](#github-gist-pins) +- [Top Languages Card](#top-languages-card) +- [WakaTime Stats Card](#wakatime-stats-card) +- [All Demos](#all-demos) + +# GitHub Stats Card + +> [!WARNING] +> By default, the stats card only shows statistics like stars, commits, and pull requests from public repositories. To show private statistics on the stats card, you should [deploy your own instance](#deploy-on-your-own) using your own GitHub API token. + +> [!NOTE] +> Available ranks are S (top 1%), A+ (12.5%), A (25%), A- (37.5%), B+ (50%), B (62.5%), B- (75%), C+ (87.5%) and C (everyone). This ranking scheme is based on the [Japanese academic grading](https://wikipedia.org/wiki/Academic_grading_in_Japan) system. The global percentile is calculated as a weighted sum of percentiles for each statistic (number of commits, pull requests, reviews, issues, stars, and followers), based on the cumulative distribution function of the [exponential](https://wikipedia.org/wiki/exponential_distribution) and the [log-normal](https://wikipedia.org/wiki/Log-normal_distribution) distributions. The implementation can be investigated at [src/calculateRank.js](https://github.com/anuraghazra/github-readme-stats/blob/master/src/calculateRank.js). The circle around the rank shows 100 minus the global percentile. + +### Hiding individual stats + +You can pass a query parameter `&hide=` to hide any specific stats with comma-separated values. + +> Options: `&hide=stars,commits,prs,issues,contribs` + +```md +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra&hide=contribs,prs) +``` + +### Showing additional individual stats + +You can pass a query parameter `&show=` to show any specific additional stats with comma-separated values. + +> Options: `&show=reviews,discussions_started,discussions_answered,prs_merged,prs_merged_percentage,prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented` + +```md +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra&show=reviews,discussions_started,discussions_answered,prs_merged,prs_merged_percentage,prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented) +``` + +### Showing icons + +To enable icons, you can pass `&show_icons=true` in the query param, like so: + +```md +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra&show_icons=true) +``` + +### Filtering by repository and owner + +To compute your stats for only a specific repository, you can pass a query parameter `&repo=/`. You can also specify a comma-separated list of multiple repositories, e.g. `&repo=userA/repositoryA,organizationB/repositoryB`. And you can select all repositories owned by specific organizations or users by providing a comma-separated list of owners via the `owner` query parameter, e.g. `&owner=userA,organizationB,organizationC`. The `repo` and `owner` filters are supported by the following items: `commits` (when used with `&include_all_commits=true`), `prs_authored`, `prs_commented`, `prs_reviewed`, `issues_authored` and `issues_commented`. Note that most of these items are not displayed by default, but [you can enable them individually](#showing-additional-individual-stats). + +(Some of these mentioned items are similar to other items which are included by default, e.g. `issues_authored` is similar to `issues`. The difference is how these values are fetched - [via GraphQL or via REST API](https://github.com/anuraghazra/github-readme-stats/discussions/1770#number-of-commits-is-incorrect). The default items use GraphQL, but filtering by repository works better via REST API.) + +Alternatively, you can use the `role` parameter to specify a comma-separated list of [roles](https://docs.github.com/en/graphql/reference/enums#repositoryaffiliation). The stats will include all repositories in which the user has the specified role. By default, only repositories where the user is OWNER will be included, but you could e.g. set `&role=OWNER,ORGANIZATION_MEMBER,COLLABORATOR`. The `role` parameter is supported by all items except the following: `commits` (when used with `&include_all_commits=true`), `prs_authored`, `prs_commented`, `prs_reviewed`, `issues_authored` and `issues_commented`. +### Showing commits count for specified year + +You can specify a year and fetch only the commits that were made in that year by passing `&commits_year=YYYY` to the parameter. + +```md +![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&commits_year=2020) +``` + +### Themes + +With inbuilt themes, you can customize the look of the card without doing any [manual customization](#customization). + +Use `&theme=THEME_NAME` parameter like so : + +```md +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra&show_icons=true&theme=radical) +``` + +#### All inbuilt themes + +GitHub Readme Stats comes with several built-in themes (e.g. `dark`, `radical`, `merko`, `gruvbox`, `tokyonight`, `onedark`, `cobalt`, `synthwave`, `highcontrast`, `dracula`). + +GitHub Readme Stats Themes + +You can look at a preview for [all available themes](../backend/themes/README.md) or checkout the [theme config file](../backend/themes/index.js). Please note that we paused the addition of new themes to decrease maintenance efforts; all pull requests related to new themes will be closed. + +#### Responsive Card Theme + +[![Anurag's GitHub stats-Dark](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&show_icons=true\&theme=dark#gh-dark-mode-only)](https://github.com/anuraghazra/github-readme-stats#responsive-card-theme#gh-dark-mode-only) +[![Anurag's GitHub stats-Light](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&show_icons=true\&theme=default#gh-light-mode-only)](https://github.com/anuraghazra/github-readme-stats#responsive-card-theme#gh-light-mode-only) + +Since GitHub will re-upload the cards and serve them from their [CDN](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls), we can not infer the browser/GitHub theme on the server side. There are, however, four methods you can use to create dynamics themes on the client side. + +##### Use the transparent theme + +We have included a `transparent` theme that has a transparent background. This theme is optimized to look good on GitHub's dark and light default themes. You can enable this theme using the `&theme=transparent` parameter like so: + +```md +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra&show_icons=true&theme=transparent) +``` + +
+:eyes: Show example + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&show_icons=true\&theme=transparent) + +
+ +##### Add transparent alpha channel to a themes bg\_color + +You can use the `bg_color` parameter to make any of [the available themes](themes/README.md) transparent. This is done by setting the `bg_color` to a color with a transparent alpha channel (i.e. `bg_color=00000000`): + +```md +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra&show_icons=true&bg_color=00000000) +``` + +
+:eyes: Show example + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&show_icons=true\&bg_color=00000000) + +
+ +##### Use GitHub's theme context tag + +You can use [GitHub's theme context](https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/) tags to switch the theme based on the user GitHub theme automatically. This is done by appending `#gh-dark-mode-only` or `#gh-light-mode-only` to the end of an image URL. This tag will define whether the image specified in the markdown is only shown to viewers using a light or a dark GitHub theme: + +```md +[![Anurag's GitHub stats-Dark](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only) +[![Anurag's GitHub stats-Light](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra&show_icons=true&theme=default#gh-light-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-light-mode-only) +``` + +
+:eyes: Show example + +[![Anurag's GitHub stats-Dark](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&show_icons=true\&theme=dark#gh-dark-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only) +[![Anurag's GitHub stats-Light](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&show_icons=true\&theme=default#gh-light-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-light-mode-only) + +
+ +##### Use GitHub's new media feature + +You can use [GitHub's new media feature](https://github.blog/changelog/2022-05-19-specify-theme-context-for-images-in-markdown-beta/) in HTML to specify whether to display images for light or dark themes. This is done using the HTML `` element in combination with the `prefers-color-scheme` media feature. + +```html + + + + + +``` + +
+:eyes: Show example + + + + + + + +
+ +### Customization + +You can customize the appearance of all your cards however you wish with URL parameters. + +#### Common Options + +| Name | Description | Type | Default value | +| --- | --- | --- | --- | +| `title_color` | Card's title color. | string (hex color) | `2f80ed` | +| `text_color` | Body text color. | string (hex color) | `434d58` | +| `icon_color` | Icons color if available. | string (hex color) | `4c71f2` | +| `border_color` | Card's border color. Does not apply when `hide_border` is enabled. | string (hex color) | `e4e2e2` | +| `bg_color` | Card's background color. | string (hex color or a gradient in the form of *angle,start,end*) | `fffefe` | +| `hide_border` | Hides the card's border. | boolean | `false` | +| `theme` | Name of the theme, choose from [all available themes](themes/README.md). | enum | `default` | +| `cache_seconds` | Sets the cache header manually (min: 21600, max: 86400). | integer | `21600` | +| `locale` | Sets the language in the card, you can check full list of available locales [here](#available-locales). | enum | `en` | +| `border_radius` | Corner rounding on the card. | number | `4.5` | + +> [!WARNING] +> We use caching to decrease the load on our servers (see ). Our cards have the following default cache hours: stats card - 24 hours, top languages card - 144 hours (6 days), pin card - 240 hours (10 days), gist card - 48 hours (2 days), and wakatime card - 24 hours. If you want the data on your cards to be updated more often you can [deploy your own instance](deploy.md) and set [environment variable](deploy.md#available-environment-variables) `CACHE_SECONDS` to a value of your choosing. + +##### Gradient in bg\_color + +You can provide multiple comma-separated values in the bg\_color option to render a gradient with the following format: + + &bg_color=DEG,COLOR1,COLOR2,COLOR3...COLOR10 + +##### Available locales + +Here is a list of all available locales: + + + +
+ +| Code | Locale | +| --- | --- | +| `ar` | Arabic | +| `az` | Azerbaijani | +| `bn` | Bengali | +| `bg` | Bulgarian | +| `my` | Burmese | +| `ca` | Catalan | +| `cn` | Chinese | +| `zh-tw` | Chinese (Taiwan) | +| `cs` | Czech | +| `nl` | Dutch | +| `en` | English | +| `fil` | Filipino | +| `fi` | Finnish | +| `fr` | French | +| `de` | German | +| `el` | Greek | + + + +| Code | Locale | +| --- | --- | +| `he` | Hebrew | +| `hi` | Hindi | +| `hu` | Hungarian | +| `id` | Indonesian | +| `it` | Italian | +| `ja` | Japanese | +| `kr` | Korean | +| `ml` | Malayalam | +| `np` | Nepali | +| `no` | Norwegian | +| `fa` | Persian (Farsi) | +| `pl` | Polish | +| `pt-br` | Portuguese (Brazil) | +| `pt-pt` | Portuguese (Portugal) | +| `ro` | Romanian | + + + +| Code | Locale | +| --- | --- | +| `ru` | Russian | +| `sa` | Sanskrit | +| `sr` | Serbian (Cyrillic) | +| `sr-latn` | Serbian (Latin) | +| `sk` | Slovak | +| `es` | Spanish | +| `sw` | Swahili | +| `se` | Swedish | +| `ta` | Tamil | +| `th` | Thai | +| `tr` | Turkish | +| `uk-ua` | Ukrainian | +| `ur` | Urdu | +| `uz` | Uzbek | +| `vi` | Vietnamese | + +
+ +If we don't support your language, please consider contributing! You can find more information about how to do it in our [contributing guidelines](CONTRIBUTING.md#translations-contribution). + +#### Stats Card Exclusive Options + +| Name | Description | Type | Default value | +| --- | --- | --- | --- | +| `hide` | Hides the [specified items](#hiding-individual-stats) from stats. | string (comma-separated values) | `null` | +| `hide_title` | Hides the title of your stats card. | boolean | `false` | +| `card_width` | Sets the card's width manually. | number | `500px (approx.)` | +| `hide_rank` | Hides the rank and automatically resizes the card width. | boolean | `false` | +| `rank_icon` | Shows alternative rank icon (i.e. `github`, `percentile` or `default`). | enum | `default` | +| `show_icons` | Shows icons near all stats. | boolean | `false` | +| `include_all_commits` | Count total commits instead of just the current year commits. | boolean | `false` | +| `line_height` | Sets the line height between text. | integer | `25` | +| `exclude_repo` | Excludes specified repositories. Affects only the count for "Total Stars Earned". | string (comma-separated values) | `null` | +| `repo` | Count only stats from the specified repositories. Affects only [certain items](#filtering-by-repository-and-owner). | string (comma-separated values) | `null` | +| `owner` | Count only stats from the specified organizations or users. Affects only [certain items](#filtering-by-repository-and-owner). | string (comma-separated values) | `null` | +| `role` | Include repositories where the user has one of the specified [roles](https://docs.github.com/en/graphql/reference/enums#repositoryaffiliation) (OWNER, ORGANIZATION_MEMBER, COLLABORATOR). | string (comma-separated values) | `OWNER` | +| `custom_title` | Sets a custom title for the card. | string | ` GitHub Stats` | +| `text_bold` | Uses bold text. | boolean | `true` | +| `disable_animations` | Disables all animations in the card. | boolean | `false` | +| `ring_color` | Color of the rank circle. | string (hex color) | `2f80ed` | +| `number_format` | Switches between two available formats for displaying the card values: `short` (i.e. `6.6k`) and `long` (i.e. `6626`). | enum | `short` | +| `number_precision` | Enforce the number of digits after the decimal point for `short` number format. Must be an integer between 0 and 2. Will be ignored for `long` number format. | integer (0, 1 or 2) | `null` | +| `show` | Shows [additional items](#showing-additional-individual-stats) on stats card (i.e. `reviews`, `discussions_started`, `discussions_answered`, `prs_merged` or `prs_merged_percentage`. And the following, which support the `repo` and `owner` filters: `prs_authored`, `prs_commented`, `prs_reviewed`, `issues_authored` or `issues_commented`). | string (comma-separated values) | `null` | +| `commits_year` | Filters and counts only commits made in the specified year. | integer _(YYYY)_ | ` (one year to date)` | + +> [!WARNING] +> Custom title should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding) (i.e: `Anurag's GitHub Stats` should become `Anurag%27s%20GitHub%20Stats`). You can use [urlencoder.org](https://www.urlencoder.org/) to help you do this automatically. + +> [!NOTE] +> When hide\_rank=`true`, the minimum card width is 270 px + the title length and padding. + +*** + +# GitHub Extra Pins + +GitHub extra pins allow you to pin more than 6 repositories in your profile using a GitHub profile readme. + +Yay! You are no longer limited to 6 pinned repositories. + +### Usage + +Copy-paste this code into your readme and change the links. + +Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats` + +```md +[![Readme Card](https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats) +``` + +### Options + +You can customize the appearance and behavior of the pinned repository card using the [common options](#common-options) and exclusive options listed in the table below. + +| Name | Description | Type | Default value | +| --- | --- | --- | --- | +| `show_owner` | Shows the repo's owner name. | boolean | `false` | +| `description_lines_count` | Manually set the number of lines for the description. Specified value will be clamped between 1 and 3. If this parameter is not specified, the number of lines will be automatically adjusted according to the actual length of the description. | number | `null` | +| `card_width` | Sets the card's width manually. | number | `400px (approx.)` | +| `show_icons` | Shows icons near all stats enabled via `show`. | boolean | `true` | +| `line_height` | Sets the line height between stats enabled via `show`. | integer | `22` | +| `text_bold` | Uses bold text for all stats enabled via `show`. | boolean | `false` | +| `number_format` | Switches between two available formats for displaying the numbers for all stats enabled via `show`: `short` (i.e. `6.6k`) and `long` (i.e. `6626`). | enum | `short` | +| `show` | Shows [additional items](#showing-additional-individual-stats) on stats card (i.e. `prs_authored`, `prs_commented`, `prs_reviewed`, `issues_authored` or `issues_commented`). | string (comma-separated values) | `null` | + +### Demo + +![Readme Card](https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra\&repo=github-readme-stats) + +Use [show\_owner](#options) query option to include the repo's owner username: + +![Readme Card](https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra\&repo=github-readme-stats\&show_owner=true) + +Use [show](#options) query option to display the user's contributions to the repository: + +![Readme Card](https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra\&repo=github-readme-stats\&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented) + +You can also specify the `repo` parameter in the form `/` to pin a repository from any user or organization, not just your own. This allows you to showcase repositories you contributed to, regardless of ownership. + +![Readme Card](https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra\&repo=statykjs/statyk\&show_owner=true\&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented) + +# GitHub Gist Pins + +GitHub gist pins allow you to pin gists in your GitHub profile using a GitHub profile readme. + +### Usage + +Copy-paste this code into your readme and change the links. + +Endpoint: `api/gist?id=bbfce31e0217a3689c8d961a356cb10d` + +```md +[![Gist Card](https://github-readme-stats-phi-jet-58.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d)](https://gist.github.com/Yizack/bbfce31e0217a3689c8d961a356cb10d/) +``` + +### Options + +You can customize the appearance and behavior of the gist card using the [common options](#common-options) and exclusive options listed in the table below. + +| Name | Description | Type | Default value | +| --- | --- | --- | --- | +| `show_owner` | Shows the gist's owner name. | boolean | `false` | + +### Demo + +![Gist Card](https://github-readme-stats-phi-jet-58.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d) + +Use [show\_owner](#options-1) query option to include the gist's owner username + +![Gist Card](https://github-readme-stats-phi-jet-58.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d\&show_owner=true) + +# Top Languages Card + +The top languages card shows your most frequently used languages. + +> [!WARNING] +> By default, the language card shows language results only from public repositories. To include languages used in private repositories, you should [deploy your own instance](#deploy-on-your-own) using your own GitHub API token. + +> [!WARNING] +> This card shows language usage only inside your own non-forked repositories, not depending on who the author of the commits is. It does not include your contributions into another users/organizations repositories. Currently there are no way to get this data from GitHub API. If you want this behavior to be improved you can support [this feature request](https://github.com/orgs/community/discussions/18230) created by [@rickstaa](https://github.com/rickstaa) inside GitHub Community. + +> [!WARNING] +> Currently this card shows data only about first 100 repositories. This is because GitHub API limitations which cause downtimes of public instances (see [#1471](https://github.com/anuraghazra/github-readme-stats/issues/1471)). In future this behavior will be improved by releasing GitHub action or providing environment variables for user's own instances. + +### Usage + +Copy-paste this code into your readme and change the links. + +Endpoint: `api/top-langs?username=anuraghazra` + +```md +[![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats) +``` + +### Options + +You can customize the appearance and behavior of the top languages card using the [common options](#common-options) and exclusive options listed in the table below. + +| Name | Description | Type | Default value | +| --- | --- | --- | --- | +| `hide` | Hides the [specified languages](#hide-individual-languages) from card. | string (comma-separated values) | `null` | +| `hide_title` | Hides the title of your card. | boolean | `false` | +| `layout` | Switches between five available layouts `normal` & `compact` & `donut` & `donut-vertical` & `pie`. | enum | `normal` | +| `card_width` | Sets the card's width manually. | number | `300` | +| `langs_count` | Shows more languages on the card, between 1-20. | integer | `5` for `normal` and `donut`, `6` for other layouts | +| `exclude_repo` | Excludes specified repositories. | string (comma-separated values) | `null` | +| `role` | Include repositories where the user has one of the specified [roles](https://docs.github.com/en/graphql/reference/enums#repositoryaffiliation) (OWNER, ORGANIZATION_MEMBER, COLLABORATOR). | string (comma-separated values) | `OWNER` | +| `custom_title` | Sets a custom title for the card. | string | `Most Used Languages` | +| `disable_animations` | Disables all animations in the card. | boolean | `false` | +| `hide_progress` | Uses the compact layout option, hides percentages, and removes the bars. | boolean | `false` | +| `size_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `1` | +| `count_weight` | Configures language stats algorithm (see [Language stats algorithm](#language-stats-algorithm)). | integer | `0` | +| `stats_format` | Switches between two available formats for language's stats `percentages` and `bytes`. | enum | `percentages` | + +> [!WARNING] +> Language names and custom title should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding) (i.e: `c++` should become `c%2B%2B`, `jupyter notebook` should become `jupyter%20notebook`, `Most Used Languages` should become `Most%20Used%20Languages`, etc.) You can use [urlencoder.org](https://www.urlencoder.org/) to help you do this automatically. + +### Language stats algorithm + +We use the following algorithm to calculate the languages percentages on the language card: + +```js +ranking_index = (byte_count ^ size_weight) * (repo_count ^ count_weight) +``` + +By default, only the byte count is used for determining the languages percentages shown on the language card (i.e. `size_weight=1` and `count_weight=0`). You can, however, use the `&size_weight=` and `&count_weight=` options to weight the language usage calculation. The values must be positive real numbers. [More details about the algorithm can be found here](https://github.com/anuraghazra/github-readme-stats/issues/1600#issuecomment-1046056305). + +* `&size_weight=1&count_weight=0` - *(default)* Orders by byte count. +* `&size_weight=0.5&count_weight=0.5` - *(recommended)* Uses both byte and repo count for ranking + * `&size_weight=0&count_weight=1` - Orders by repo count + +```md +![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra&size_weight=0.5&count_weight=0.5) +``` + +### Exclude individual repositories + +You can use the `&exclude_repo=repo1,repo2` parameter to exclude individual repositories. + +```md +![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra&exclude_repo=github-readme-stats,anuraghazra.github.io) +``` + +### Hide individual languages + +You can use `&hide=language1,language2` parameter to hide individual languages. + +```md +![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra&hide=javascript,html) +``` + +### Show more languages + +You can use the `&langs_count=` option to increase or decrease the number of languages shown on the card. Valid values are integers between 1 and 20 (inclusive). By default it was set to `5` for `normal` & `donut` and `6` for other layouts. + +```md +![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra&langs_count=8) +``` + +### Compact Language Card Layout + +You can use the `&layout=compact` option to change the card design. + +```md +![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra&layout=compact) +``` + +### Donut Chart Language Card Layout + +You can use the `&layout=donut` option to change the card design. + +```md +[![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra&layout=donut)](https://github.com/anuraghazra/github-readme-stats) +``` + +### Donut Vertical Chart Language Card Layout + +You can use the `&layout=donut-vertical` option to change the card design. + +```md +[![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra&layout=donut-vertical)](https://github.com/anuraghazra/github-readme-stats) +``` + +### Pie Chart Language Card Layout + +You can use the `&layout=pie` option to change the card design. + +```md +[![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra&layout=pie)](https://github.com/anuraghazra/github-readme-stats) +``` + +### Hide Progress Bars + +You can use the `&hide_progress=true` option to hide the percentages and the progress bars (layout will be automatically set to `compact`). + +```md +![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra&hide_progress=true) +``` + +### Change format of language's stats + +You can use the `&stats_format=bytes` option to display the stats in bytes instead of percentage. + +```md +![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&stats_format=bytes) +``` + + +### Demo + +![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra) + +* Compact layout + +![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra\&layout=compact) + +* Donut Chart layout + +[![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra\&layout=donut)](https://github.com/anuraghazra/github-readme-stats) + +* Donut Vertical Chart layout + +[![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra\&layout=donut-vertical)](https://github.com/anuraghazra/github-readme-stats) + +* Pie Chart layout + +[![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra\&layout=pie)](https://github.com/anuraghazra/github-readme-stats) + +* Hidden progress bars + +![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra\&hide_progress=true) + + +* Display bytes instead of percentage + +![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra\&stats_format=bytes) + +# WakaTime Stats Card + +> [!WARNING] +> Please be aware that we currently only show data from WakaTime profiles that are public. You therefore have to make sure that **BOTH** `Display code time publicly` and `Display languages, editors, os, categories publicly` are enabled. + +> [!WARNING] +> In case you just created a new WakaTime account, then it might take up to 24 hours until your stats will become visible on the WakaTime stats card. + +Change the `?username=` value to your [WakaTime](https://wakatime.com) username. + +```md +[![Harlok's WakaTime stats](https://github-readme-stats-phi-jet-58.vercel.app/api/wakatime?username=ffflabs)](https://github.com/anuraghazra/github-readme-stats) +``` + +### Options + +You can customize the appearance and behavior of the WakaTime stats card using the [common options](#common-options) and exclusive options listed in the table below. + +| Name | Description | Type | Default value | +| --- | --- | --- | --- | +| `hide` | Hides the languages specified from the card. | string (comma-separated values) | `null` | +| `hide_title` | Hides the title of your card. | boolean | `false` | +| `card_width` | Sets the card's width manually. | number | `495` | +| `line_height` | Sets the line height between text. | integer | `25` | +| `hide_progress` | Hides the progress bar and percentage. | boolean | `false` | +| `custom_title` | Sets a custom title for the card. | string | `WakaTime Stats` | +| `layout` | Switches between two available layouts `default` & `compact`. | enum | `default` | +| `langs_count` | Limits the number of languages on the card, defaults to all reported languages. | integer | `null` | +| `api_domain` | Sets a custom API domain for the card, e.g. to use services like [Hakatime](https://github.com/mujx/hakatime) or [Wakapi](https://github.com/muety/wakapi) | string | `wakatime.com` | +| `display_format` | Sets the WakaTime stats display format. Choose `time` to display time-based stats or `percent` to show percentages. | enum | `time` | +| `disable_animations` | Disables all animations in the card. | boolean | `false` | + +> [!WARNING] +> Custom title should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding) (i.e: `WakaTime Stats` should become `WakaTime%20Stats`). You can use [urlencoder.org](https://www.urlencoder.org/) to help you do this automatically. + +### Demo + +![Harlok's WakaTime stats](https://github-readme-stats-phi-jet-58.vercel.app/api/wakatime?username=ffflabs) + +![Harlok's WakaTime stats](https://github-readme-stats-phi-jet-58.vercel.app/api/wakatime?username=ffflabs\&card_width=315\&hide_progress=true) + +* Compact layout + +![Harlok's WakaTime stats](https://github-readme-stats-phi-jet-58.vercel.app/api/wakatime?username=ffflabs\&layout=compact) + +*** + +# All Demos + +* Default + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra) + +* Hiding specific stats + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&hide=contribs,issues) + +* Showing additional stats + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&show_icons=true\&show=reviews,discussions_started,discussions_answered,prs_merged,prs_merged_percentage,prs_commented,prs_reviewed,issues_commented) + +* Showing stats for a specific repository + +![Anurag's GitHub stats for anuraghazra/github-readme-stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&repo=anuraghazra/github-readme-stats\&hide=prs,issues,stars,commits,contribs\&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented\&hide_rank=true\&custom_title=Anurag%27s%20Stats%20for%20github-readme-stats\&card_width=370) + +* Showing stats for a specific organization + +![Anurag's GitHub stats for razorpay](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&owner=razorpay\&hide=prs,issues,stars,commits,contribs\&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented\&hide_rank=true\&custom_title=Anurag%27s%20Stats%20for%20razorpay\&card_width=370) + +* Showing icons + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&hide=issues\&show_icons=true) + +* Shows GitHub logo instead rank level + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&rank_icon=github) + +* Shows user rank percentile instead of rank level + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&rank_icon=percentile) + +* Customize Border Color + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&border_color=2e4058) + +* Include All Commits + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&include_all_commits=true) + +* Themes + +Choose from any of the [default themes](#themes) + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&show_icons=true\&theme=radical) + +* Gradient + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra\&bg_color=30,e96443,904e95\&title_color=fff\&text_color=fff) + +* Customizing stats card + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api/?username=anuraghazra\&show_icons=true\&title_color=fff\&icon_color=79ff97\&text_color=9f9f9f\&bg_color=151515) + +* Setting card locale + +![Anurag's GitHub stats](https://github-readme-stats-phi-jet-58.vercel.app/api/?username=anuraghazra\&locale=es) + +* Customizing repo card + +![Customized Card](https://github-readme-stats-phi-jet-58.vercel.app/api/pin?username=anuraghazra\&repo=github-readme-stats\&title_color=fff\&icon_color=f9f9f9\&text_color=9f9f9f\&bg_color=151515) + +* Gist card + +![Gist Card](https://github-readme-stats-phi-jet-58.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d) + +* Customizing gist card + +![Gist Card](https://github-readme-stats-phi-jet-58.vercel.app/api/gist?id=bbfce31e0217a3689c8d961a356cb10d&theme=calm) + +* Top languages + +![Top Langs](https://github-readme-stats-phi-jet-58.vercel.app/api/top-langs/?username=anuraghazra) + +* WakaTime card + +![Harlok's WakaTime stats](https://github-readme-stats-phi-jet-58.vercel.app/api/wakatime?username=ffflabs) + +*** + +## Quick Tip (Align The Cards) + +By default, GitHub does not lay out the cards side by side. To do that, you can use such approaches: + +### Stats and top languages cards + +```html + + + + + + +``` + +
+:eyes: Show example + + + + + + + + +
+ +### Pinning repositories + +```html + + + + + + +``` + +
+:eyes: Show example + + + + + + + + +
+ diff --git a/docs/deploy.md b/docs/deploy.md new file mode 100644 index 00000000..0a297266 --- /dev/null +++ b/docs/deploy.md @@ -0,0 +1,132 @@ +# Deploy on your own + +Since the GitHub API only allows a limited number of requests per hour, my `https://github-readme-stats-phi-jet-58.vercel.app/api` could possibly hit the rate limiter. If you host it on your own Vercel server, then you do not have to worry about anything. Also, if you don't want to give my GitHub-Stats-Extended instance access to your private contributions but still want to include these contributions in your stats, you can simply host your own instance. + +## First step: get your Personal Access Token (PAT) + +For deploying your own instance of GitHub Stats Extended, you will need to create a GitHub Personal Access Token (PAT). Below are the steps to create one and the scopes you need to select for both classic and fine-grained tokens. + +Selecting the right scopes for your token is important in case you want to display private contributions on your cards. + +### Classic token + +* Go to [Account -> Settings -> Developer Settings -> Personal access tokens -> Tokens (classic)](https://github.com/settings/tokens). + * Click on `Generate new token -> Generate new token (classic)`. + * Scopes to select: + * repo + * read:user + * Click on `Generate token` and copy it. + +### Fine-grained token + +> [!WARNING]\ +> This limits the scope to issues in your repositories and includes only public commits. + +* Go to [Account -> Settings -> Developer Settings -> Personal access tokens -> Fine-grained tokens](https://github.com/settings/tokens). + * Click on `Generate new token -> Generate new token`. + * Select an expiration date + * Select `All repositories` + * Scopes to select in `Repository permission`: + * Commit statuses: read-only + * Contents: read-only + * Issues: read-only + * Metadata: read-only + * Pull requests: read-only + * Click on `Generate token` and copy it. + +## On Vercel + +### :film\_projector: [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107) + +Click on the deploy button to get started! + +[![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/martin-mfg/github-readme-stats) + +
+ :hammer_and_wrench: Step-by-step guide on setting up your own Vercel instance + +1. Go to [vercel.com](https://vercel.com/). +2. Click on `Log in`. + ![](https://files.catbox.moe/pcxk33.png) + 3. Sign in with GitHub by pressing `Continue with GitHub`. + ![](https://files.catbox.moe/b9oxey.png) + 4. Sign in to GitHub and allow access to all repositories if prompted. + 5. Fork this repo. + 6. Go back to your [Vercel dashboard](https://vercel.com/dashboard). + 7. To import a project, click the `Add New...` button and select the `Project` option. + ![](https://files.catbox.moe/3n76fh.png) + 8. Click the `Continue with GitHub` button, search for the required Git Repository and import it by clicking the `Import` button. Alternatively, you can import a Third-Party Git Repository using the `Import Third-Party Git Repository ->` link at the bottom of the page. + ![](https://files.catbox.moe/mg5p04.png) + 9. Create a Personal Access Token (PAT) as described in the [previous section](#first-step-get-your-personal-access-token-pat). + 10. Add the PAT as an environment variable named `PAT_1` (as shown). + ![](https://files.catbox.moe/0yclio.png) + 11. Click deploy, and you're good to go. See your domains to use the API! + +
+ +## On other platforms + +> [!WARNING] +> This way of using GitHub-Stats-Extended is not officially supported and was added to cater to some particular use cases where Vercel could not be used (e.g. [#2341](https://github.com/anuraghazra/github-readme-stats/discussions/2341)). The support for this method, therefore, is limited. + +
+:hammer_and_wrench: Step-by-step guide for deploying on other platforms + +1. Fork or clone this repo as per your needs +2. Move `express` from the devDependencies to the dependencies section of `package.json` + + 3. Run `npm i` if needed (initial setup) + 4. Run `node express.js` to start the server, or set the entry point to `express.js` in `package.json` if you're deploying on a managed service + + 5. You're done 🎉 +
+ +## Available environment variables + +GitHub Readme Stats provides several environment variables that can be used to customize the behavior of your self-hosted instance. These include: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionSupported values
CACHE_SECONDSSets the cache duration in seconds for the generated cards. This variable takes precedence over the default cache timings for the public instance. If this variable is not set, the default cache duration is 24 hours (86,400 seconds).Any positive integer or 0 to disable caching
WHITELISTA comma-separated list of GitHub usernames that are allowed to access your instance. If this variable is not set, all usernames are allowed.Comma-separated GitHub usernames
GIST_WHITELISTA comma-separated list of GitHub Gist IDs that are allowed to be accessed on your instance. If this variable is not set, all Gist IDs are allowed.Comma-separated GitHub Gist IDs
EXCLUDE_REPOA comma-separated list of repositories that will be excluded from stats and top languages cards on your instance. This allows repository exclusion without exposing repository names in public URLs. This enhances privacy for self-hosted instances that include private repositories in stats cards.Comma-separated repository names
FETCH_MULTI_PAGE_STARSEnables fetching all starred repositories for accurate star counts, especially for users with more than 100 repositories. This may increase response times and API points usage, so it is limited to 10 fetches - i.e. 1000 repos - on the public instance.true or false or a maximum number of fetches
+ +See [the Vercel documentation](https://vercel.com/docs/concepts/projects/environment-variables) on adding these environment variables to your Vercel instance. + +> [!WARNING] +> Please remember to redeploy your instance after making any changes to the environment variables so that the updates take effect. The changes will not be applied to the previous deployments. + +## Keep your fork up to date + +You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHub's [Sync Fork button](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork). You can also use the [pull](https://github.com/wei/pull) package created by [@wei](https://github.com/wei) to automate this process. diff --git a/docs/fork.md b/docs/fork.md new file mode 100644 index 00000000..e32bee02 --- /dev/null +++ b/docs/fork.md @@ -0,0 +1,82 @@ +# Fork Information + +This project is a fork of [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). + +## Key Differences + +Compared to [github-readme-stats](https://github.com/anuraghazra/github-readme-stats), this project adds the following changes: + +### Frontend for easy, visual configuration of cards + +GitHub-Stats-Extended adds a frontend which allows users to visually configure stats cards. It is hosted at https://monorepo-test-backend-seven.vercel.app/frontend. + +![frontend screenshot](frontend-screenshot.png) + +The frontend is based on [GitHub Trends](https://github.com/avgupta456/github-trends) by @avgupta456. + +### Aggregate stats across organizations +To include stars from repos which are not owned by you, but where you are a collaborator or organization member, add `&role=OWNER,ORGANIZATION_MEMBER,COLLABORATOR` to your stats card url. To include such repos in your language stats, you can also add the same parameter to your top languages card url. + +See [here](advanced_documentation.md#filtering-by-repository-and-owner) for full feature documentation. + +The resolution of this most requested feature in github-readme-stats was [originally implemented](https://github.com/anuraghazra/github-readme-stats/issues/1#issuecomment-855681098) by @developStorm. + +### Improved performance and latency + +GitHub-Stats-Extended proactively precomputes and caches cards. This solves [the problem](https://github.com/anuraghazra/github-readme-stats/issues/2603) where cards wouldn't load on the first try. It also gives GitHub-Stats-Extended more time while generating cards in the background, which allows it to fetch more repo data: + +### Multi-page fetching for accurate star counts +GitHub-Stats-Extended fetches up to 1000 of your starred repositories to accurately compute your stars count. In github-readme-stats, this is limited to 100 repos because github-readme-stats doesn't have the above-mentioned performance improvements. + +### Private contributions support +GitHub-Stats-Extended can include private contributions in your stats cards. You no longer have to deploy your own instance for that. Just log into the [GitHub-Stats-Extended Wizard](https://monorepo-test-backend-seven.vercel.app/frontend) via the "GitHub Private Access" button (or click "Upgrade to Private Access" if already logged in). This will allow GitHub-Stats-Extended to see your private contributions. + +### Display contributions to specific repositories or organizations + +GitHub-Stats-Extended adds the ability to show contribution stats for specific repositories and organizations. + +Especially for regular contributors in open source projects it might make sense to display an overview of their own contributions to these projects on their GitHub profile. + +See [here](advanced_documentation.md#filtering-by-repository-and-owner) for full feature documentation. + +---------- + +anuraghazra's contributions to github-readme-stats: + +![anuraghazra's contributions to github-readme-stats](https://github-readme-stats-phi-jet-58.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented) + +Add `&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented` to your repo card url to display your contributions to the pinned repository. + +---------- + +anurag's contributions to razorpay: + +![anurag's contributions to razorpay](https://github-readme-stats-phi-jet-58.vercel.app/api?username=anuraghazra&owner=razorpay&hide=prs,issues,stars,commits,contribs&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented&hide_rank=true&custom_title=anurag%27s%20contributions%20to%20razorpay&card_width=333) + +Add `&repo=userA/repoA,orgB/repoB` or `&owner=userC,orgD` to your profile stats url to filter your contributions by repo or organization. (The screenshot above uses further customization options.) + +### Other +GitHub-Stats-Extended adds various other, minor improvements. For example, the repo card now supports the `card_width` parameter. + +## Why This Fork Exists + +[github-readme-stats](https://github.com/anuraghazra/github-readme-stats) is a great project, which unfortunately saw its development slow down in the past years, with [highly requested features](https://github.com/anuraghazra/github-readme-stats/issues/1935) getting delayed for a long time. + +One of the lovely contributors [wrote](https://github.com/anuraghazra/github-readme-stats/pull/3911#issuecomment-3377726545): +> I joined the project as collaborator in the middle of 2023 and there was just a few guys in the team while hundreds of PRs, issues and discussions pending to be reviewed. +> +> The volume is overwhelming for the small team, especially taking into account that right now I'm alone online and working only sometimes when I have a free hours, so it took some time to get to your PR. + +So I decided to implement some of the highly requested features and make the enhanced project available to everyone. + +## Upstream Sync Strategy + +The maintainers of [github-readme-stats](https://github.com/anuraghazra/github-readme-stats) keep their project up to date with dependency upgrades and do occasionally merge some pull requests. I regularly merge the latest upstream changes into this fork to keep it in sync with the upstream repo. + +I also try to structure my own changes in a way that minimizes merge conflicts with the upstream repo. So some of my changes might even be merged back into [github-readme-stats](https://github.com/anuraghazra/github-readme-stats) if the upstream maintainers are interested. + +## Compatibility Notes + +GitHub-Stats-Extended aims to be fully compatible with [github-readme-stats](https://github.com/anuraghazra/github-readme-stats). Generally, additional functionality introduced in this fork has to be explictly enabled via some parameter. + +So you can change an existing stats card url from [github-readme-stats](https://github.com/anuraghazra/github-readme-stats) to GitHub-Stats-Extended simply by changing the domain from `github-readme-stats.vercel.app` to `github-readme-stats-phi-jet-58.vercel.app`. The card will look the same. diff --git a/docs/frontend-screenshot.png b/docs/frontend-screenshot.png new file mode 100644 index 00000000..0cd7c5a1 Binary files /dev/null and b/docs/frontend-screenshot.png differ diff --git a/frontend/README.md b/frontend/README.md deleted file mode 100644 index c7be54e5..00000000 --- a/frontend/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# GitHub Trends - -## SPECIAL: GitHub Wrapped - -Check out your GitHub Wrapped at `githubwrapped.io`! - -![github-wrapped](https://github.com/avgupta456/github-trends/assets/16708871/bf9406a4-6a49-4dbf-8f60-af221bb84bd6) - ---- - -## What is GitHub Trends - -GitHub Trends dives deep into the GitHub API to bring you exciting and impactful metrics about your code contributions. Generate insights on lines written by language, repository, and time. Easily embed dynamic images into your GitHub profile to share your statistics with the world. Check out some of the examples below: - - - - - - - - -## Quickstart - -First, visit `https://api.githubtrends.io/auth/signup/public` and create an account with GitHub Trends. Then, paste this string into your Markdown content, substituting your username. - -```md -[![GitHub Trends SVG](https://api.githubtrends.io/user/svg/avgupta456/langs)](https://githubtrends.io) -``` - -And voila, you get a card like above. Keep reading to learn more! - -## Why GitHub Trends? - -Unlike other projects which look at just your public repositories, GitHub Trends computes metrics based on your individual commits. If you commit to open-source projects, or have collaborators contribute to your own repositories, GitHub Trends will better measure your own code contributions. Through this method, GitHub Trends is the first project that allows users to surface lines of code written (LOC) by language and repository. Our web interface also allows for easier customization. - -# Usage - -## Website Workflow (Alpha) - -Visit [githubtrends.io](https://www.githubtrends.io) to create an account and get started! - -Have questions? Check out [the demo](https://www.githubtrends.io/demo)! - -![image](https://user-images.githubusercontent.com/16708871/138611082-105e4dbc-8a27-4f68-8045-f9d86c912429.png) - ---- - -## API Workflow (Alpha) - -Alternatively, you can communicate directly with the API to create and customize your cards. Read [docs/API.md](https://github.com/avgupta456/github-trends/blob/main/docs/API.md) to learn more about the API and customizations. - -## FAQ - -See [docs/FAQ.md](https://github.com/avgupta456/github-trends/blob/main/docs/FAQ.md). - -## Contributing - -See [docs/CONTRIBUTING.md](https://github.com/avgupta456/github-trends/blob/main/docs/CONTRIBUTING.md). - -## Acknowledgements - -Much inspiration was taken from [GitHub Readme Stats](https://github.com/anuraghazra/github-readme-stats). If you haven't already, check it out and give it a star! - -## Other -We use your GitHub API access token to make requests on your behalf. All of our code is open-source and visible on our GitHub repository. \ No newline at end of file diff --git a/frontend/docs/API.md b/frontend/docs/API.md deleted file mode 100644 index 9cd7ccda..00000000 --- a/frontend/docs/API.md +++ /dev/null @@ -1,96 +0,0 @@ -# GitHub Trends API - -GitHub Trends provides two methods to access GitHub Trends data: the Website Workflow at githubtrends.io and the API Workflow described below. - -## Available Cards - -After authenticating with either the public or private workflow (see below), users can create the following cards to display their GitHub Trends data: - -- **[Languages Card](https://github.com/avgupta456/github-trends/blob/main/docs/API.md#languages-card)**: See your top languages over a given time interval, based on all commits to personal and open-source repositories. - -- **[Repositories Card](https://github.com/avgupta456/github-trends/blob/main/docs/API.md#repositories-card)**: See your top repositories based on lines of code contributed over a given time period. This includes both personal and open-source repositories. - -# Authentication - -You will need to create an account with GitHub Trends to create cards. The account is used to assosciate queries to the GitHub API made on your behalf with your GitHub account's API quota. We use less than 5% of your quota in almost all scenarios. There are two levels of authentication possible: - -- Public Workflow: The Public Workflow asks for read-only permission to public information. This will allow us to analyze your public contributions and repositories only. -- Private Workflow: The Private Workflow asks for read and write permission to public and private information. This will allow us to analyze your entire contribution history. See [the FAQ](https://github.com/avgupta456/github-trends/blob/main/docs/FAQ.md) for further information. - -You will only need to authenticate once with GitHub Trends. Subsequent requests will use your stored access token. - -For the public workflow, visit - -```md -https://api.githubtrends.io/auth/signup/public -``` - -For the private workflow, visit - -```md -https://api.githubtrends.io/auth/signup/private -``` - -You will be prompted to allow access, and (hopefully) redirected to a success screen. - -If you have previously authenticated with the public workflow, you can upgrade to the private workflow by using the private link. If you would like to delete your account, go to your GitHub settings and revoke the access token. - -# Languages Card - -See your top languages over a given time interval, based on all commits to personal and open-source repositories. Your top five languages will be displayed. Due to the approximations used internally, LOC metrics will be rounded to the nearest 100 lines. - -After authentication, visit - -```md -https://api.githubtrends.io/user/svg/{user_id}/langs -``` - -## Customization - -The following customization options are available: - -| Option | Description | Default | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | -| `time_range` | Specifies the time range to query statistics for. Valid options are `one_month`, `three_months`, `six_months`, `one_year`, and `all_time`. | `one_month` | -| `include_private` | Determines if private contributions are included (requires private workflow). | `false` | -| `compact` | Determines if compact layout is used (forces percentages over LOC) | `false` | -| `use_percent` | Valid if `compact=false`, determines if line of code (default) or percentages are displayed. | `false` | -| `loc_metric` | Options are LOC added (`added`) and LOC changed (`changed`). | `added` | -| `theme` | Theme to use for the card. See [docs/THEME.md](https://github.com/avgupta456/github-trends/blob/main/docs/THEME.md) for options. | `classic` | - -Customizations can be appended to the endpoint, separated first with `?` and subsequently with `&`. - -## Example - -Endpoint: `https://api.githubtrends.io/user/svg/avgupta456/langs?time_range=three_months&include_private=true&compact=true` - -[![GitHub Trends SVG](https://api.githubtrends.io/user/svg/avgupta456/langs?time_range=three_months&include_private=true&compact=true)](https://githubtrends.io) - -# Repositories Card - -After authentication, visit - -```md -https://api.githubtrends.io/user/svg/{user_id}/repos -``` - -## Customization - -The following customization options are available: - -| Option | Description | Default | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | -| `time_range` | Specifies the time range to query statistics for. Valid options are `one_month`, `three_months`, `six_months`, `one_year`, and `all_time`. | `one_month` | -| `include_private` | Determines if private contributions are included (requires private workflow). | `false` | -| `group` | Options are `none` (default), `other` (group all other repos together), and `private` (force private repos to be grouped) | `none` | -| `use_percent` | Valid if `compact=false`, determines if line of code (default) or percentages are displayed. | `false` | -| `loc_metric` | Options are LOC added (`added`) and LOC changed (`changed`). | `added` | -| `theme` | Theme to use for the card. See [docs/THEME.md](https://github.com/avgupta456/github-trends/blob/main/docs/THEME.md) for options. | `classic` | - -Customizations can be appended to the endpoint, separated first with `?` and subsequently with `&`. - -## Example - -Endpoint: `https://api.githubtrends.io/user/svg/avgupta456/repos?time_range=one_year&include_private=true&group=private&loc_metric=changed&theme=dark` - -[![GitHub Trends SVG](https://api.githubtrends.io/user/svg/avgupta456/repos?time_range=one_year&include_private=true&group=private&loc_metric=changed&theme=dark)](https://githubtrends.io) diff --git a/frontend/docs/CONTRIBUTING.md b/frontend/docs/CONTRIBUTING.md deleted file mode 100644 index 1570106b..00000000 --- a/frontend/docs/CONTRIBUTING.md +++ /dev/null @@ -1,15 +0,0 @@ -# GitHub Trends - -If you are interested in contributing to GitHub Trends, take a look through the codebase and at the open issues. Follow the guide below to set up your local environment, and contact Abhijit Gupta at `avgupta456@gmail.com` if you have any questions or need additional permissions. Thank you in advance for contributing! - -## Local Development - -First, copy `backend/.env-template` into `backend/.env` and fill in the missing variables. Similarly, copy `frontend/.env-template` into `frontend/.env` and fill in the missing variables. Create a Google Cloud Platform service account and include the key in `backend/gcloud_key.json`. Then run: - -With Python3.11, install the dependencies from `backend/requirements.txt` and run `yarn start`. - -With Node16 and Yarn, install the dependencies from `frontend/package.json` and run on a separate terminal window `yarn start-trends`. - -## Testing - -Create a pull request and let GitHub Actions run. Alternatively, explore `.github/backend.yaml` and `.github/frontend.yaml` to run tests locally. Backend coverage must increase for PRs to be merged. diff --git a/frontend/docs/FAQ.md b/frontend/docs/FAQ.md deleted file mode 100644 index e382ea06..00000000 --- a/frontend/docs/FAQ.md +++ /dev/null @@ -1,38 +0,0 @@ -# FAQ - -The FAQ is in progress. Reach out if you have any unanswered questions or concerns. - ---- - -**Question**: Does GitHub Trends have access to my private code contributions? - -**Answer**: GitHub Trends requires an OAuth access token to make requests on your behalf. The standard public workflow creates a token with read-only access to strictly public information. **This access token can not view or edit any private contributions**. - -Alternatively, users can use the private workflow which creates a token with read and write access to private information. Although GitHub Trends only uses it's read access, GitHub does not allow read-only private access (see [an open issue from 2015](https://github.com/jollygoodcode/jollygoodcode.github.io/issues/6)). While one may scan the repository to confirm this statement, there are inherent security risks to this overallocation. If this poses an issue to you, please use the public workflow instead. - -**Question**: How can I display my images side by side? - -**Answer**: Use HTML (credit: [github-readme-stats](https://github.com/anuraghazra/github-readme-stats#quick-tip-align-the-repo-cards)) - -``` - - - - - - -``` - -**Question**: How can I see my stats without giving GitHub Trends my access token? - -**Answer**: You will need to run the code locally. Clone the repository, navigate to the `backend` folder, install the dependencies (`pip install -r requirements.txt`), and then run the following script: - -```bash -python ./scripts/local.py --user_id=USER_ID --access_token=ACCESS_TOKEN --start_date=2023-01-01 --end_date=2023-01-31 --output_dir=OUTPUT_DIR -``` - -The script will output the raw and processed JSONs into the output directory specified. - -**Question**: What if I find a bug, or want to contribute? - -**Answer**: Raise an [issue](https://github.com/avgupta456/github-trends/issues/new) or [pull request](https://github.com/avgupta456/github-trends/compare) through GitHub. I would be happy to discuss and implement any suggestions or improvements. diff --git a/frontend/docs/THEME.md b/frontend/docs/THEME.md deleted file mode 100644 index 15eb2090..00000000 --- a/frontend/docs/THEME.md +++ /dev/null @@ -1,6 +0,0 @@ -The following themes are available for all GitHub Trends cards: - -| Themes | | | -| --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | -| [![GitHub Trends SVG](https://api.githubtrends.io/user/svg/avgupta456/langs?theme=classic)](https://githubtrends.io) | [![GitHub Trends SVG](https://api.githubtrends.io/user/svg/avgupta456/langs?theme=dark)](https://githubtrends.io) | [![GitHub Trends SVG](https://api.githubtrends.io/user/svg/avgupta456/langs?theme=bright_lights)](https://githubtrends.io) | -| [![GitHub Trends SVG](https://api.githubtrends.io/user/svg/avgupta456/langs?theme=rosettes)](https://githubtrends.io) | [![GitHub Trends SVG](https://api.githubtrends.io/user/svg/avgupta456/langs?theme=ferns)](https://githubtrends.io) | [![GitHub Trends SVG](https://api.githubtrends.io/user/svg/avgupta456/langs?theme=synthwaves)](https://githubtrends.io) |