Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated #1

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1c66a46
Leetcode Contest Ranking Page (#60)
krishnan05 Jun 14, 2023
cc975b9
Update README.md
krishnan05 Jun 14, 2023
9c4c66a
Leetcode contest ranking imrovement
krishnan05 Jun 17, 2023
61cfb42
Merge pull request #62 from OpenLake/krishnan
Aditya062003 Jun 17, 2023
77bc1d5
Added graphs feature (#66)
Aditya062003 Jun 19, 2023
61e4321
Update README.md
krishnan05 Jun 19, 2023
4e870eb
Update README.md
krishnan05 Jun 24, 2023
dddecd9
Update README.md
krishnan05 Aug 14, 2023
1d3eafb
Update README.md
krishnan05 Sep 15, 2023
8208e51
Update README.md
krishnan05 Sep 18, 2023
ba43f69
Update README.md
krishnan05 Sep 18, 2023
9487a38
Update settings.py
krishnan05 Sep 18, 2023
5c6c58d
Shifting friends APIs to use MongoDB (#70)
Harshith-19 Sep 19, 2023
768f40e
Codechef friend's add friend bug resolved
krishnan05 Sep 20, 2023
c844be9
Update README.md
krishnan05 Sep 20, 2023
a1aa5bf
saving codechef details using serializer
Harshith-19 Sep 23, 2023
421d217
saving github details using serializer
Harshith-19 Sep 23, 2023
53e6cbe
saving leetcode details using serializer
Harshith-19 Sep 23, 2023
0476265
added a no code issue template
Aditya062003 Sep 30, 2023
ecda838
bug fixes
Harshith-19 Oct 1, 2023
6fe71e0
fixed footer
SxxAq Oct 1, 2023
d2d0986
Merge pull request #80 from Harshith-19/main
krishnan05 Oct 1, 2023
be09574
Fixed Nav and typo's
SxxAq Oct 1, 2023
c701882
Improved UI of tables by adding responsivity for mobile devices
melencholicmice Oct 2, 2023
f1990e7
added proper comment
melencholicmice Oct 2, 2023
7bad288
Merge pull request #86 from melencholicmice/main
krishnan05 Oct 2, 2023
78fa960
created celery job for codeforces
Harshith-19 Oct 2, 2023
d5386ec
Merge pull request #87 from Harshith-19/main
krishnan05 Oct 3, 2023
58d57f9
solved Github friend's add friend with new url (#85)
ronisarkarexe Oct 3, 2023
1667a15
Bump loader-utils from 2.0.0 to 2.0.4 in /app (#88)
dependabot[bot] Oct 4, 2023
5dfaf01
solved leetcode friend add etc with new url (#89)
ronisarkarexe Oct 4, 2023
e657cfe
Bump urllib3 from 1.26.12 to 1.26.17 in /api (#91)
dependabot[bot] Oct 4, 2023
25fa083
Bump django from 3.2.4 to 3.2.20 in /api (#90)
dependabot[bot] Oct 4, 2023
0f5dae5
Bump certifi from 2022.9.24 to 2023.7.22 in /api (#92)
dependabot[bot] Oct 4, 2023
472e8ec
profile details API
Harshith-19 Oct 5, 2023
01fd45a
Resolved conflict
SxxAq Oct 5, 2023
b8e39a7
Merge pull request #93 from Harshith-19/main
krishnan05 Oct 5, 2023
ba86d68
Bump cryptography from 40.0.1 to 41.0.4 in /api
dependabot[bot] Oct 6, 2023
9f780e4
Bump json5 from 1.0.1 to 1.0.2 in /app
dependabot[bot] Oct 6, 2023
4f4a19b
Merge pull request #95 from OpenLake/dependabot/npm_and_yarn/app/json…
krishnan05 Oct 7, 2023
963e091
Merge pull request #94 from OpenLake/dependabot/pip/api/cryptography-…
krishnan05 Oct 7, 2023
f8ed6d0
Merge pull request #81 from SxxAq/SxxAq
Aditya062003 Oct 9, 2023
9a2e441
removed unnecessary files
Harshith-19 Oct 9, 2023
16eb42c
Merge pull request #97 from Harshith-19/main
krishnan05 Oct 9, 2023
7c8c568
Improve Documentation #84 (#98)
ASK-03 Oct 25, 2023
3ccbb4f
Codeforces and openlake friend intigration
krishnan05 Dec 12, 2023
6c5aa3b
Removing `make migrate` from installation step (#101)
sunidhisachan Dec 27, 2023
ef84279
add: macos installation (#105)
jaiakash Dec 28, 2023
14859be
Dockerised the project (#106)
jaiakash Dec 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/no_code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: No Code
about: Addition of a No Code feature to the project.
title: ''
labels: No code , Technical Writing
assignees: ''

---

<!--- Provide a general summary of the issue in the Title above -->

## Description
<!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug -->

## Expected Behavior
<!--- Tell us what should happen -->

## Actual Behavior
<!--- Tell us what happens instead -->

## Possible Fix
<!--- Not obligatory, but suggest a fix or reason for the bug -->

## Steps to Reproduce
<!--- Provide a link to a live example or some unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.

## Context
<!--- How has this bug affected you? What were you trying to accomplish? -->
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
node_modules

*.env
*.lock
*.log

*.env
*.pyc
*.sqlite3
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Start with an Ubuntu base image
FROM ubuntu:latest

# Install Python and other necessary packages
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-venv \
curl \
make \
redis-server \
git

# Install Node.js (for React)
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs

# Install pnpm
RUN npm install -g pnpm

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy the project files into the container
COPY . .

# Set up Python virtual environment
RUN python3 -m venv env
ENV PATH="/usr/src/app/env/bin:$PATH"

# Install dependencies
RUN make install

# Expose ports (Django and React)
EXPOSE 8000 3000

# Run the application
CMD ["make", "dev"]
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ migrate:
dev-ui:
cd app/ && $(PNPM) run start

dev-server: migrate
dev-server:
cd api/ && $(PYTHON) manage.py runserver &

celery-1:
Expand All @@ -22,5 +22,10 @@ celery-1:
celery-2:
cd api/ && celery -A leaderboard beat -l info

dev: dev-server dev-ui celery-1 celery-2
dev:
@echo 'Starting dev servers'
$(MAKE) migrate
$(MAKE) dev-ui &
$(MAKE) dev-server &
$(MAKE) celery-1 &
$(MAKE) celery-2
88 changes: 82 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,104 @@
<h1 align="center">Welcome to the Leaderboard project 👋</h1>

## 🤔 Problem
How do people become good at something ? By doing it regularly, right ? That's why this project aims to help all the students in practicing programming regularly by maintaining a leaderboard. The website will be have **4 different leaderboards**
How do people become good at something ? By doing it regularly, right ? That's why this project aims to help all the students in practicing programming regularly by maintaining a leaderboard. The website will be have **6 different leaderboards**

## ✨ Features
- LeaderBoard Website + Django backend to collect data from different sources( APIs and web scraping )
- Leaderboard type 1 : Github profile activeness (based on commits/stars etc.)
- Leaderboard type 2 : OpenLake contributions (based on commits/pull requests etc.)
- Leaderboard type 3 : Codechef ranking
- Leaderboard type 4 : Codeforces ranking
- Leaderboard Type 5 : Leetcode ranking
- Leaderboard type 6 : Leetcode contest ranking
- Students can also view the rankings of the latest LeetCode contests, their institute rank and visualise contest performance through graph.
- Students will get notified(through email) whenever their rank is decreasing (because they aren't active)
- Our metrics will promote consistent work instead of bulk work at once.
- Tech Stack : React, Django, PostgreSQL
- Tech Stack : React, Django, PostgreSQL, MongoDB (for Friend's Table)

## Setup instrunctions
- Install `pnpm`, `python3.7` and `Make` in your system
## 📝 Setup instructions
- Install `pnpm`, To obtain installation instructions for the pnpm package manager on your operating system, please refer to the following [link](https://pnpm.io/installation).
- Install `python3.7`
- Ensure that you are in project folder
- Create a virtual Environment
```
python3 -m venv <ENVIRONMENT_NAME>
```
- Activate the virtual Environment
```
source <ENVIRONMENT_NAME>/bin/activate
```
- Install `make`
- For Ubuntu:
```
sudo apt update
sudo apt install make
```
- For Mac OS:
- In the terminal window, run the command ```xcode-select --install```
- In the windows that pops up, click Install, and agree to the Terms of Service.
- For Windows, follow the [link](https://linuxhint.com/install-use-make-windows/)
- Install Redis
- For Ubuntu, follow the [link](https://redis.io/docs/install/install-redis/install-redis-on-linux/)
- For MacOS, follow the [link](https://redis.io/docs/install/install-redis/install-redis-on-mac-os/)
- For Windows, follow the [link](https://redis.io/docs/install/install-redis/install-redis-on-windows/)
- Replace database credentials
- Create a new project on Supabase
- Go to `Project Settings > Database`
- Open the project in prefered code-editor
- Go to `Leaderboard-Pro > api > leaderboard > settings.py`, scroll down to `DATABASES` variable and change the `NAME`, `USER`, `PASSWORD`, `HOST` and `PORT` as on the Supabase Database page.
- Run the following commands in the same order:
```
make install
make migrate
make dev
```
- Visit http://localhost:8000/ and http://localhost:3000/

## Maintainers
## 🐳 Running with Docker

Docker provides a consistent and isolated environment for running the Leaderboard project, ensuring that it works the same way on every machine. Follow these steps to get the application up and running with Docker:

### Prerequisites
- Ensure you have Docker installed on your machine. To install Docker, follow the instructions on the [Docker website](https://docs.docker.com/get-docker/).

### Building the Docker Image
1. Clone the repository (if you haven't already):
```
git clone https://github.com/your-username/Leaderboard-Pro.git
cd Leaderboard-Pro
```

2. Build the Docker image:
```
docker build -t leaderboard-pro .
```

This command builds a Docker image named `leaderboard-pro` based on the instructions in the Dockerfile.

### Running the Application in a Docker Container
1. To start the application in a Docker container, run:
```
docker run -p 8000:8000 -p 3000:3000 leaderboard-pro
```

This command starts the Docker container and maps the ports so that you can access the Django backend at `http://localhost:8000/` and the React frontend at `http://localhost:3000/`.

2. Visit the URLs in your web browser to interact with the application:
- Django Backend: [http://localhost:8000/](http://localhost:8000/)
- React Frontend: [http://localhost:3000/](http://localhost:3000/)

### Stopping the Container
- To stop the Docker container, you can press `Ctrl+C` in the terminal where the container is running. Alternatively, you can stop the container from another terminal using the `docker stop` command with the container ID.


## 🧑‍💻 Maintainers
- [Gopal Ramesh Dahale](https://github.com/Gopal-Dahale)
- [Kumar Shivendu](https://github.com/KShivendu)
- [Aayush Krishnan](https://github.com/krishnan05)
- [Aditya Dubey](https://github.com/Aditya062003)

## 💻 Contributing Guidelines
- Read [contributing guidelines](https://github.com/OpenLake/Leaderboard-Pro/blob/main/.github/CONTRIBUTING.md)

## 👀 Hosted App
[https://openlake-leaderboardpro.vercel.app](https://openlake-leaderboardpro.vercel.app)
22 changes: 22 additions & 0 deletions api/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PYTHON ?= python3
PIP ?= pip3

migrate:
$(PYTHON) manage.py makemigrations
$(PYTHON) manage.py migrate

dev-server:
$(PYTHON) manage.py runserver &

celery-1:
celery -A leaderboard worker --loglevel=info

celery-2:
celery -A leaderboard beat -l info

dev:
@echo 'Starting dev servers'
$(MAKE) migrate
$(MAKE) dev-server &
$(MAKE) celery-1 &
$(MAKE) celery-2
10 changes: 1 addition & 9 deletions api/leaderboard/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@
openlakeContributor,
UserNames,
LeetcodeUser,
GithubFriends,
LeetcodeFriends,
CodechefFriends,
CodeforcesFriends,
)

admin.site.register(codeforcesUser)
admin.site.register(githubUser)
admin.site.register(codechefUser)
admin.site.register(openlakeContributor)
admin.site.register(UserNames)
admin.site.register(LeetcodeUser)
admin.site.register(GithubFriends)
admin.site.register(LeetcodeFriends)
admin.site.register(CodechefFriends)
admin.site.register(CodeforcesFriends)
admin.site.register(LeetcodeUser)
29 changes: 0 additions & 29 deletions api/leaderboard/api/serializers.py

This file was deleted.

17 changes: 2 additions & 15 deletions api/leaderboard/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,8 @@
path('insertapi/',views.post_UserNames),
path('tripathi/',views.current_user),
path('register/',views.registerUser),
path('ghfriends/',views.add_GithubFriends),
path('ltfriends/',views.add_LeetcodeFriends),
path('ccfriends/',views.add_CodechefFriends),
path('cffriends/',views.add_CodeforcesFriends),
path('getcffriends/',views.get_CodeforcesFriends),
path('dropcffriends/',views.drop_CodeforcesFriends),
path('getccfriends/',views.get_CodechefFriends),
path('dropccfriends/',views.drop_CodechefFriends),
path('getltfriends/',views.get_LeetcodeFriends),
path('dropltfriends/',views.drop_LeetcodeFriends),
path('getghfriends/',views.get_GithubFriends),
path('dropghfriends/',views.drop_GithubFriends),
path('olfriends/',views.add_OpenlakeFriends),
path('getolfriends/',views.get_OpenlakeFriends),
path('dropolfriends/',views.drop_OpenlakeFriends),
path('leetcodecontestrankings/',views.ContestRankingsAPIView),

]


Loading