diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 512b6c23..4f24f158 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -2,58 +2,58 @@ ## Our Pledge -We as members, contributors, and leaders, pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body +We as members, contributors and leaders pledge to make participation in our +community, a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity +nationality, personal appearance, race, religion or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and a healthy community. +diverse, inclusive and a healthy community. ## Our Standards Examples of behavior that contribute to a positive environment for our community include: -* Demonstrating empathy and kindness towards other people -* Being respectful and open to differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Taking accountability and offering apologies to those who have been impacted by our errors, +## Demonstrating empathy and kindness towards other people +1. Being respectful and open to differing opinions, viewpoints, and experiences +2. Giving and gracefully accepting constructive feedback +3. Taking accountability and offering apologies to those who have been impacted by our errors, while also gaining insights from the situation -* Focusing on what is best not just for us as individuals, but for the +4. Focusing on what is best not just for us as individuals but for the community as a whole Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or +1. The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing other's private information, such as a physical or email +2. Trolling, insulting or derogatory comments, and personal or political attacks +3. Public or private harassment +4. Publishing other's private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +5. Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, +response to any behavior that they deem inappropriate, threatening, offensive or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation +not aligned to this Code of Conduct and will communicate reasons for moderation decisions when appropriate. ## Scope -This Code of Conduct applies within all community spaces, and also applies when +This Code of Conduct applies within all community spaces and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed +posting via an official social media account or acting as an appointed representative at an online or offline event. ## Enforcement @@ -63,29 +63,27 @@ reported to the community leaders responsible for enforcement at contact@arc53.com. All complaints will be reviewed and investigated promptly and fairly. -All community leaders are obligated to respect the privacy and security of the +All community leaders are obligated to respectful towards the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: +the consequences for any action that they deem in violation of this Code of Conduct: ### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed +* **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community space. -**Consequence**: A private, written warning from community leaders, providing +* **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning - -**Community Impact**: A violation through a single incident or series +* **Community Impact**: A violation through a single incident or series of actions. -**Consequence**: A warning with consequences for continued behavior. No +* **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels @@ -93,23 +91,21 @@ like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including +* **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. -**Consequence**: A temporary ban from any sort of interaction or public +* **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban +* **Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior,harassment of an +individual or aggression towards or disparagement of classes of individuals. -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression towards or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within +* **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3407fdc9..2e24b43f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,12 +17,18 @@ Thank you for choosing to contribute to DocsGPT! We are all very grateful! ## 🐞 Issues and Pull requests -We value contributions in the form of discussions or suggestions. We recommend taking a look at existing issues and our [roadmap](https://github.com/orgs/arc53/projects/2). +- We value contributions in the form of discussions or suggestions. We recommend taking a look at existing issues and our [roadmap](https://github.com/orgs/arc53/projects/2). + +- If you're interested in contributing code, here are some important things to know: + +- We have a frontend built on React (Vite) and a backend in Python. +======= Before creating issues, please check out how the latest version of our app looks and works by launching it via [Quickstart](https://github.com/arc53/DocsGPT#quickstart) the version on our live demo is slightly modified with login. Your issues should relate to the version that you can launch via [Quickstart](https://github.com/arc53/DocsGPT#quickstart). ### 👨‍💻 If you're interested in contributing code, here are some important things to know: + Tech Stack Overview: - 🌐 Frontend: Built with React (Vite) ⚛️, @@ -57,42 +63,55 @@ Here's a step-by-step guide on how to contribute to DocsGPT: 1. **Fork the Repository:** - Click the "Fork" button at the top-right of this repository to create your fork. -2. **Create and Switch to a New Branch:** +2. **Clone the Forked Repository:** + - Clone the repository using: + ''' shell + git clone https://github.com//DocsGPT.git + ''' + +3. **Keep your Fork in Sync:** + - Before you make any changes, make sure that your fork is in sync to avoid merge conflicts using: + '''shell + git remote add upstream https://github.com/arc53/DocsGPT.git + git pull upstream master + ''' + +4. **Create and Switch to a New Branch:** - Create a new branch for your contribution using: ```shell git checkout -b your-branch-name ``` -3. **Make Changes:** +5. **Make Changes:** - Make the required changes in your branch. -4. **Add Changes to the Staging Area:** +6. **Add Changes to the Staging Area:** - Add your changes to the staging area using: ```shell git add . ``` -5. **Commit Your Changes:** +7. **Commit Your Changes:** - Commit your changes with a descriptive commit message using: ```shell git commit -m "Your descriptive commit message" ``` -6. **Push Your Changes to the Remote Repository:** +8. **Push Your Changes to the Remote Repository:** - Push your branch with changes to your fork on GitHub using: ```shell git push origin your-branch-name ``` -7. **Submit a Pull Request (PR):** +9. **Submit a Pull Request (PR):** - Create a Pull Request from your branch to the main repository. Make sure to include a detailed description of your changes and reference any related issues. -8. **Collaborate:** +10. **Collaborate:** - Be responsive to comments and feedback on your PR. - Make necessary updates as suggested. - Once your PR is approved, it will be merged into the main repository. -9. **Testing:** +11. **Testing:** - Before submitting a Pull Request, ensure your code passes all unit tests. - To run unit tests from the root of the repository, execute: ```shell @@ -101,7 +120,7 @@ Here's a step-by-step guide on how to contribute to DocsGPT: *Note: You should run the unit test only after making the changes to the backend code.* -10. **Questions and Collaboration:** +12. **Questions and Collaboration:** - Feel free to join our Discord. We're very friendly and welcoming to new contributors, so don't hesitate to reach out. Thank you for considering contributing to DocsGPT! 🙏 diff --git a/README.md b/README.md index 8105e67e..8b7e9f37 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ If you don't have enough resources to run it, you can use bitsnbytes to quantize ## QuickStart -Note: Make sure you have Docker installed +Note: Make sure you have [Docker](https://docs.docker.com/engine/install/) installed On Mac OS or Linux, write: @@ -176,7 +176,7 @@ We as members, contributors, and leaders, pledge to make participation in our co ## Many Thanks To Our Contributors - + Contributors diff --git a/docs/pages/Deploying/Railway-Deploying.md b/docs/pages/Deploying/Railway-Deploying.md new file mode 100644 index 00000000..15e2f60a --- /dev/null +++ b/docs/pages/Deploying/Railway-Deploying.md @@ -0,0 +1,254 @@ + +# Self-hosting DocsGPT on Railway + + + +Here's a step-by-step guide on how to host DocsGPT on Railway App. + + + +At first Clone and setup the project locally to run , test and Modify. + + + +### 1. Clone and GitHub SetUp + +a. Open Terminal (Windows Shell or Git bash(recommended)). + + + +b. Type `git clone https://github.com/arc53/DocsGPT.git` + + + +#### Download the package information + + + +Once it has finished cloning the repository, it is time to download the package information from all sources. To do so, simply enter the following command: + + + +`sudo apt update` + + + +#### Install Docker and Docker Compose + + + +DocsGPT backend and worker use Python, Frontend is written on React and the whole application is containerized using Docker. To install Docker and Docker Compose, enter the following commands: + + + +`sudo apt install docker.io` + + + +And now install docker-compose: + + + +`sudo apt install docker-compose` + + + +#### Access the DocsGPT Folder + + + +Enter the following command to access the folder in which the DocsGPT docker-compose file is present. + + + +`cd DocsGPT/` + + + +#### Prepare the Environment + + + +Inside the DocsGPT folder create a `.env` file and copy the contents of `.env_sample` into it. + + + +`nano .env` + + + +Make sure your `.env` file looks like this: + + + +``` + +OPENAI_API_KEY=(Your OpenAI API key) + +VITE_API_STREAMING=true + +SELF_HOSTED_MODEL=false + +``` + + + +To save the file, press CTRL+X, then Y, and then ENTER. + + + +Next, set the correct IP for the Backend by opening the docker-compose.yml file: + + + +`nano docker-compose.yml` + + + +And Change line 7 to: `VITE_API_HOST=http://localhost:7091` + +to this `VITE_API_HOST=http://:7091` + + + +This will allow the frontend to connect to the backend. + + + +#### Running the Application + + + +You're almost there! Now that all the necessary bits and pieces have been installed, it is time to run the application. To do so, use the following command: + + + +`sudo docker-compose up -d` + + + +Launching it for the first time will take a few minutes to download all the necessary dependencies and build. + + + +Once this is done you can go ahead and close the terminal window. + + + +### 2. Pushing it to your own Repository + + + +a. Create a Repository on your GitHub. + + + +b. Open Terminal in the same directory of the Cloned project. + + + +c. Type `git init` + + + +d. `git add .` + + + +e. `git commit -m "first-commit"` + + + +f. `git remote add origin ` + + + +g. `git push git push --set-upstream origin master` + +Your local files will now be pushed to your GitHub Account. :) + + +### 3. Create an Railway Account: + + + +If you haven't already, create or log in to your railway account do it by visiting [Railway](https://railway.app/) + + + +Signup via **GitHub** [Recommended]. + + + +### 4. Start New Project: + + + +a. Open Railway app and Click on "Start New Project." + + + +b. Choose any from the list of options available (Recommended "**Deploy from GitHub Repo**") + + + +c. Choose the required Repository from your Github. + + + +d. Configure and allow access to modify your GitHub content from the pop-up window. + + + +e. Agree to all the terms and conditions. + + + +PS: It may take a few minutes for the account setup to complete. + + + +#### You will get A free trail of $5 (use it for trail and then purchase if satisfied and needed) + + + +### 5. Connecting to Your newly Railway app with GitHub + + + +a. Choose DocsGPT repo from the list of your GitHub repository that you want to deploy now. + + + +b. Click on Deploy now . + + + +![Three Tabs will be there](image.png) + + + +c. Select Variables Tab. + + + +d. Upload the env file here that you used for local setup. + + + +e. Go to Settings Tab now. + + + +f. Go to "Networking" and click on Generate Domain Name, to get the URL of your hosted project. + + + +g. You can update the Root directory, build command, installation command as per need. + +*[However recommended not the disturb these options and leave them as default if not that needed.]* + + + + +Your own DocsGPT is now available at the Generated domain URl. :) \ No newline at end of file diff --git a/docs/pages/Deploying/image.png b/docs/pages/Deploying/image.png new file mode 100644 index 00000000..2100e5b4 Binary files /dev/null and b/docs/pages/Deploying/image.png differ diff --git a/docs/pages/Extensions/react-widget.md b/docs/pages/Extensions/react-widget.md index 63461608..4bc40854 100644 --- a/docs/pages/Extensions/react-widget.md +++ b/docs/pages/Extensions/react-widget.md @@ -1,22 +1,31 @@ -### How to set up react docsGPT widget on your website: +### Setting up the DocsGPT Widget in Your React Project + +### Introduction: +The DocsGPT Widget is a powerful tool that allows you to integrate AI-powered documentation assistance into your web applications. This guide will walk you through the installation and usage of the DocsGPT Widget in your React project. Whether you're building a web app or a knowledge base, this widget can enhance your user experience. ### Installation -Go to your project and install a new dependency: `npm install docsgpt`. +First, make sure you have Node.js and npm installed in your project. Then go to your project and install a new dependency: `npm install docsgpt`. ### Usage -Go to your project and in the file where you want to use the widget, import it: +In the file where you want to use the widget, import it and include the CSS file: ```js import { DocsGPTWidget } from "docsgpt"; import "docsgpt/dist/style.css"; ``` -Then you can use it like this: `` - -DocsGPTWidget takes 3 props: -1. `apiHost` — URL of your DocsGPT API. -2. `selectDocs` — documentation that you want to use for your widget (e.g. `default` or `local/docs1.zip`). -3. `apiKey` — usually it's empty. +Now, you can use the widget in your component like this : +```jsx + +``` +DocsGPTWidget takes 3 **props**: +1. `apiHost` — The URL of your DocsGPT API. +2. `selectDocs` — The documentation source that you want to use for your widget (e.g. `default` or `local/docs1.zip`). +3. `apiKey` — Usually, it's empty. ### How to use DocsGPTWidget with [Nextra](https://nextra.site/) (Next.js + MDX) Install your widget as described above and then go to your `pages/` folder and create a new file `_app.js` with the following content: @@ -32,6 +41,6 @@ export default function MyApp({ Component, pageProps }) { ) } -``` +```