Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- name: Check for committed sensitive data files
run: |
if git diff --name-only origin/main...HEAD 2>/dev/null | grep -qE '^data/(spending|orders)\.json$'; then
if git diff --name-only --diff-filter=ACMR origin/main...HEAD 2>/dev/null | grep -qE '^data/(spending|orders)\.json$'; then
echo "::error::Sensitive data file detected in PR diff (data/spending.json or data/orders.json). Remove it before merging."
exit 1
fi
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/pr-meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: PR Metadata Guard

on:
pull_request:

jobs:
block-runtime-data:
name: Block committed runtime data
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Block data JSON files
run: |
base_ref="${{ github.base_ref }}"
if git diff --name-only --diff-filter=ACMR "origin/${base_ref}...HEAD" | grep -qE '^data/.*\.json$'; then
echo "::error::Runtime data files under data/*.json must not be committed. Keep them local or migrate to a managed database."
exit 1
fi
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ dist/
.env.local
.dev-seed
*.log
data/*.json
!data/.gitkeep
data/audit.log.jsonl
data/spending.json
data/orders.json
data/pharmacy-pricing.sqlite
data/pharmacy-pricing.sqlite-*
data/pharmacy-pricing.sqlite-shm
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ cd dashboard && npm run dev
# 6. Open http://localhost:3000
```

### Local runtime data

CareGuard writes development runtime state under `data/`, including local order history and spending ledgers. Treat this directory as machine-local working data: JSON files under `data/` are ignored by git, and only placeholder/documentation files should be committed.

### Docker dev (one command)

For a single-command boot of the full stack — server, dashboard, redis, prometheus, grafana — use Docker Compose. See [issue #111](https://github.com/harystyleseze/careguard/issues/111).
Expand Down Expand Up @@ -217,7 +221,7 @@ careguard/
│ └── types.ts # Shared TypeScript types
├── scripts/
│ └── setup-wallets.ts # Testnet wallet creation + USDC trustlines
├── data/ # Persisted spending data + orders
├── data/ # Local runtime data (JSON ignored by git)
├── .env.example # Environment variable template
├── QUICKSTART.md # Setup guide
```
Expand Down
1 change: 1 addition & 0 deletions data/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Keep the data directory in git; runtime data files are ignored.
2 changes: 1 addition & 1 deletion data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ These files contain **sensitive financial data**. They must never appear in a co

All paths are listed in `.gitignore`. If you see them untracked in `git status`, do not stage them.

CI will fail any PR where these files appear in the diff (see `.github/workflows/ci.yml`).
CI will fail any PR where these files appear in the diff (see `.github/workflows/pr-meta.yml`).
112 changes: 0 additions & 112 deletions data/orders.json

This file was deleted.

Loading