- Introduction
- Getting Started
- Code of Conduct
- Contributing
- License
- How to Get Help
This is the backdoor REST API developed to do complex calclations, provide and store data for Codedigger Website.
Codedigger aims at accumulating the data of competitive programming platforms (Codeforces, Codechef, Atcoder, SPOJ and UVA Online Judge) into one platform. We used their publicly available APIs and introduced several unique features into our application such as friends, mentors, ladders, upsolve, problem and contest filter. This can be the ultimate stop for everyone practicing competitive programming.
User can practice topicwise list to expertise any topic, levelwise list to practice based on rating and difficulty, or can create their own list and follow that. They can filter problems based on difficulty, tag, or solved by mentor from all the sites combined at one place.
Upsolving means to solve those problems, you're not able to solve during the contest. With the help of codedigger, you will be able to upsolve codeforces, codechef, and atcoder contests in an easy and better way.
Fork Codedigger Backend repository and clone at your local
git clone https://github.com/<yourGithubUsername>/Backend.git
cd Backend/
Create a branch with a descriptive name. A good branch name would be :
git checkout -b feature/AmazingFeature
git checkout -b bugfix/user
If you're working on a issue or issue is assigned to you -
- Create a branch for issue by commenting
/cib
or/cib 2-3 word desc.
on the issue. - This will create a branch with descriptive name.
- You can push all your code related to issue in this branch.
- When you're done, create a merge PR to master branch.
- After review, your branch will be merged.
Creating Virtual Environment
A virtual environment is a tool that helps keep dependencies required and the project isolated. If you wish to install a new library and write
pip install name_of_library
on the terminal without activating an environment, all the packages will be installed globally which is not a good practice if you’re working with different projects on your computer.
If this sounds a bit complicated, don’t worry so much because a virtual environment is just a directory that will contain all the necessary files for our project to run.
Installing venv (required once)
Windows
py -m pip install --user virtualenv
py -m venv env
Linux
python3 -m pip install --user virtualenv
python3 -m venv env
You have to start virtual environment everytime you start new terminal -
Windows
Using gitbash
. env/Scripts/activate
Using Powershell
. env\Scripts\activate
Linux
source env/bin/activate
Windows
pip install -r requirements.txt
Linux
pip3 install -r requirements.txt
Requirement- MySQL
You can download MySQL from here or download XAMPP.
Start MySQL server and create a database.
Configuring Environment Variables
cd to codedigger directory, this is our working directory. For now we will run all command in this directory only -
cd codedigger/
Make environment file in codedigger directory by copying the example file -
cp codedigger/.env.example codedigger/.env
Database Settings
DB_NAME = codedigger
DB_USER = root
DB_PASSWORD =
DB_HOST = 127.0.0.1
DB_PORT = 3306
GMAIL Settings
You need to turn on less secure app access for sending mails.
EMAIL_HOST_USER = your_mail_id
EMAIL_HOST_PASSWORD = your_password
Windows
py manage.py migrate
Linux
python3 manage.py migrate
Windows
py manage.py createsupeser
Linux
python3 manage.py createsupeser
Windows
py manage.py runserver
Linux
python3 manage.py runserver
deactivate
If you have installed new dependency, the pip freeze command lists the third-party packages and versions installed in the environment.
Windows
pip freeze > requirements.txt
Linux
pip3 freeze > requirements.txt
Everytime you change db models, you need to run makemigrations and migrate to update on database.
Windows
py manage.py makemigrations
py manage.py migrate
Linux
python3 manage.py makemigrations
python3 manage.py migrate
This project and everyone participating in it is governed by the Codedigger Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to contact.codedigger@gmail.com.
We encourage you to participate in this open source project. We love Pull Requests, Bug Reports, ideas, (security) code reviews or any other kind of positive contribution. Please review CONTRIBUTING.md for details on how to file an issue or pr.
Copyright 2021 Codedigger
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Email us - contact.codedigger@gmail.com
Join! our Discord Community