|
1 | | -# My First Mini Project: **A Custom LeetCode Badge** |
| 1 | +# A Customized LeetCode Badge |
2 | 2 |
|
3 | | -The goal is to display this badge on my personal **GitHub profile README** |
| 3 | +I wanted to **show my Leetcode stats on my GitHub profile** and I only found few models online but the **designs weren't to my taste**... So I took this opportunity to design my own one |
4 | 4 |
|
5 | | -## 🔍 Overview |
| 5 | +[](https://leetcode.com/u/Yoouss/) |
| 6 | + |
| 7 | +It helped me **practice my HTML/CSS skills** and gave me the opportunity to **start my first personal project** |
| 8 | + |
| 9 | +## Overview |
6 | 10 | This mini-project is built with **Flask**, a **Python** web framework, to fetch data from **LeetCode** using an **API** **every 24h** |
7 | | -- Hosted on [https://leetcode-badge.onrender.com/](https://leetcode-badge.onrender.com) (HTML/CSS) |
| 11 | +- Hosted on [https://leetcode-badge.onrender.com](https://leetcode-badge.onrender.com) (HTML/CSS) |
8 | 12 | - Hosted on the **repository** : app/static/badge.png (PNG image) |
9 | 13 |
|
10 | | -/!\ The website is hosted on **Render** so it may be in a sleeping mode. Try again few minutes later |
11 | | - |
12 | | -[](https://leetcode.com/u/Yoouss/) |
| 14 | +> [!CAUTION] |
| 15 | +> The badge is hosted on **Render** so it may be in a sleeping mode, this can take **few minutes** |
13 | 16 |
|
14 | | -## The meaning behind this project |
15 | | -I wanted to **show my Leetcode stats on my GitHub profile**, but I only found a few models online and the **designs weren't to my taste**... So I decided to **create my own custom-designed badge** <br> |
| 17 | +**I'll soon update this README to show step by step how to use my project to display your own stats : )** |
16 | 18 |
|
17 | | -It helped me **practice my HTML/CSS skills** and gave me the opportunity to **start my first personal project** |
| 19 | +## Installation |
| 20 | + |
| 21 | +### 0. Requirements |
| 22 | + |
| 23 | +<details> |
| 24 | +<summary><b>Debian based users</b> (WSL, Ubuntu, Mint, Pop_OS!, ...)</summary> |
| 25 | + |
| 26 | +```bash |
| 27 | +sudo apt install python3 python3-pip python3-venv |
| 28 | +``` |
| 29 | + |
| 30 | +</details> |
| 31 | + |
| 32 | +<details> |
| 33 | +<summary><b>Red Hat based users</b> (Fedora, ...)</summary> |
| 34 | + |
| 35 | +```bash |
| 36 | +sudo dnf install python3 python3-pip |
| 37 | +``` |
| 38 | + |
| 39 | +</details> |
| 40 | + |
| 41 | +<details> |
| 42 | +<summary><b>Arch based users</b> (Arch, EndeavourOS, ...)</summary> |
| 43 | + |
| 44 | +```bash |
| 45 | +sudo pacman -S python python-pip |
| 46 | +``` |
| 47 | + |
| 48 | +</details> |
| 49 | + |
| 50 | +<details> |
| 51 | +<summary><b>MacOS users</b></summary> |
| 52 | + |
| 53 | +```bash |
| 54 | +brew install python |
| 55 | +``` |
| 56 | + |
| 57 | +</details> |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +### 1. Clone the repo and go to the project directory |
| 62 | + |
| 63 | +- Via **https** : |
| 64 | +```bash |
| 65 | +git clone https://github.com/Yoouss/leetcode-badge.git && cd leetcode-badge |
| 66 | +``` |
18 | 67 |
|
19 | | -## ❔ How to use Flask ? |
20 | | -- First, **clone** the **repository** : |
| 68 | +- Or **ssh** : |
21 | 69 | ```bash |
22 | | -git clone https://github.com/Yoouss/leetcode_badge.git |
23 | | -cd leetcode_badge |
| 70 | +git clone git@github.com:Yoouss/leetcode-badge.git && cd leetcode-badge |
24 | 71 | ``` |
25 | | -- Then, **install** the **requirements.txt** in an **virtual environment** : |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +### 2. Create a virtual environment and install the dependencies |
| 76 | + |
26 | 77 | ```bash |
27 | | -python -m venv venv |
| 78 | +python3 -m venv venv |
28 | 79 | source venv/bin/activate |
29 | 80 | pip install -r requirements.txt |
30 | 81 | ``` |
31 | | -- Finally, to **lunch Flask**, use : <br> |
| 82 | + |
| 83 | +## Usage |
| 84 | + |
| 85 | +To run the project locally, **start the Flask development server** : |
| 86 | + |
32 | 87 | ```bash |
33 | 88 | flask --app app --debug run |
34 | 89 | ``` |
35 | 90 |
|
36 | | -## ▫️ Bonus : the evolution of the badge's design |
| 91 | +> [!CAUTION] |
| 92 | +> If you send **too many requests to the API** that fetches LeetCode stats, **errors may occur** |
| 93 | +
|
| 94 | + |
| 95 | +## Bonus : the evolution of the badge's design |
37 | 96 | <img src="archive/leetcode-badge-v1.png" width="400"> <img src="archive/leetcode-badge-v2.png" width="400"> |
38 | 97 | <img src="archive/leetcode-badge-v3.png" width="400"> <img src="archive/leetcode-badge-v4.png" width="400"> |
0 commit comments