feat[agent]: add monitoring script and improvement roadmap
This commit is contained in:
parent
7ad1119349
commit
66da3e32f8
2 changed files with 69 additions and 0 deletions
36
AGENT_INSIGHTS.md
Normal file
36
AGENT_INSIGHTS.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# Agent Insights & Improvement Roadmap
|
||||
|
||||
## Security
|
||||
- Remove hard‑coded admin password (`admin123`).
|
||||
- Add role‑based middleware (`requireRole`) for all protected routes.
|
||||
|
||||
## Database
|
||||
- Migrate to versioned Supabase migrations (`supabase/migrate.sh`).
|
||||
- Add soft‑delete columns (`deleted_at`) for loads/payments.
|
||||
|
||||
## CI/CD
|
||||
- GitHub Actions workflow to build Docker image and trigger Coolify deployment via its API.
|
||||
- Run lint, prettier, and unit tests on each PR.
|
||||
|
||||
## Observability
|
||||
- Integrate Pino logger and Prometheus metrics (`/metrics`).
|
||||
- Nightly `pg_dump` cron job to S3/MinIO for backups.
|
||||
|
||||
## Testing
|
||||
- Scaffold Jest unit tests for Load CRUD and Shipper totals.
|
||||
- Add integration smoke test that starts the server and hits `/health`.
|
||||
|
||||
## Front‑end UX
|
||||
- Debounced search + status filter on Loads list page.
|
||||
- Internationalisation via `locales/*.json`.
|
||||
- Cache‑busting asset versioning.
|
||||
|
||||
## Documentation
|
||||
- Complete `README.md` with setup, migrations, testing, and deployment steps.
|
||||
|
||||
## Next Steps (commits to be made)
|
||||
1. **Security Fix** – remove default admin password, add `requireRole` middleware.
|
||||
2. **CI/CD Workflow** – create `.github/workflows/deploy.yml`.
|
||||
3. **Backup Cron** – add script `scripts/pg_backup.sh` and cron job.
|
||||
4. **Test Suite** – add `tests/unit/loads.test.js` and npm script.
|
||||
5. **UI Polish** – add search bar and i18n support.
|
||||
33
freightdesk-repo-sync.sh
Normal file
33
freightdesk-repo-sync.sh
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REMOTE="http://a33b1586cb5b33b42823758d237202ceeaff12e1@forgejo-vil3xyowqk0qsh4hiqy77e3h.187.127.178.110.sslip.io/iamcoolvivek007/freightdesk.git"
|
||||
REPO_DIR="/workspace/freightdesk"
|
||||
|
||||
cd "$REPO_DIR"
|
||||
|
||||
# Fetch latest
|
||||
git fetch origin master --quiet 2>/dev/null || {
|
||||
echo "⚠️ Failed to connect to remote"
|
||||
exit 1
|
||||
}
|
||||
|
||||
LOCAL=$(git rev-parse HEAD)
|
||||
REMOTE_HEAD=$(git rev-parse origin/master)
|
||||
|
||||
if [ "$LOCAL" == "$REMOTE_HEAD" ]; then
|
||||
echo "No new changes on freightdesk"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get what changed
|
||||
echo "🔔 New commits detected!"
|
||||
echo ""
|
||||
echo "New commits on origin/master:"
|
||||
git log --oneline --no-decorate "$LOCAL..$REMOTE_HEAD"
|
||||
echo ""
|
||||
|
||||
# Pull changes
|
||||
git merge --no-edit origin/master
|
||||
|
||||
echo "✅ Pulled $(git rev-list --count "$LOCAL..HEAD") new commit(s)"
|
||||
Loading…
Reference in a new issue