{"id":26519127,"url":"https://github.com/pluja/pocketjson","last_synced_at":"2026-04-16T07:33:34.578Z","repository":{"id":270399606,"uuid":"910263724","full_name":"pluja/pocketjson","owner":"pluja","description":"A lightweight and simple single-binary JSON storage service","archived":false,"fork":false,"pushed_at":"2025-10-21T20:27:03.000Z","size":83,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T22:22:18.621Z","etag":null,"topics":["bin","database","golang","json","store"],"latest_commit_sha":null,"homepage":"https://pocketjson.pluja.dev","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pluja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-30T20:34:53.000Z","updated_at":"2025-10-21T20:27:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb287950-06e3-4abd-abef-2bbdaf970746","html_url":"https://github.com/pluja/pocketjson","commit_stats":null,"previous_names":["pluja/pocketjson"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/pluja/pocketjson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluja%2Fpocketjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluja%2Fpocketjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluja%2Fpocketjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluja%2Fpocketjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pluja","download_url":"https://codeload.github.com/pluja/pocketjson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluja%2Fpocketjson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31876506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bin","database","golang","json","store"],"created_at":"2025-03-21T10:18:21.029Z","updated_at":"2026-04-16T07:33:34.568Z","avatar_url":"https://github.com/pluja.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PocketJSON 🚀\n\nA lightweight, single-binary JSON storage service with built-in expiry and multi-tenant support. Perfect for developers who need a quick, reliable way to store and retrieve JSON data without the overhead of a full database setup.\n\n## Features ✨\n\n- **Zero Configuration**: Just run the binary and you're ready to go\n- **Built-in Expiry**: All stored JSONs automatically expire (configurable)\n- **Multi-tenant Support**: Managed API keys with isolated namespaces\n- **Guest Mode**: Quick storage without authentication\n- **Size Limits**: 100KB for guests, 1MB for authenticated users\n- **Docker Ready**: Easy deployment with Docker and docker-compose\n- **SQLite Backend**: Simple, reliable, and portable\n- **Automatic Cleanup**: Background process removes expired data\n\n## Quick Start 🚀\n\n### Using Docker\n\n#### Option 1: Docker Pull (Easiest)\n\n```bash\ndocker pull ghcr.io/pluja/pocketjson:latest\ndocker run -d -p 9819:9819 -v $(pwd)/data:/app/data ghcr.io/pluja/pocketjson:latest\n```\n\n#### Option 2: Docker Compose\n\n1. Copy the `docker-compose.yml` file\n2. Run `docker-compose up -d`\n3. (optional) Set the `MASTER_API_KEY` env variable to a `.env` file\n\n### Direct Usage\n\n- Download the latest release from the releases page.\n- Build it yourself:\n\n```bash\n# Build\ngo build -o pocketjson ./cmd/pocketjson\n# Run\n./pocketjson\n```\n\n### Configuration via Environment Variables 🔧\n\n| Variable               | Description                               | Default                          | Required |\n| ---------------------- | ----------------------------------------- | -------------------------------- | -------- |\n| MASTER_API_KEY         | Master key for administrative operations  | *random value, see std output*   | No       |\n| PORT                   | HTTP server port                          | `9819`                           | No       |\n| DATA_DIR               | Directory for SQLite database             | `data`                           | No       |\n| REQUEST_LIMIT          | Rate limit requests per minute for guests | 15                               | No       |\n| DEFAULT_EXPIRY_HOURS   | Default expiry time for stores            | `48`                             | No       |\n| DEFAULT_MAX_SIZE       | Maximum JSON size for guests in bytes     | `102400` (100kb)                 | No       |\n| AUTHENTICATED_MAX_SIZE | Maximum JSON size for auth users in bytes | `1048576` (1M)                   | No       |\n| CORS_ALLOWED_ORIGINS   | Allowed origins for CORS                  | `*`                              | No       |\n\n\u003e If you are using `docker` create a `.env` file next to the `docker-compose.yml` and add the variables you need. If you are running it without docker, please declare the variables you need.\n\n## API Usage 📡\n\n### Guest Mode\n\nStore JSON (expires in 48 hours by default):\n\n```bash\ncurl -X POST http://localhost:9819 \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"hello\":\"world\"}'\n\n# Response:\n{\n  \"id\": \"f7a8b9c0d1e2\",\n  \"expires_at\": \"2024-01-21T15:30:45Z\"\n}\n```\n\nRetrieve JSON:\n\n```bash\ncurl http://localhost:9819/f7a8b9c0d1e2\n```\n\n### Authenticated Mode\n\nFirst, create an API key (requires master key):\n\n```bash\ncurl -X POST http://localhost:9819/admin/keys \\\n  -H \"X-API-Key: your-master-key\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"description\": \"Development API Key\",\n    \"is_admin\": false\n  }'\n\n# Response:\n{\n  \"key\": \"924a98c84222ca4b2984e417c767c519\",\n  \"client_id\": \"7f3d8\",\n  \"description\": \"Development API Key\",\n  \"is_admin\": false,\n  \"created_at\": \"2024-01-20T15:30:45Z\"\n}\n```\n\nStore JSON with custom expiry:\n\n```bash\n# Expire after 3 days\ncurl -X POST \"http://localhost:9819/my-data?expiry=72\" \\\n  -H \"X-API-Key: 924a98c84222ca4b2984e417c767c519\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"hello\":\"world\"}'\n\n# Response:\n{\n  \"id\": \"7f3d8_my-data\",\n  \"expires_at\": \"2024-01-23T15:30:45Z\"\n}\n```\n\nNote: Authenticated users' IDs are prefixed with their client_id (first 5 chars of MD5(api_key))\n\n## API Reference 📚\n\n### Endpoints\n\n| Method | Path | Description | Auth Required |\n|--------|------|-------------|---------------|\n| POST | / | Store JSON with random ID | No |\n| POST | /{id} | Store JSON with specific ID | Yes |\n| GET | /{id} | Retrieve JSON | No |\n| POST | /admin/keys | Create API key | Yes (Admin) |\n| DELETE | /admin/keys/{key} | Delete API key | Yes (Admin) |\n| GET | /health | Health check | No |\n\n### Storage Limits\n\n- Guest users: 100KB\n- Authenticated users: 1MB\n\n### Expiry Options\n\n- Guest users: 48 hours\n- Authenticated users can specify:\n  - Custom hours: `?expiry=72` (72 hours)\n  - Never expire: `?expiry=never`\n\n## Development 🛠\n\n### Prerequisites\n\n- Go 1.23+\n- SQLite3\n\n### Setup\n\n```bash\n# Build\ngo build -o pocketjson ./cmd/pocketjson\n\n# Run\n./pocketjson\n```\n\n## Why PocketJSON? 🤔\n\nPocketJSON was created to solve the common need for temporary JSON storage without the complexity of setting up and maintaining a full database system. It's perfect for:\n\n- Development and testing\n- Temporary data storage\n- Webhook payload storage\n- API response caching\n- Cross-service data sharing\n\n## License 📄\n\nMIT License - see [LICENSE](LICENSE) for details\n\n## Contributing 🤝\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpluja%2Fpocketjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpluja%2Fpocketjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpluja%2Fpocketjson/lists"}