summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md47
1 files changed, 39 insertions, 8 deletions
diff --git a/README.md b/README.md
index 9f1de30..d41c8d6 100644
--- a/README.md
+++ b/README.md
@@ -24,6 +24,8 @@ The implementation copies and adapts finance logic from Prism v1 into `backend/`
- `components/PriceChart.tsx` Plotly price chart
- `lib/api.ts` typed REST client
- `types/api.ts` shared frontend response types
+- `scripts/stack.sh` unified start/stop/restart/status script
+- `systemd/` systemd unit files for running as a system service
- `.env.example` optional environment variables
- `pytest.ini` backend pytest import path config
@@ -95,23 +97,52 @@ The UI stores the selected ticker in the URL, for example `/?ticker=AAPL`.
## Quick Start
-Start the whole local stack:
+`scripts/stack.sh` manages both services as a local development stack:
```bash
-./scripts/start-stack.sh
+./scripts/stack.sh start # start backend + frontend in background
+./scripts/stack.sh stop # stop both
+./scripts/stack.sh restart # stop then start
+./scripts/stack.sh status # show running PIDs and URLs
```
-Stop both services:
+Notes:
+
+- expects `backend/.venv` and `frontend/node_modules` to already exist
+- default ports are backend `8001` and frontend `3001`
+- logs are written to `.run/logs/`
+- override hosts/ports via env vars: `BACKEND_HOST`, `BACKEND_PORT`, `FRONTEND_HOST`, `FRONTEND_PORT`
+
+## Running as a systemd Service
+
+Unit files live in `systemd/`. Install them for the current user:
```bash
-./scripts/stop-stack.sh
+# Copy units
+cp systemd/prismv2-backend.service ~/.config/systemd/user/
+cp systemd/prismv2-frontend.service ~/.config/systemd/user/
+cp systemd/prismv2.target ~/.config/systemd/user/
+
+systemctl --user daemon-reload
+
+# Start both services via the target
+systemctl --user enable --now prismv2.target
+
+# Control individual services
+systemctl --user status prismv2-backend.service
+systemctl --user restart prismv2-frontend.service
+systemctl --user stop prismv2.target
+
+# View logs
+journalctl --user -u prismv2-backend.service -f
+journalctl --user -u prismv2-frontend.service -f
```
-Notes:
+To start automatically on login, enable lingering once:
-- the scripts expect `backend/.venv` and `frontend/node_modules` to already exist
-- default ports are backend `8001` and frontend `3001`
-- logs are written to `.run/logs/`
+```bash
+loginctl enable-linger $USER
+```
## Verification