{"id":35094422,"url":"https://github.com/shz-code/bun-expo-push-notification","last_synced_at":"2025-12-27T15:06:45.173Z","repository":{"id":289616102,"uuid":"971836117","full_name":"shz-code/bun-expo-push-notification","owner":"shz-code","description":"A lightweight server built with Bun and Hono to send push notifications to devices using Expo's push notification system.","archived":false,"fork":false,"pushed_at":"2025-04-24T06:17:08.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T07:29:39.064Z","etag":null,"topics":["bun","expo","expo-push-notifications","honojs"],"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/shz-code.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}},"created_at":"2025-04-24T06:11:14.000Z","updated_at":"2025-04-24T06:17:11.000Z","dependencies_parsed_at":"2025-04-24T07:32:08.077Z","dependency_job_id":"8867471d-e21b-49a1-bc4d-8bea871dc417","html_url":"https://github.com/shz-code/bun-expo-push-notification","commit_stats":null,"previous_names":["shz-code/bun-expo-push-notification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shz-code/bun-expo-push-notification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shz-code%2Fbun-expo-push-notification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shz-code%2Fbun-expo-push-notification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shz-code%2Fbun-expo-push-notification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shz-code%2Fbun-expo-push-notification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shz-code","download_url":"https://codeload.github.com/shz-code/bun-expo-push-notification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shz-code%2Fbun-expo-push-notification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28080210,"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-12-27T02:00:05.897Z","response_time":58,"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":["bun","expo","expo-push-notifications","honojs"],"created_at":"2025-12-27T15:04:58.293Z","updated_at":"2025-12-27T15:06:45.168Z","avatar_url":"https://github.com/shz-code.png","language":"TypeScript","readme":"\n# Expo Push Server\n\nA lightweight server built with [Bun](https://bun.sh/) and [Hono](https://honojs.dev/) to send push notifications to devices using Expo's push notification system. Now featuring **OpenAPI (Swagger UI) documentation** and robust input validation with [Zod](https://github.com/colinhacks/zod) and [zod-openapi](https://github.com/asteasolutions/zod-to-openapi).\n\nUseful for testing, prototyping, or as a backend service to trigger push notifications from your applications.\n\n## Features\n\n- Simple HTTP API to trigger Expo push notifications\n- **Interactive API docs via Swagger UI** (`/docs`)\n- Input validation using [Zod](https://github.com/colinhacks/zod) and [zod-openapi](https://github.com/asteasolutions/zod-to-openapi)\n- **Optional `data` object** in payload for sending extra information (e.g., deeplinks)\n- Built with fast, modern tools: Bun, TypeScript, Hono\n\n---\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Documentation (Swagger UI)](#api-documentation-swagger-ui)\n- [API Routes](#api-routes)\n  - [POST /api/push/send](#post-apipushsend)\n- [Payload Example](#payload-example)\n- [Development](#development)\n- [License](#license)\n\n---\n\n## Installation\n\n1. **Clone the Repository**\n    ```bash\n    git clone https://github.com/shz-code/bun-expo-push-notification.git\n    cd bun-expo-push-notification\n    ```\n2. **Install Dependencies**  \n    Ensure you have [Bun](https://bun.sh/) installed (v1.2.6 or higher).\n    ```bash\n    bun install\n    ```\n\n---\n\n## Usage\n\nTo start the server (default port is **3000**):\n\n```bash\nbun start\n```\n\nThe server will be available at [http://localhost:3000](http://localhost:3000).\n\n---\n\n## API Documentation (Swagger UI)\n\nInteractive API documentation is available at:\n\n- [http://localhost:3000/docs](http://localhost:3000/docs)\n\nYou can explore, test, and view schemas for all endpoints directly in your browser.\n\n---\n\n## API Routes\n\n### `POST /api/push/send`\n\nSend a push notification to an Expo device token.\n\n- **URL:** `/api/push/send`\n- **Method:** `POST`\n- **Content-Type:** `application/json`\n- **Body Parameters:**  \n  Validated using a [Zod](https://github.com/colinhacks/zod) schema (see [Payload Example](#payload-example)).\n\n#### Example Request\n\n```bash\ncurl -X POST http://localhost:3000/api/push/send \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"title\": \"Hello from server!\",\n    \"body\": \"This is a test push notification\",\n    \"token\": \"ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]\",\n    \"data\": {\n      \"deeplink\": \"myapp://profile/123\"\n    }\n  }'\n```\n\n#### Success Response\n\n- **Code:** `200 OK`\n- **Content:**\n    ```json\n    {\n      \"success\": true,\n      \"tickets\": [\n        {\n          \"status\": \"ok\",\n          \"id\": \"...\",\n          \"...\": \"...\"\n        }\n      ]\n    }\n    ```\n\n#### Error Responses\n\n- **Invalid Token**\n    - **Code:** `400 Bad Request`\n    - **Content:**\n        ```json\n        {\n          \"error\": \"Invalid Expo push token\"\n        }\n        ```\n\n- **Server Error**\n    - **Code:** `500 Internal Server Error`\n    - **Content:**\n        ```json\n        {\n          \"error\": \"Failed to send notification\"\n        }\n        ```\n\n---\n\n## Payload Example\n\n| Field   | Type   | Required | Description                       |\n|---------|--------|----------|-----------------------------------|\n| title   | string | Yes      | Title of the notification         |\n| body    | string | Yes      | Body text of the notification     |\n| token   | string | Yes      | Expo push token (device token)    |\n| data    | object | No       | Optional. Extra data (e.g., deeplinks) |\n\n#### Example JSON\n\n```json\n{\n  \"title\": \"Sample Notification\",\n  \"body\": \"This is a sample push notification for Expo!\",\n  \"token\": \"ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]\",\n  \"data\": {\n    \"deeplink\": \"myapp://profile/123\"\n  }\n}\n```\n\n#### Using the `data` Object\n\nThe optional `data` object can be used to send additional information with your push notification.  \nA common use case is to send a **deeplink** so that your app can navigate to a specific screen when the notification is tapped.\n\nExample:\n\n```json\n\"data\": {\n  \"deeplink\": \"myapp://profile/123\"\n}\n```\n\nYour app can read this `deeplink` value and handle navigation accordingly.\n\n\n## Development\n\n- Code lives in `/controllers`, `/routes`, and `/dtos`\n- Entry point: `index.ts`\n- API routes are defined using `@hono/zod-openapi` for automatic OpenAPI docs\n- You can extend DTOs in `/dtos/pushDTO/` for more payload options\n\n---\n\n## License\n\nMIT\n\n---\n\nThis project was created using `bun init` in bun v1.2.6. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshz-code%2Fbun-expo-push-notification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshz-code%2Fbun-expo-push-notification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshz-code%2Fbun-expo-push-notification/lists"}