{"id":31532577,"url":"https://github.com/amirparsadd/edgepaste","last_synced_at":"2025-10-04T03:56:31.079Z","repository":{"id":314974609,"uuid":"1057581140","full_name":"amirparsadd/edgepaste","owner":"amirparsadd","description":"a pastebin made for the edge!","archived":false,"fork":false,"pushed_at":"2025-09-15T23:46:21.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-16T01:21:06.187Z","etag":null,"topics":["edge","edge-computing","honojs","javascript","pastebin","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/amirparsadd.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":"2025-09-15T23:43:42.000Z","updated_at":"2025-09-16T00:38:37.000Z","dependencies_parsed_at":"2025-09-16T01:21:07.938Z","dependency_job_id":"0d608cf9-aaa6-423c-9e11-91f5382d256a","html_url":"https://github.com/amirparsadd/edgepaste","commit_stats":null,"previous_names":["amirparsadd/edgepaste"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/amirparsadd/edgepaste","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirparsadd%2Fedgepaste","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirparsadd%2Fedgepaste/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirparsadd%2Fedgepaste/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirparsadd%2Fedgepaste/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amirparsadd","download_url":"https://codeload.github.com/amirparsadd/edgepaste/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirparsadd%2Fedgepaste/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278262444,"owners_count":25957938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"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":["edge","edge-computing","honojs","javascript","pastebin","typescript"],"created_at":"2025-10-04T03:56:27.543Z","updated_at":"2025-10-04T03:56:31.070Z","avatar_url":"https://github.com/amirparsadd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EdgePaste\n\nEdgePaste is a simple and lightweight pastebin application built on the [Hono](https://hono.dev/) framework. It allows users to create, retrieve, and delete text-based pastes easily via a web interface or API. The project is designed to work with an S3-compatible storage backend for persistence. EdgePaste is built for edge runtimes.\n\n## Features\n\n- **Web Interface**: Create and view pastes through a simple and responsive frontend.\n- **REST API**: Programmatically interact with the application to create, retrieve, and delete pastes.\n- **Admin Key**: Securely delete pastes using a unique admin key.\n- **S3 Integration**: Store pastes in an S3-compatible storage backend.\n- **CORS Support**: Cross-Origin Resource Sharing enabled for API access.\n- **Logging**: Built-in logging for debugging and monitoring.\n\n---\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Endpoints](#api-endpoints)\n- [Environment Variables](#environment-variables)\n- [Development](#development)\n- [License](#license)\n\n---\n\n## Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/amirparsadd/edgepaste.git\n   cd edgepaste\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   npm install\n   ```\n\n3. Set up your environment variables (see [Environment Variables](#environment-variables)).\n\n4. Start the development server:\n\n   ```bash\n   npm run dev\n   ```\n\n---\n\n## Usage\n\n### Web Interface\n\n- Navigate to the root URL of the application.\n- Create a new paste by entering text and clicking \"Create\".\n- Copy the generated link to share the paste with others.\n- Use the admin key displayed to delete the paste if needed.\n\n---\n\n### API Endpoints\n\n#### Create a Paste\n\n- **Endpoint**: `POST /api/paste`\n- **Request Body**:\n  ```json\n  {\n    \"contents\": \"Your paste content here\"\n  }\n  ```\n- **Response**:\n  ```json\n  {\n    \"key\": \"pasteKey\",\n    \"adminKey\": \"adminKey\"\n  }\n  ```\n\n#### Retrieve a Paste\n\n- **Endpoint**: `GET /api/paste/:key`\n- **Response**:\n  ```json\n  {\n    \"result\": \"Your paste content here\"\n  }\n  ```\n\n#### Delete a Paste\n\n- **Endpoint**: `DELETE /api/paste/:key`\n- **Request Body**:\n  ```json\n  {\n    \"adminKey\": \"adminKey\"\n  }\n  ```\n- **Response**:\n  - Success: `200 OK`\n  - Invalid Admin Key: `401 Unauthorized`\n  - Paste Not Found: `404 Not Found`\n\n---\n\n### Environment Variables\n\nThe application requires the following environment variables to be set up:\n\n| Variable        | Description                          |\n|-----------------|--------------------------------------|\n| `S3.endpoint`   | The S3-compatible storage endpoint. |\n| `S3.bucket`     | The name of your S3 bucket.         |\n| `S3.accessKey`  | Your S3 access key.                 |\n| `S3.secretKey`  | Your S3 secret key.                 |\n| `BASE_URL`      | The base URL of your application.   |\n\nCreate a `src/env.ts` file in the project and add these variables.\n\nExample:\n\n```typescript\nexport const S3 = {\n  accessKey: \"123\",\n  secretKey: \"123\",\n  endpoint: \"example.com\",\n  bucket: \"bucketname\"\n}\n\nexport const BASE_URL = \"http://localhost:3000\"\n```\n\n---\n\n## Development\n\n### Scripts\n\n- **Build and serve in dev mode**:\n  ```bash\n  npm run dev\n  ```\n\n- **Build for Production**:\n  ```bash\n  npm run build\n  ```\n\n- **Build and deploy to r1ec**:\n  ```bash\n  npm run deploy\n  ```\n\n### Project Structure\n\n- `route/api/`: Contains the API route handlers.\n- `route/app/`: Contains the frontend route handlers and JSX components.\n- `storage.ts`: Handles S3 storage operations (`get`, `set`, `remove`).\n- `utils/`: Utility functions (e.g., key generation).\n- `env.ts`: Environment configuration.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request with your improvements or bug fixes.\n\n---\n\n## Acknowledgments\n\n- [Hono](https://hono.dev/) - A lightweight web framework for the Edge.\n- [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework.\n\n---\n\n## TODO\n\n- Implement rate-limiting for API endpoints.\n- Write tests.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirparsadd%2Fedgepaste","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famirparsadd%2Fedgepaste","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirparsadd%2Fedgepaste/lists"}