diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..ae930a0 --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +# Copy this file to `.env` and adjust variables as needed +# URL of your LLM agent +LLM_AGENT_URL=http://localhost:8000 +# URL of the WhatsApp gateway +OPEN_WA_URL=https://whatsappbot.interno.com/ +# Optional custom ports +PORT=3000 +ROUTER_PORT=3001 diff --git a/Makefile b/Makefile index c6b3a5e..4c21306 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: sync-from-github sync-to-github +.PHONY: sync-from-github sync-to-github chat router # Pull latest changes from the GitHub mirror and push them to Gitea sync-from-github: @@ -8,3 +8,13 @@ sync-from-github: # Push local changes to the GitHub mirror sync-to-github: git push github main + +# Start the chat UI locally (uses variables from .env if present) +chat: + @set -a; [ -f .env ] && . .env || true; set +a; \ + cd chat-ui && npm install && npm run build && npm start + +# Start the WhatsApp router locally (uses variables from .env if present) +router: + @set -a; [ -f .env ] && . .env || true; set +a; \ + cd whatsapp-router && npm install && npm run build && npm start diff --git a/README.md b/README.md index c579a24..9b612c2 100644 --- a/README.md +++ b/README.md @@ -19,3 +19,12 @@ docker-compose up --build ``` The chat UI will be available on [http://localhost:3000](http://localhost:3000). Open-wa exposes its API on port `8080` and the WhatsApp router listens on port `3001`. +Alternatively you can run the chat UI and router locally using Make: + +```bash +make chat # start chat-ui +make router # start whatsapp-router +``` + +Both targets read configuration from a `.env` file if it exists (see `.env.example`). +