feat: Replace SQLite with per-user JSON storage (fixes #2) #3

Merged
shoko merged 3 commits from fix/issue-2-json-storage into main 2026-04-02 17:44:08 +02:00
Owner

Summary

  • Replaced SQLite storage with per-user JSON files in data/users/
  • Created storage.py with atomic writes via tempfile+rename
  • Simplified commands.py (removed admin model, no reminders in v1)
  • Removed: db.py, schema.sql, cron.py, test_db.py
  • Updated SPEC.md to reflect new architecture

Key Changes

  • Storage: data/users/{telegram_user_id}.json
  • Bounty IDs are sequential per-user (not global)
  • Anyone can add bounties; only creator can edit/delete
  • No reminders in v1 (removed cron.py)

Clarifying Questions

Posted questions on issue #2 regarding data location, cross-group bounty lookup, and admin model removal.

## Summary - Replaced SQLite storage with per-user JSON files in `data/users/` - Created `storage.py` with atomic writes via tempfile+rename - Simplified commands.py (removed admin model, no reminders in v1) - Removed: `db.py`, `schema.sql`, `cron.py`, `test_db.py` - Updated SPEC.md to reflect new architecture ## Key Changes - Storage: `data/users/{telegram_user_id}.json` - Bounty IDs are sequential per-user (not global) - Anyone can add bounties; only creator can edit/delete - No reminders in v1 (removed cron.py) ## Clarifying Questions Posted questions on issue #2 regarding data location, cross-group bounty lookup, and admin model removal.
shoko added 1 commit 2026-04-01 12:03:08 +02:00
- Add storage.py with load_user(), save_user(), next_bounty_id()
- Rewrite commands.py to use JSON storage (simplified)
- Remove db.py, schema.sql, cron.py, test_db.py
- Update SPEC.md to reflect new architecture
- Admin model removed (anyone can add, creator only can edit/delete)
- No reminders in v1
han approved these changes 2026-04-01 23:03:37 +02:00
Dismissed
han left a comment
Collaborator

lgtm

lgtm
shoko added 1 commit 2026-04-01 23:31:37 +02:00
Changed from per-user flat files to group/DM directory structure:
- data/{group_id}/group.json — group bounties
- data/{group_id}/{user_id}.json — user tracking in group
- data/{user_id}/user.json — user personal bounties (DM)
- Groups isolated, no cross-group access
- Tracking is per-group-per-user
shoko added 1 commit 2026-04-02 16:56:46 +02:00
- Storage: Change from per-user to per-group JSON files
- Data location: ~/.jigaido/ instead of apps/telegram-bot/data/
- Group bounties: data/{group_id}/group.json
- User tracking: data/{group_id}/{user_id}.json
- Personal bounties: data/{user_id}/user.json
- Update commands.py for new storage model
- Update bot.py to remove admin handlers
- Update tests to reflect created_by_user_id field
- Update SPEC.md with new design

Addresses user feedback from issue #2
han approved these changes 2026-04-02 17:43:06 +02:00
han left a comment
Collaborator

lgtm

lgtm
shoko merged commit 98a8c4d173 into main 2026-04-02 17:44:08 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/jigaido#3