|
| 1 | +# Setup Guide |
| 2 | + |
| 3 | +This guide gets the FireForm backend running locally with Docker. It assumes you are comfortable with git and a terminal, but new to this project. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- [Docker](https://docs.docker.com/get-docker/) **24 or newer**, with the Docker daemon running |
| 8 | +- Docker Compose v2 (bundled with Docker Desktop; verify with `docker compose version`) |
| 9 | +- `make` |
| 10 | +- ~3 GB of free disk space (Docker images + LLM model weights) |
| 11 | + |
| 12 | +## Setup |
| 13 | + |
| 14 | +### 1. Clone the repository |
| 15 | + |
| 16 | +```bash |
| 17 | +git clone https://github.com/fireform-core/FireForm.git |
| 18 | +cd FireForm |
| 19 | +``` |
| 20 | + |
| 21 | +### 2. Run first-time setup |
| 22 | + |
| 23 | +```bash |
| 24 | +make init |
| 25 | +``` |
| 26 | + |
| 27 | +This will: |
| 28 | + |
| 29 | +1. Check that Docker meets the requirements above |
| 30 | +2. Create `docker/.env.dev` from `docker/.env.example` (gitignored; defaults work out of the box) |
| 31 | +3. Prompt you to pick an Ollama model (the default, `qwen2.5:1.5b`, is the smallest and fine for development) |
| 32 | +4. Offer to build and start everything answer `y`, or run `make fireform` later |
| 33 | + |
| 34 | +### 3. Build and start (if you skipped it in step 2) |
| 35 | + |
| 36 | +```bash |
| 37 | +make fireform |
| 38 | +``` |
| 39 | + |
| 40 | +This builds the Docker images, starts the containers, waits for Ollama, and pulls the LLM model. The first run takes several minutes (image build + model download); later runs are fast. |
| 41 | + |
| 42 | +When it finishes you'll see: |
| 43 | + |
| 44 | +``` |
| 45 | +FireForm is ready! |
| 46 | + API: http://localhost:8000 |
| 47 | + API Docs: http://localhost:8000/docs |
| 48 | +``` |
| 49 | + |
| 50 | +### 4. Verify it works |
| 51 | + |
| 52 | +Open **http://localhost:8000/docs** in your browser. This is the interactive Swagger UI you can explore and test every API endpoint directly from there (expand an endpoint, click _Try it out_, then _Execute_). |
| 53 | + |
| 54 | +## Day-to-day commands |
| 55 | + |
| 56 | +| Command | What it does | |
| 57 | +| ------------ | ------------------------------------------------------------------------ | |
| 58 | +| `make up` | Start containers | |
| 59 | +| `make down` | Stop containers (data is preserved) | |
| 60 | +| `make logs` | Stream all container logs (`make logs-app` / `make logs-ollama` for one) | |
| 61 | +| `make shell` | Open a shell inside the app container | |
| 62 | +| `make test` | Run the test suite | |
| 63 | +| `make help` | List all commands | |
| 64 | + |
| 65 | +The dev container mounts the source code, so code changes reload automatically — no rebuild needed. Rebuild (`make build`) only when dependencies in `requirements.txt` or the Dockerfile change. |
| 66 | + |
| 67 | +## Frontend (optional) |
| 68 | + |
| 69 | +The desktop/web frontend lives in a separate repository: |
| 70 | + |
| 71 | +```bash |
| 72 | +git clone https://github.com/fireform-core/fireform-frontend.git |
| 73 | +``` |
| 74 | + |
| 75 | +Follow the README in that repository to run it. The backend from this guide must be running for the frontend to work. |
| 76 | + |
| 77 | +## Troubleshooting |
| 78 | + |
| 79 | +**`make init` fails dependency checks** |
| 80 | +Docker isn't running or is too old. Start Docker Desktop (or the Docker daemon) and confirm `docker version` reports 24+. |
| 81 | + |
| 82 | +**Port 8000 already in use** |
| 83 | +Another process is bound to the port. Either stop it, or change `APP_PORT` in `docker/.env.dev` and run `make down && make up`. |
| 84 | + |
| 85 | +**Model pull is slow or times out** |
| 86 | +The first `make fireform` downloads the LLM weights (~1 GB for the default model). On a slow connection just wait, or re-run `make pull-model` it resumes safely. |
| 87 | + |
| 88 | +**Containers start but the API doesn't respond** |
| 89 | +Check `make logs-app` for the actual error. The entrypoint runs database migrations on startup, so the API takes a few seconds after the container starts. |
| 90 | + |
| 91 | +**Want a clean slate** |
| 92 | +`make super-clean` stops everything and **deletes all volumes** database, uploads, and downloaded model weights. Only use it when you intend to wipe all local data. |
| 93 | + |
| 94 | +## Where to go next |
| 95 | + |
| 96 | +- **Join our [Discord](https://discord.gg/nBv5b6kF68)** — ask questions and coordinate with other contributors |
| 97 | +- [CONTRIBUTING.md](../CONTRIBUTING.md) - how to contribute |
| 98 | +- [docker/README.md](../docker/README.md) - Docker layout, env vars, and volumes in detail |
0 commit comments