Initial Firmware chat web app
This commit is contained in:
84
README.md
Normal file
84
README.md
Normal file
@@ -0,0 +1,84 @@
|
||||
# Firmware Chat Web
|
||||
|
||||
ChatGPT-like web app backed by Firmware (https://docs.firmware.ai/) with SQLite logging and admin read-only APIs.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js 22+
|
||||
- `FIRMWARE_API_KEY` must be exported in your shell
|
||||
- `ADMIN_TOKEN` (protects admin endpoints)
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
npm install
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Edit `.env`:
|
||||
|
||||
```bash
|
||||
ADMIN_TOKEN=...
|
||||
```
|
||||
|
||||
Export your Firmware key in the same shell you run the app:
|
||||
|
||||
```bash
|
||||
export FIRMWARE_API_KEY=...
|
||||
```
|
||||
|
||||
Note: `.env` is loaded by `./run.sh` for non-secret config (like `ADMIN_TOKEN`, `PORT`).
|
||||
|
||||
## Run (dev)
|
||||
|
||||
```bash
|
||||
./run.sh dev
|
||||
```
|
||||
|
||||
- Web: http://localhost:5173
|
||||
- API: http://localhost:8787
|
||||
|
||||
## Run on LAN (example: 192.168.88.2)
|
||||
|
||||
Set in `.env`:
|
||||
|
||||
```bash
|
||||
HOST=0.0.0.0
|
||||
PORT=8787
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
./run.sh build
|
||||
./run.sh server
|
||||
```
|
||||
|
||||
Open from another device:
|
||||
|
||||
- http://192.168.88.2:8787
|
||||
|
||||
## Run (prod-ish)
|
||||
|
||||
```bash
|
||||
./run.sh build
|
||||
./run.sh server
|
||||
```
|
||||
|
||||
## Admin APIs
|
||||
|
||||
Send `x-admin-token: $ADMIN_TOKEN`:
|
||||
|
||||
- `GET /api/logs`
|
||||
- `GET /api/logs/:request_id`
|
||||
- `GET /api/stats/summary`
|
||||
- `GET /api/stats/models`
|
||||
- `GET /api/stats/timeseries`
|
||||
|
||||
## Admin UI (browser)
|
||||
|
||||
Open:
|
||||
|
||||
- `/admin`
|
||||
|
||||
Enter `ADMIN_TOKEN` once to start a cookie-based session.
|
||||
Reference in New Issue
Block a user