From daa518ebf449013400e3b3c73e5fe6b24080275b Mon Sep 17 00:00:00 2001 From: Ishan <114330253+ishan-xy@users.noreply.github.com> Date: Mon, 14 Oct 2024 06:40:26 +0530 Subject: [PATCH 1/3] Update README.md, Better and accurate documentation --- README.md | 110 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 76 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index c8f4c67..e1b0e9e 100644 --- a/README.md +++ b/README.md @@ -1,89 +1,131 @@ # Codeboard -Codeboard is an open-source project under the CCS Coding Community an initiative by Creative Computing Society, TIET. It maintains a list of coders and scrapes their LeetCode profiles to rank them based on their performance. +**Codeboard** is an open-source project under the CCS Coding Community, an initiative by the Creative Computing Society, TIET. This project maintains a list of coders and ranks them based on their LeetCode performance by scraping their profiles. ## Project Structure -The project consists of two main folders: +The project has two main directories: -- `server`: Contains the backend code using Django and Celery. -- `client`: Contains the frontend code built with React. +- `server`: Contains backend code built with Django and Celery. +- `client`: Contains frontend code built with React. ## Getting Started -These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. +Follow these instructions to set up a local version of Codeboard for development and testing. ### Prerequisites +Ensure you have the following installed: + - Python 3.x - Node.js +- Docker (required for the Django backend and to properly run Celery with Redis) - Django - Celery - Redis (for Celery backend) -- PostgreSQL (or any other preferred database) - -### Installation +- PostgreSQL (or your preferred database) -1. Clone the repository: +### Server Setup +1. **Clone the backend repository:** ```bash - git clone https://github.com/creative-computing-society/codeboard.git + git clone -b dev-backend https://github.com/creative-computing-society/codeboard.git codeboard-backend ``` -2. Set up the server: +2. **Set up a Python virtual environment:** + ```bash + cd codeboard-backend + python3 -m venv .venv + ``` + For Linux/MacOS: + ```bash + source .venv/bin/activate + ``` + For Windows: + ```bash + .venv\Scripts\activate + ``` +3. **Install project dependencies:** ```bash - cd server - python3 -m venv env - source env/bin/activate pip install -r requirements.txt ``` -3. Set up the client: +4. **Configure environment variables:** + Create a `.env` file at the root of the backend project (`codeboard-backend/.env`) and include the following variables: + ```plaintext + SECRET_KEY='' # Django secret key + DB_NAME='' + DB_USER='' + DB_PASS='' + DB_HOST='' + DB_PORT='' + CLIENT_SECRET='' # CCS Auth Client Secret + ``` + Create a database and update these variables with your database credentials. +5. **Apply database migrations:** ```bash - cd ../client - npm install - npm start + python manage.py migrate ``` -4. Set up the database: +6. **Start the backend services:** + Use Docker to start Redis, Celery, and the Django server: + ```bash + docker-compose up --build + ``` + The server runs on port 4881 by default. You can change this in `docker-compose.yml` if necessary. - Configure your database settings in `server/app/settings.py`. +### Client Setup -5. Apply database migrations: +1. **Clone the frontend repository:** + ```bash + git clone -b dev-frontend https://github.com/creative-computing-society/codeboard-frontend.git + ``` +2. **Install frontend dependencies:** ```bash - cd ../server - python manage.py migrate + cd codeboard-frontend + npm install + ``` + +3. **Set the server URL (for local development):** + If you’re running the backend locally, navigate to `config.js` in the `src` directory and set `SERVER_URL`: + ```javascript + SERVER_URL = "http://127.0.0.1:4881/" ``` -6. Start the Django server: +4. **Set the callback URL for authentication:** + In `Login.js` under the `Components` folder, update the callback URL: + ```plaintext + http://localhost:3000/authVerify + ``` +5. **Start the frontend server:** ```bash - python manage.py runserver + npm start ``` +After following these steps, the application should be running locally. + ## Usage -Visit the live application at [https://codeboard.ccstiet.com/](http://codeboard.ccstiet.com/) to see the list of coders and their ranks. +Visit the live application at [https://codeboard.ccstiet.com/](https://codeboard.ccstiet.com/) to view coder rankings. ## Contributing -We welcome contributions from the community. Please read the [CONTRIBUTION.md](CONTRIBUTION.md) file for details on the code of conduct, and the process for submitting pull requests. +We welcome contributions! Please refer to our [CONTRIBUTION.md](CONTRIBUTION.md) for guidelines on contributing and submitting pull requests. ## Maintainers -- @IshanSingla69 -- @kaurmanjot20 +- [@ishan-xy](https://github.com/ishan-xy) +- [@kaurmanjot20](https://github.com/kaurmanjot20) ## Moderators -- @akarsh911 -- @saini128 +- [@akarsh911](https://github.com/akarsh911) +- [@saini128](https://github.com/saini128) ## License -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. - - +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information. From 3c5dd2bd38eb83314583f70d90af0174083e2689 Mon Sep 17 00:00:00 2001 From: Ishan <114330253+ishan-xy@users.noreply.github.com> Date: Mon, 14 Oct 2024 06:42:10 +0530 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1b0e9e..ff9a5cd 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ Ensure you have the following installed: 1. **Clone the frontend repository:** ```bash - git clone -b dev-frontend https://github.com/creative-computing-society/codeboard-frontend.git + git clone -b dev-frontend https://github.com/creative-computing-society/codeboard-frontend.git codeboard-frontend ``` 2. **Install frontend dependencies:** From 48db49945f27a7cdd5224c69c45947fa7faa3423 Mon Sep 17 00:00:00 2001 From: Ishan <114330253+ishan-xy@users.noreply.github.com> Date: Mon, 14 Oct 2024 06:49:38 +0530 Subject: [PATCH 3/3] Update README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ff9a5cd..4396555 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,14 @@ Ensure you have the following installed: ```bash python manage.py migrate ``` - -6. **Start the backend services:** +6. **Collect Static** + ```bash + python manage.py collectstatic + ``` +7. **Start the backend services:** Use Docker to start Redis, Celery, and the Django server: ```bash - docker-compose up --build + docker compose up --build ``` The server runs on port 4881 by default. You can change this in `docker-compose.yml` if necessary.