mirror of
https://github.com/hexastack/hexabot
synced 2024-11-28 06:52:20 +00:00
Merge pull request #132 from Hexastack/fix/remove-makefile
fix: update readme and remove makefile
This commit is contained in:
commit
6c02022d16
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -82,5 +82,5 @@ jobs:
|
|||||||
cd /home/***/hexabot
|
cd /home/***/hexabot
|
||||||
git checkout release
|
git checkout release
|
||||||
git pull origin release
|
git pull origin release
|
||||||
make stop NLU=1
|
npx hexabot stop --enable=nlu
|
||||||
make start NLU=1
|
npx hexabot start --enable=nlu
|
||||||
|
60
Makefile
60
Makefile
@ -1,60 +0,0 @@
|
|||||||
# Makefile
|
|
||||||
FOLDER := ./docker
|
|
||||||
|
|
||||||
# The services that can be toggled
|
|
||||||
SERVICES := nginx nlu smtp4dev
|
|
||||||
|
|
||||||
# Function to dynamically add Docker Compose files based on enabled services
|
|
||||||
define compose_files
|
|
||||||
$(foreach service,$(SERVICES),$(if $($(shell echo $(service) | tr a-z A-Z)), -f $(FOLDER)/docker-compose.$(service).yml))
|
|
||||||
endef
|
|
||||||
|
|
||||||
# Function to dynamically add Docker Compose dev files based on enabled services and file existence
|
|
||||||
define compose_dev_files
|
|
||||||
$(foreach service,$(SERVICES), \
|
|
||||||
$(if $($(shell echo $(service) | tr a-z A-Z)), \
|
|
||||||
$(if $(shell [ -f $(FOLDER)/docker-compose.$(service).dev.yml ] && echo yes), -f $(FOLDER)/docker-compose.$(service).dev.yml)))
|
|
||||||
endef
|
|
||||||
|
|
||||||
# Function to dynamically add Docker Compose dev files based on enabled services and file existence
|
|
||||||
define compose_prod_files
|
|
||||||
$(foreach service,$(SERVICES), \
|
|
||||||
$(if $($(shell echo $(service) | tr a-z A-Z)), \
|
|
||||||
$(if $(shell [ -f $(FOLDER)/docker-compose.$(service).prod.yml ] && echo yes), -f $(FOLDER)/docker-compose.$(service).dev.yml)))
|
|
||||||
endef
|
|
||||||
|
|
||||||
# Ensure .env file exists and matches .env.example
|
|
||||||
check-env:
|
|
||||||
@if [ ! -f "$(FOLDER)/.env" ]; then \
|
|
||||||
echo "Error: .env file does not exist. Creating one now from .env.example ..."; \
|
|
||||||
cp $(FOLDER)/.env.example $(FOLDER)/.env; \
|
|
||||||
fi
|
|
||||||
@echo "Checking .env file for missing variables..."
|
|
||||||
@awk -F '=' 'NR==FNR {a[$$1]; next} !($$1 in a) {print "Missing env var: " $$1}' $(FOLDER)/.env $(FOLDER)/.env.example
|
|
||||||
|
|
||||||
init:
|
|
||||||
cp $(FOLDER)/.env.example $(FOLDER)/.env
|
|
||||||
|
|
||||||
# Start command: runs docker-compose with the main file and any additional service files
|
|
||||||
start: check-env
|
|
||||||
@docker compose -f $(FOLDER)/docker-compose.yml $(call compose_files) up -d
|
|
||||||
|
|
||||||
# Dev command: runs docker-compose with the main file, dev file, and any additional service dev files (if they exist)
|
|
||||||
dev: check-env
|
|
||||||
@docker compose -f $(FOLDER)/docker-compose.yml -f $(FOLDER)/docker-compose.dev.yml $(call compose_files) $(call compose_dev_files) up --build -d
|
|
||||||
|
|
||||||
# Start command: runs docker-compose with the main file and any additional service files
|
|
||||||
start-prod: check-env
|
|
||||||
@docker compose -f $(FOLDER)/docker-compose.yml -f $(FOLDER)/docker-compose.prod.yml $(call compose_files) $(call compose_prod_files) up -d
|
|
||||||
|
|
||||||
# Stop command: stops the running containers
|
|
||||||
stop:
|
|
||||||
@docker compose -f $(FOLDER)/docker-compose.yml -f $(FOLDER)/docker-compose.dev.yml $(call compose_files) $(call compose_dev_files) $(call compose_prod_files) down
|
|
||||||
|
|
||||||
# Destroy command: stops the running containers and removes the volumes
|
|
||||||
destroy:
|
|
||||||
@docker compose -f $(FOLDER)/docker-compose.yml -f $(FOLDER)/docker-compose.dev.yml $(call compose_files) $(call compose_dev_files) $(call compose_prod_files) down -v
|
|
||||||
|
|
||||||
# Migrate command:
|
|
||||||
migrate-up:
|
|
||||||
@docker compose -f $(FOLDER)/docker-compose.yml -f $(FOLDER)/docker-compose.dev.yml $(call compose_files) $(call compose_dev_files) up --no-deps -d database-init
|
|
41
README.md
41
README.md
@ -4,8 +4,10 @@
|
|||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
[Hexabot](https://hexabot.ai/) Community Edition is an open-source chatbot solution that allows users to create and manage AI-powered, multi-channel, and multilingual chatbots with ease. Hexabot is designed for flexibility and customization, offering powerful text-to-action capabilities. Originally a closed-source project (version 1), we've now open-sourced version 2 to contribute to the community and enable developers to customize and extend the platform with extensions.
|
[Hexabot](https://hexabot.ai/) is an open-source chatbot solution that allows users to create and manage AI-powered, multi-channel, and multilingual chatbots with ease. Hexabot is designed for flexibility and customization, offering powerful text-to-action capabilities. Originally a closed-source project (version 1), we've now open-sourced version 2 to contribute to the community and enable developers to customize and extend the platform with extensions.
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://www.producthunt.com/posts/hexabot?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-hexabot" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=477532&theme=light" alt="Hexabot - Create exceptional chatbot experiences. 100% Open Source. | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Analytics Dashboard:** Monitor chatbot interactions and performance with insightful metrics and visualizations.
|
- **Analytics Dashboard:** Monitor chatbot interactions and performance with insightful metrics and visualizations.
|
||||||
@ -43,24 +45,36 @@ To ensure Hexabot runs smoothly, you'll need the following:
|
|||||||
$ git clone https://github.com/hexastack/hexabot.git
|
$ 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:
|
2. **Install:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ make init
|
$ npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Environment Setup:** To configure the environment variables, use the following command at the root folder for initialization:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npx hexabot init
|
||||||
```
|
```
|
||||||
|
|
||||||
This will copy the `.env.example` file to `.env` in the `./docker` directory if the file does not already exist.
|
This will copy the `.env.example` file to `.env` in the `./docker` directory if the file does not already exist.
|
||||||
|
|
||||||
3. **Running the Application:** Once your environment is set up, you can start the app. Use either of the following commands:
|
4. **Running the Application:** Once your environment is set up, you can start the app. Use either of the following commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ make start
|
$ npx hexabot start
|
||||||
```
|
```
|
||||||
|
|
||||||
or for development mode:
|
or for development mode:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ make dev
|
$ npx hexabot dev
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also enable services such as the NLU engine or Nginx :
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npx hexabot --enable=nlu
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** The first time you run the app, Docker will take some time to download all the required images.
|
**Note:** The first time you run the app, Docker will take some time to download all the required images.
|
||||||
@ -76,17 +90,16 @@ Live Chat Widget is accessible via http://localhost:5173
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
- `make 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 init` : Copies the .env.example file to .env in the ./docker directory if .env does not exist. This is usually used for initial setup.
|
||||||
- `make dev` : Starts all configured Docker services in development mode. It first checks the .env file for completeness against .env.example and builds the docker images locally.
|
- `npx hexabot dev` : Starts all configured Docker services in development mode. It first checks the .env file for completeness against .env.example and builds the docker images locally.
|
||||||
- `make start` : Starts all configured Docker services by loading all images from Docker Hub. This target also checks the .env file for required variables.
|
- `npx hexabot start` : Starts all configured Docker services by loading all images from Docker Hub. This target also checks the .env file for required variables.
|
||||||
- `make stop` : Stops all running Docker services defined in the compose files.
|
- `npx hexabot stop` : Stops all running Docker services defined in the compose files.
|
||||||
- `make destroy` : Stops all services and removes all volumes associated with the Docker compose setup, ensuring a clean state.
|
- `npx hexabot destroy` : Stops all services and removes all volumes associated with the Docker compose setup, ensuring a clean state.
|
||||||
- `make check-env` : Checks if the ./docker/.env file exists and contains all the necessary environment variables as defined in ./docker/.env.example. If the file does not exist, it is created from the example. It also lists missing variables if any.
|
|
||||||
|
|
||||||
Example on how to start the stack by adding the Nginx service :
|
Example on how to start the stack by adding the Nginx service :
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make start NGINX=1
|
npx hexabot start --enable=nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
@ -105,6 +118,8 @@ You can also find specific documentation for different components of the project
|
|||||||
We welcome contributions from the community! Whether you want to report a bug, suggest new features, or submit a pull request, your input is valuable to us.
|
We welcome contributions from the community! Whether you want to report a bug, suggest new features, or submit a pull request, your input is valuable to us.
|
||||||
|
|
||||||
Please refer to our contribution policy first : [How to contribute to Hexabot](./CONTRIBUTING.md)
|
Please refer to our contribution policy first : [How to contribute to Hexabot](./CONTRIBUTING.md)
|
||||||
|
|
||||||
|
|
||||||
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](./CODE_OF_CONDUCT.md)
|
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](./CODE_OF_CONDUCT.md)
|
||||||
|
|
||||||
Feel free to join us on [Discord](https://discord.gg/rNb9t2MFkG)
|
Feel free to join us on [Discord](https://discord.gg/rNb9t2MFkG)
|
||||||
|
@ -8,6 +8,5 @@ node_modules
|
|||||||
.husky
|
.husky
|
||||||
.prettierrc
|
.prettierrc
|
||||||
coverage*
|
coverage*
|
||||||
Makefile
|
|
||||||
README.md
|
README.md
|
||||||
test
|
test
|
||||||
|
@ -25,8 +25,6 @@
|
|||||||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
||||||
"test:e2e": "jest --config ./test/jest-e2e.json",
|
"test:e2e": "jest --config ./test/jest-e2e.json",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"containers:restart": "cd .. && make init && make stop && make start",
|
|
||||||
"containers:rebuild": "cd .. && make init && make destroy && make start",
|
|
||||||
"reset": "npm install && npm run containers:restart",
|
"reset": "npm install && npm run containers:restart",
|
||||||
"reset:hard": "npm clean-install && npm run containers:rebuild",
|
"reset:hard": "npm clean-install && npm run containers:rebuild",
|
||||||
"migrate": "./node_modules/ts-migrate-mongoose/dist/cjs/bin.js --config-path ./migrations/config/migrate.ts",
|
"migrate": "./node_modules/ts-migrate-mongoose/dist/cjs/bin.js --config-path ./migrations/config/migrate.ts",
|
||||||
|
@ -30,7 +30,7 @@ MONGO_PASSWORD=dev_only
|
|||||||
MONGO_URI=mongodb://${MONGO_USER}:${MONGO_PASSWORD}@mongo:27017/
|
MONGO_URI=mongodb://${MONGO_USER}:${MONGO_PASSWORD}@mongo:27017/
|
||||||
MONGO_DB=hexabot
|
MONGO_DB=hexabot
|
||||||
|
|
||||||
# SMTP Config (for local dev env, use smtp4dev by doing `make start SMTP4DEV=1`)
|
# SMTP Config (for local dev env, use smtp4dev by doing `npx hexabot start --enable=smtp4dev`)
|
||||||
APP_SMTP_4_DEV_PORT=9002
|
APP_SMTP_4_DEV_PORT=9002
|
||||||
EMAIL_SMTP_ENABLED=false
|
EMAIL_SMTP_ENABLED=false
|
||||||
EMAIL_SMTP_HOST=smtp4dev
|
EMAIL_SMTP_HOST=smtp4dev
|
||||||
|
Loading…
Reference in New Issue
Block a user