61 lines
1.6 KiB
Markdown
61 lines
1.6 KiB
Markdown
# 🚀 Quick Start Guide
|
||
|
||
Follow this step‑by‑step guide to spin up the **fx-test** service stack locally. The instructions assume you have Docker, Docker‑Compose, and Git installed.
|
||
|
||
## 1️⃣ Clone the Repository
|
||
|
||
```bash
|
||
git clone https://git.vish.gg/Vish/fx-test.git
|
||
cd fx-test
|
||
```
|
||
|
||
## 2️⃣ Build & Deploy
|
||
|
||
The repository uses Docker‑Compose stacks wrapped in a **GitOps** pattern. The simplest way to start the stack locally is with the provided `run_dev.sh` script.
|
||
|
||
```bash
|
||
./fluxer/scripts/run_dev.sh
|
||
```
|
||
|
||
* The script pulls the latest code, compiles the Erlang project, builds the Docker image, and spins up the stack via `docker-compose`.
|
||
|
||
## 3️⃣ Verify the Service
|
||
|
||
Once the containers are running, you can verify the API endpoints:
|
||
|
||
```bash
|
||
# Port 8080 – WS API
|
||
curl http://localhost:8080
|
||
# Port 8090 – HTTP API
|
||
curl http://localhost:8090/health
|
||
```
|
||
|
||
Both should respond with JSON payloads confirming the service is healthy.
|
||
|
||
## 4️⃣ Interacting with the WebSocket
|
||
|
||
Use `wscat` (or any `ws` client) to open a connection:
|
||
|
||
```bash
|
||
npm install -g wscat
|
||
wscat -c ws://localhost:8080
|
||
```
|
||
|
||
Send a simple test message:
|
||
|
||
```json
|
||
{"type":"ping"}
|
||
```
|
||
|
||
You'll receive a `pong` response if the relay is working.
|
||
|
||
---
|
||
|
||
### Troubleshooting Tips
|
||
|
||
| Symptom | Likely Cause | Fix |
|
||
|---------|--------------|-----|
|
||
| Containers exit instantly | Build step failed | Check CI logs, rebuild locally with `make` |
|
||
| HTTP endpoints return **503** | Health check script misconfigured | Verify `/fluxer/config/health_check.json` |
|
||
| WebSocket not reachable | Port blocked | Ensure OS firewall allows 8080 |
|