Commit Graph

5 Commits

Author SHA1 Message Date
Knee Cola
57dcebd640 refactor: convert repository to monorepo with npm workspaces
Restructured the repository into a monorepo to better organize application code
and maintenance scripts.

## Workspace Structure
- web-app: Next.js application (all app code moved from root)
- housekeeping: Database backup and maintenance scripts

## Key Changes
- Moved all application code to web-app/ using git mv
- Moved database scripts to housekeeping/ workspace
- Updated Dockerfile for monorepo build process
- Updated docker-compose files (volume paths: ./web-app/etc/hosts/)
- Updated .gitignore for workspace-level node_modules
- Updated documentation (README.md, CLAUDE.md, CHANGELOG.md)

## Migration Impact
- Root package.json now manages workspaces
- Build commands delegate to web-app workspace
- All file history preserved via git mv
- Docker build process updated for workspace structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 12:13:04 +01:00
Knee Cola
927349e1d2 feat: add share link security environment variables to Docker configs
Changes:
- Add SHARE_LINK_SECRET (production secret, 64-char hex)
- Add SHARE_TTL_INITIAL_DAYS=10 (days before first tenant visit)
- Add SHARE_TTL_AFTER_VISIT_HOURS=1 (hours after tenant visits)
- Add UPLOAD_RATE_LIMIT_PER_IP=5 (max uploads per IP)
- Add UPLOAD_RATE_LIMIT_WINDOW_MS=3600000 (1 hour rate limit window)

Updated both:
- docker-compose-standalone.yaml
- docker-compose-swarm.yml

Production SHARE_LINK_SECRET generated with: openssl rand -hex 32

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-08 01:20:55 +01:00
4454ea3b7e Enhance backup system with comprehensive scripts and documentation
Database Backup Scripts:
- Add db-dump--standalone.sh for online database dumps (no downtime)
- Add db-restore-from-dump--standalone.sh for restoring from dumps
- Rename backup scripts with double-dash convention for clarity
- Add comprehensive header comments to all backup/restore scripts
- Document online vs offline, standalone vs swarm deployment types
- Add KEEP variable default (7) to dump script for rotation

Docker Configuration:
- Add mongo-backup volume mount to docker-compose-standalone.yaml
- Add mongo-backup volume mount to docker-compose-debug.yml
- Add container names to debug compose for consistency with standalone

Documentation:
- Add comprehensive Database Backup & Restore section to README.md
- Document all backup scripts with usage examples
- Document automated cron schedule (04:00 daily)
- Sunday: Full volume backup (KEEP=2, offline)
- Monday-Saturday: Database dumps (KEEP=7, online)
- Document backup directories and log file locations

Git Configuration:
- Add mongo-backup/ to .gitignore
- Fix missing newline at end of .gitignore

File Cleanup:
- Remove db-scheduled-backup.sh (superseded by cron jobs)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 11:11:17 +01:00
Knee Cola
5832e9e691 Refactor deployment scripts to separate standalone and swarm modes
- Remove ambiguous docker-compose-deploy.yml and debug-deploy.sh
- Update deploy-standalone.sh to use docker-compose-standalone.yaml
- Update deploy-swarm.sh to use docker-compose-swarm.yml
- Standardize error messages to English in deployment scripts
- Add db-backup-swarm.sh for swarm-specific backups
- Unify network naming to util-bills-mongo-network across configs
- Fix MongoDB credentials in swarm compose file

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 19:28:16 +01:00
Knee Cola
c1686c4cb8 Update db-backup-standalone.sh to use docker compose
- Replace docker service scale with docker compose stop/start
- Update service name from utility-bills-tracker_mongo to mongo
- Reference docker-compose-standalone.yaml compose file
- Update comments to reflect container operations vs swarm service

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 19:25:51 +01:00