Skip to content

Commit

Permalink
chore: Migrate docs to docusaurus (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavrajs committed Apr 19, 2021
1 parent f57e7b8 commit 123885a
Show file tree
Hide file tree
Showing 127 changed files with 11,111 additions and 199 deletions.
23 changes: 23 additions & 0 deletions .gitignore
@@ -1 +1,24 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

node_modules

src/css/fonts
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

29 changes: 25 additions & 4 deletions README.md
@@ -1,8 +1,29 @@
## Chatwoot Docs
## Chatwoot Handbook

This repository contains the documentation for self-hosted installations, features in the product and a complete guide on how we run the organization.

This is the repository for the Chatwoot documentation and handbook.
----

___
## Installation

Please feel free to suggest any changes. See our [contributing guide](https://www.chatwoot.com/docs/contributing-guide) and [code of conduct](https://www.chatwoot.com/docs/code-of-conduct) to get started.
```console
yarn install
```

## Local Development

```console
yarn start
```

This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.

## Build

```console
yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

Please feel free to suggest any changes. See our [contributing guide](https://www.chatwoot.com/docs/contributing-guide) to get started.
3 changes: 3 additions & 0 deletions babel.config.js
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
Binary file removed channels/images/twitter/add_agents.png
Binary file not shown.
44 changes: 0 additions & 44 deletions contributing.md

This file was deleted.

28 changes: 0 additions & 28 deletions docs.md

This file was deleted.

59 changes: 59 additions & 0 deletions docs/contributing-guide.md
@@ -0,0 +1,59 @@
---
title: "Contributing Guide"
sidebar_label: "Introduction"
---

This guide will help you get started with Chatwoot! Thank you for taking an interest in contributing to Chatwoot. Before submitting your contribution, please make sure to take a moment and read through the following guidelines:

### Pull Request Guidelines

- Please make sure that you have read the [issue triage guidelines](/docs/handbook/engineering/issue-triage) before you make a contribution.
- We use [git-flow](https://nvie.com/posts/a-successful-git-branching-model/) branching model. The base branch is `develop`
- Please raise your PRs against `develop` branch
- It's okay and encouraged to have multiple small commits as you work on the PR - we will squash the commits before merging.
- For other guidelines, please refer to [PR Guidelines](/docs/handbook/engineering/pr-guidelines)


### Getting Started

- Before starting your work, ensure an [issue](https://github.com/chatwoot/chatwoot/issues) exist for it. If not feel free to create one.
- Add a comment on the issue and wait for the issue to be assigned before you start working on it.
- This helps to avoid multiple people working on similar issues.
- If the solution is complex, propose the solution on the issue and wait for one of the core contributors to approve before going into the implementation.
- This helps in shorter turn around times in merging PRs
- For new feature requests, Provide a convincing reason to add this feature. Real-life business use-cases will be super helpful.
- Feel free to join our [discord community](https://discord.gg/cJXdrwS), if you need further discussions with the core team.

### Developing a new feature:

- Please create the branch in the format `feature/<issue-id>-<issue-name>` (eg: `feature/235-contact-panel`)
- Add accompanying test cases.

### Bug fixes or chores:
- If you are resolving a particular issue, add `fix: Fixes xxxx` (#xxxx is the issue) in your PR title.
- Provide a detailed description of the bug in the PR.
- Add appropriate test coverage if applicable.

### Environment Setup for local development

These guides will help you to setup the environment required for Chatwoot. Follow the guide based on the operating system you use.

* [Mac](/docs/contributing-guide/environment-setup/mac-os)
* [Ubuntu](/docs/contributing-guide/environment-setup/ubuntu)
* [Windows](/docs/contributing-guide/environment-setup/windows)
* [Docker](/docs/contributing-guide/environment-setup/docker)

### Project Setup

Now, that you have completed the environment as mentioned above, use the following guides to setup Chatwoot on your local machine.

* [Quick Setup](/docs/contributing-guide/project-setup)
* [Environment Variables](/docs/contributing-guide/environment-variables)
* [Common Errors](/docs/contributing-guide/common-errors)


### Others

* [Code of conduct](/docs/contributing-guide/code-of-conduct)
* [Translation guidelines](/docs/contributing-guide/translation-guidelines)
* [Contributors](/docs/contributing-guide/contributors)
@@ -1,5 +1,5 @@
---
path: "/docs/code-of-conduct"
sidebar_label: "Code of Conduct"
title: "Contributor Covenant Code of Conduct"
---

Expand Down
@@ -1,12 +1,11 @@
---
path: "/docs/common-errors"
title: "Common Errors"
---

### Errors you might encounter while setting up the project
The following are some of the errors you might encounter while setting up the project.


#### Redis connection error
### Redis connection error

```bash
ArgumentError: invalid uri scheme
Expand All @@ -15,16 +14,16 @@ ArgumentError: invalid uri scheme
This is an error thrown from redis connector. You might not have setup the redis environment variables properly. Please refer to dependencies section to install redis-server and [Configure Redis URL](https://www.chatwoot.com/docs/environment-variables) in the environment-variables section.


#### pg gem Installation error
### pg gem Installation error

If you see the following error while bundle installation, provide the Postgres path as pg_config.

```
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
An error occurred while installing pg (1.2.3), and Bundler cannot
An error occurred while installing pg (x.x.x), and Bundler cannot
continue.
Make sure that `gem install pg -v '1.2.3' --source 'https://rubygems.org/'`
Make sure that `gem install pg -v 'x.x.x' --source 'https://rubygems.org/'`
succeeds before bundling.
checking for pg_config... no
Expand All @@ -35,5 +34,5 @@ No pg_config... trying anyway. If building fails, please try again with
To fix this, try executing

```
gem install pg -v '1.2.3' --source 'https://rubygems.org/' -- --with-pg-config=path-to-postgres-installation/12/bin/pg_config
gem install pg -v 'x.x.x' --source 'https://rubygems.org/' -- --with-pg-config=path-to-postgres-installation/12/bin/pg_config
```
@@ -1,5 +1,4 @@
---
path: "/docs/contributors"
title: "Contributors"
---

Expand Down
@@ -1,12 +1,12 @@
---
path: "/docs/installation-guide-docker"
sidebar_label: "Docker"
title: "Docker Setup"
---

### Pre-requisites
Before proceeding, make sure you have the latest version of `docker` and `docker-compose` installed.

As of now[at the time of writing this doc], we recommend
As of now[at the time of writing this doc], we recommend

```bash
$ docker --version
Expand All @@ -30,7 +30,7 @@ As of now[at the time of writing this doc], we recommend
```

If you want to set the password for redis when you run docker-compose, set any string value to the environment variable `REDIS_PASSWORD` in the `.env` file.
This will secure the redis running inside docker-compose with the given password.
This will secure the redis running inside docker-compose with the given password.
Also this will be automatically picked up by the app server and sidekiq, to authenticate while making connections to redis server.

3. Build the images.
Expand Down Expand Up @@ -96,15 +96,15 @@ To debug the production build locally, set `SECRET_KEY_BASE` environment variabl
To use debuggers like `byebug` or `binding.pry`, use the following command to bring up the app instead of `docker-compose up`.

```bash
$ docker-compose run --rm --service-port rails
$ docker-compose run --rm --service-port rails
```


## Troubleshooting
If there is an update to any of the following
If there is an update to any of the following
- `dockerfile`
- `gemfile`
- `package.json`
- `package.json`
- schema change

Make sure to rebuild the containers and run `db:reset`.
Expand All @@ -114,4 +114,4 @@ Make sure to rebuild the containers and run `db:reset`.
$ docker-compose build
$ docker-compose run --rm rails bundle exec rails db:reset
$ docker-compose up
```
```
@@ -1,5 +1,5 @@
---
path: "/docs/installation-guide-mac-os"
sidebar_label: "Mac OS"
title: "Mac OS installation guide"
---

Expand Down
@@ -1,5 +1,5 @@
---
path: "/docs/installation-guide-ubuntu"
sidebar_label: "Ubuntu"
title: "Ubuntu installation guide"
---

Expand Down
@@ -1,5 +1,5 @@
---
path: '/docs/installation-guide-windows'
sidebar_label: "Windows 10"
title: 'Windows 10 Installation Guide'
---

Expand All @@ -9,11 +9,11 @@ You need to install the Linux Subsystem for Windows.

1. The first step is to enable "Developer mode" in Windows. You can do this by opening up Settings and navigating to "Update & Security". In there, choose the tab on the left that reads "For Developers". Turn the "Developer mode" toggle on to enable it.

<img src="./img/developer-mode.jpg" width="500" alt="Enable Developer Mode" style="display: block; margin-left: auto; margin-right: auto;">
<img src="./img/developer-mode.jpg" width="500" alt="Enable Developer Mode" />

2. Next you have to enable the Windows Subsystem for Linux. Open the "Control Panel" and go to "Programs and Features". Click on the link on the left "Turn Windows features on or off". Look for the "Windows Subsystem for Linux" option and select the checkbox next to it.

<img src="./img/enable-wsl.jpg" width="500" alt="Enable WSL" style="display: block; margin-left: auto; margin-right: auto;">
<img src="./img/enable-wsl.jpg" width="500" alt="Enable WSL" />

3. Once that's complete, you can open up the Start Menu again and search for "Bash". This time it will have the Ubuntu logo.

Expand Down
15 changes: 15 additions & 0 deletions docs/contributing-guide/environment-variables.md
@@ -0,0 +1,15 @@
---
title: 'Environment variables'
---

For a complete set of production environment variables, please refer to [Production Environment Variables Guide](/docs/self-hosted/configuration/environment-variables)

In addition to the above variables, you can use the following variables in development mode.

### Use letter opener instead of mailhog/SMTP

Set the following variable to open emails in letter opener instead of SMTP

```
LETTER_OPENER=true
```
@@ -1,8 +1,10 @@
---
path: "/docs/quick-setup"
title: "Quick Setup"
sidebar_label: "Setup Guide"
title: "Project Setup"
---

This guide will help you to setup and run Chatwoot in development mode. Please make sure you have completed the environment setup.

### Install Ruby dependencies

Use the following command to install ruby dependencies.
Expand All @@ -11,7 +13,7 @@ Use the following command to install ruby dependencies.
bundle
```

If you face issue with pg gem, please refer to [Common Errors](/docs/common-errors#pg-gem-installation-error)
If you face issue with pg gem, please refer to [Common Errors](/docs/contributing-guide/common-errors#pg-gem-installation-error)

### Install JavaScript dependencies

Expand All @@ -27,7 +29,7 @@ This would install all required dependencies for Chatwoot application.
cp .env.example .env
```

Please refer to [environment-variables](./environment-variables) to read on setting environment variables.
Please refer to [environment-variables](/docs/contributing-guide/environment-variables) to read on setting environment variables.

### Setup rails server

Expand Down

0 comments on commit 123885a

Please sign in to comment.