diff --git a/README.md b/README.md index c8f4c67..4396555 100644 --- a/README.md +++ b/README.md @@ -1,89 +1,134 @@ # 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 ``` +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 + ``` + The server runs on port 4881 by default. You can change this in `docker-compose.yml` if necessary. -4. Set up the database: - - 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 codeboard-frontend + ``` +2. **Install frontend dependencies:** ```bash - cd ../server - python manage.py migrate + cd codeboard-frontend + npm install ``` -6. Start the Django server: +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/" + ``` +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.