f500db971b
build-and-push / build-and-push (push) Successful in 1m26s
Fastify + node:sqlite single-process app with vanilla JS UI for looking up hosts by hardware ID, hostname, or asset ID. Includes per-host network interface tracking, sites/rooms/server-types CRUD, Docker packaging, and a Gitea Actions workflow that runs tests then builds and pushes to gitea.thewrightserver.net/josh/infrastructure. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
42 lines
1022 B
Markdown
42 lines
1022 B
Markdown
# Infrastructure
|
|
|
|
A small internal tool for tracking servers. Search hosts by hardware ID, hostname, or asset ID; manage where they live (site / room / position) and what kind of server they are. Browser UI plus a JSON API.
|
|
|
|
## Run
|
|
|
|
```sh
|
|
npm install
|
|
npm start
|
|
```
|
|
|
|
UI on `http://localhost:3000`, API at `http://localhost:3000/api`.
|
|
|
|
## Test
|
|
|
|
```sh
|
|
npm test
|
|
```
|
|
|
|
## Docker
|
|
|
|
```sh
|
|
docker compose up --build
|
|
```
|
|
|
|
Data persists in the `infrastructure-data` named volume.
|
|
|
|
## API
|
|
|
|
| Method | Path | Notes |
|
|
|---|---|---|
|
|
| GET | `/api/hosts?q=` | Substring search across `hardware_id`, `hostname`, `asset_id`. Capped at 200 results. |
|
|
| GET | `/api/hosts/:id` | Fetch one. |
|
|
| POST | `/api/hosts` | Create. |
|
|
| PUT | `/api/hosts/:id` | Replace. |
|
|
| DELETE | `/api/hosts/:id` | Hard delete. |
|
|
| `*` | `/api/sites[/:id]` | Site CRUD. |
|
|
| `*` | `/api/rooms[/:id]` | Room CRUD (`?site_id=` filter on GET). |
|
|
| `*` | `/api/server-types[/:id]` | Server-type CRUD. |
|
|
|
|
Errors: `{ error, details? }` with status 400 / 404 / 409 / 500.
|