From 51d3e037327139c14ac4786c5ab91f14253bea28 Mon Sep 17 00:00:00 2001 From: usulpro Date: Sat, 27 Dec 2025 22:58:44 +0700 Subject: [PATCH] add claude.local.md --- CLAUDE.local.md | 109 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 CLAUDE.local.md diff --git a/CLAUDE.local.md b/CLAUDE.local.md new file mode 100644 index 0000000..ffd1e57 --- /dev/null +++ b/CLAUDE.local.md @@ -0,0 +1,109 @@ +# Banatie Service - VPS Environment + +## Environment Context +This Claude Code instance runs on the **VPS server** with direct access to production services. + +Your main folder is `/home/usul/workspace/projects/banatie-service`. Use it for git operations, code review, and documentation. + +## Directory Structure + +| Path | Purpose | +|------|---------| +| `/home/usul/workspace/projects/banatie-service` | Git repository (source code, docs) | +| `/opt/banatie/` | Production deployment (docker-compose, configs) | +| `/opt/banatie/data/` | Persistent data (minio, postgres) | + +## Deployment Workflow + +### Update from Git +```bash +cd /home/usul/workspace/projects/banatie-service +git pull origin main +``` + +### Deploy API +```bash +./scripts/deploy-api.sh +# or with rebuild: +./scripts/deploy-api.sh --no-cache +``` + +### Deploy Landing +```bash +./scripts/deploy-landing.sh +``` + +### Manual Docker Operations +```bash +cd /opt/banatie +docker compose ps +docker compose logs -f api +docker compose logs -f landing +docker compose restart api +``` + +## Common Operations + +### Check Service Status +```bash +docker compose -f /opt/banatie/docker-compose.yml ps +curl -s http://localhost:3000/health | jq +``` + +### View Logs +```bash +docker compose -f /opt/banatie/docker-compose.yml logs -f api --tail=100 +docker compose -f /opt/banatie/docker-compose.yml logs -f landing --tail=100 +``` + +### Database Access +```bash +docker exec -it banatie-postgres psql -U banatie_user -d banatie_db +``` + +### MinIO Access +```bash +docker exec -it banatie-minio mc ls storage/banatie +``` + +### Reset Database (DESTRUCTIVE) +```bash +cd /opt/banatie +docker compose down +sudo rm -rf data/postgres/* +docker compose up -d +``` + +## Production URLs + +| Service | URL | +|---------|-----| +| Landing | https://banatie.app | +| API | https://api.banatie.app | +| CDN | https://cdn.banatie.app | +| MinIO Console | https://storage.banatie.app | + +## Key Files + +| Location | Purpose | +|----------|---------| +| `/opt/banatie/docker-compose.yml` | Production compose (copy from `infrastructure/docker-compose.vps.yml`) | +| `/opt/banatie/.env` | Environment variables | +| `/opt/banatie/secrets.env` | Secrets (GEMINI_API_KEY, etc.) | +| `infrastructure/docker-compose.vps.yml` | Source template for production compose | +| `docs/url-fix-vps-site.md` | CDN deployment instructions | + +## Operational Responsibilities + +- Execute deployment procedures using scripts in `scripts/` +- Monitor service health via Docker logs +- Update configurations and restart services as needed +- Document encountered issues and their resolutions +- Commit operational changes and lessons learned to the repository + +## Important Notes + +- Always `git pull` before deploying +- Check logs after deployment for errors +- Secrets are in `/opt/banatie/secrets.env` (not in git) +- Database and MinIO data persist in `/opt/banatie/data/`