From 50f78eca64b406863c6e4d30be004d2fba30ea94 Mon Sep 17 00:00:00 2001 From: Sarthak singh Date: Thu, 9 Nov 2023 20:26:57 +0530 Subject: [PATCH] updating contribution --- CONTRIBUTING.md | 70 +++++++++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4bb1e29c..b172c7e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,48 +1,66 @@ +--- # Contributing -## Setup Discord application -Create a new Discord application [here](https://discord.com/developers/applications) by clicking the `New application` button and name it whatever you want. +## Setup Discord Application -![New application](https://cdn.discordapp.com/attachments/721750194797936823/794646477505822730/unknown.png) +Refer to the official discord.py [documentation](https://discordpy.readthedocs.io/en/stable/discord.html) to create a bot. -Go to the Bot section on the right-hand side and click on Add Bot. +## Project Setup & Installation -![Add Bot](https://cdn.discordapp.com/attachments/852867509765799956/853984486970359838/unknown.png) +1. Fork the repository to your own profile. +2. Set up a local PostgreSQL database or use [Docker](#Docker-Setup). -Copy the bot token (to be used in .env file when setting up project) + ```postgresql://username:password@localhost/db_name``` -![Token](https://cdn.discordapp.com/attachments/852867509765799956/853985222127124500/unknown.png) + Replace username, password, db_name with appropriate values. +3. Run migrations. -To Invite the bot to your server go to Oauth2 select bot then select administrator and go to the link -![Invite Bot](https://cdn.discordapp.com/attachments/852867509765799956/853985694183850004/unknown.png) + ```python cli.py migrate up``` +4. To install packages, run: -## Project Setup & Installation + ```bash + pip install poetry + poetry install + ``` + +5. Create a .env file and copy the contents of example.env, setting up the environment variables. + +6. Once the above steps are done, run the bot using the command: + + ```bash + python cli.py + ``` -1. Fork the repository to your own profile. -2. Setup postgresql DB -```postgresql://username:password@localhost/db_name``` -Replace username, password, db_name with appropriate values -3. Run migrations -```python cli.py migrate up``` -4. To install packages run:- - - ```pip install poetry``` - ```poetry install``` -5. Create a .env file and copy the contents of example.env, setup the env vars. - -6. Once above steps are done, run the bot using command - ```python cli.py``` 7. Feel free to join the server in case of any issues. -## Guidelines +## Docker-Setup -Please keep the following guidelines in mind when contributing: +1. Ensure you have Docker installed and set up on your system. Refer to the [Docker's official guide](https://docs.docker.com/get-started/overview/) if needed. +2. To run a PostgreSQL instance, execute: + + ```bash + docker compose up -d postgres + ``` + The `-d` flag runs the instance in detached mode. + +3. Run migrations. + + ```python cli.py migrate up``` +# Guidelines + +Please adhere to the following guidelines when contributing: - Follow the coding style and conventions used in the project. - Write clear and concise commit messages. - Test your changes thoroughly before submitting a pull request. - Be respectful and constructive in all interactions with other contributors. + +## Code Quality and Testing + +- Ensure your code follows best practices and is well-documented. +- Write unit tests for new features and ensure existing tests pass. +- Perform code reviews and address feedback from other contributors.