hexabot/docs/developer-guide/developers-installation-guide.md

68 lines
2.4 KiB
Markdown
Raw Normal View History

2024-09-20 18:24:19 +00:00
# Developers Installation Guide
2024-09-13 15:48:51 +00:00
## Prerequisites
To ensure Hexabot runs smoothly, you'll need the following:
* **Docker:** We recommend using Docker to start the app since multiple services are required (MongoDB, Redis, Prometheus, etc.). All the necessary Docker Compose files are located in the docker folder.
* **Node.js:** For development purposes, ensure you have Node.js >= v18.17.0 installed. We recommend using nvm (Node Version Manager) to easily manage and update your Node.js versions.
2024-09-22 18:14:13 +00:00
### Installation
2024-09-13 15:48:51 +00:00
1. **Clone the Repository:**
```
$ git clone https://github.com/hexastack/hexabot.git
```
2024-10-02 16:25:24 +00:00
2. **Installation:**
Install node dependencies:
```
$ git clone https://github.com/hexastack/hexabot.git
```
2. **Environment Setup:** 
To configure the environment variables, use the Makefile at the root folder for initialization:
2024-09-13 15:48:51 +00:00
```
2024-10-02 16:25:24 +00:00
$ npx hexabot init
2024-09-13 15:48:51 +00:00
```
This will copy the `.env.example` file to `.env` in the `./docker` directory if the file does not already exist.
2024-09-20 18:24:19 +00:00
3. **Running the Application in development mode:** Once your environment is set up, you can start the app. Use either of the following commands:
2024-09-13 15:48:51 +00:00
```
2024-10-02 16:25:24 +00:00
$ npx hexabot dev
2024-09-13 15:48:51 +00:00
```
2024-09-20 18:24:19 +00:00
**Note:** The first time you run the app, Docker will take some time to build all the required Docker images cache the layers.
2024-09-13 15:48:51 +00:00
### Usage
UI Admin Panel is accessible via [http://localhost:8080](http://localhost:8080), the default credentials are :
* **Username:** [admin@admin.admin](mailto:admin@admin.admin)
* **Password:** adminadmin
Live Chat Widget is accessible via [http://localhost:5173](http://localhost:5173)
### Useful Commands
2024-10-02 16:25:24 +00:00
* `npx hexabot init` : Copies the .env.example file to .env in the ./docker directory if .env does not exist. This is usually used for initial setup.
* `npx hexabot dev` : Builds the Docker images locally before starting the services in development mode. It first checks the .env file for completeness against .env.example.
* `npx hexabot start` : Starts the app by pulling the Docker images from Docker Hub. This target also checks the .env file for required variables.
* `npx hexabot stop` : Stops all running Docker services defined in the compose files.
* `npx hexabot destroy` : Stops all services and removes all volumes associated with the Docker compose setup, ensuring a clean state.
2024-09-13 15:48:51 +00:00
Example on how to start the stack by adding the Nginx service :
```
2024-10-02 16:25:24 +00:00
npx hexabot start --enable=nginx
2024-09-13 15:48:51 +00:00
```