{"id":48454207,"url":"https://github.com/yinebebt/deeplink","last_synced_at":"2026-04-06T22:02:24.902Z","repository":{"id":349121634,"uuid":"1201139703","full_name":"yinebebt/deeplink","owner":"yinebebt","description":"Short link generation, click tracking, and OG preview pages for Go. Pluggable processors, Redis or in-memory storage.","archived":false,"fork":false,"pushed_at":"2026-04-04T09:26:27.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T11:24:46.804Z","etag":null,"topics":["app-links","click-tracking","deep-linking","go","golang","open-graph","redis","short-links","universal-links","url-shortener"],"latest_commit_sha":null,"homepage":null,"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/yinebebt.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":"2026-04-04T09:08:08.000Z","updated_at":"2026-04-04T09:28:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/yinebebt/deeplink","commit_stats":null,"previous_names":["yinebebt/deeplink"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yinebebt/deeplink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinebebt%2Fdeeplink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinebebt%2Fdeeplink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinebebt%2Fdeeplink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinebebt%2Fdeeplink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yinebebt","download_url":"https://codeload.github.com/yinebebt/deeplink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinebebt%2Fdeeplink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31491097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["app-links","click-tracking","deep-linking","go","golang","open-graph","redis","short-links","universal-links","url-shortener"],"created_at":"2026-04-06T22:02:19.862Z","updated_at":"2026-04-06T22:02:24.811Z","avatar_url":"https://github.com/yinebebt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deeplink\n\nShort link generation, click tracking, and OG preview pages for Go.\nPluggable processors, Redis or in-memory storage, two dependencies.\n\n[![CI](https://github.com/yinebebt/deeplink/actions/workflows/ci.yml/badge.svg)](https://github.com/yinebebt/deeplink/actions/workflows/ci.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/yinebebt/deeplink.svg)](https://pkg.go.dev/github.com/yinebebt/deeplink)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n## Install\n\n```bash\ngo get github.com/yinebebt/deeplink\n```\n\n## Usage\n\n```go\nservice, err := deeplink.New(deeplink.Config{\n    BaseURL:     \"https://link.example.com\",\n    Store:       deeplink.NewMemoryStore(),\n    TemplateDir: \"templates/default\",\n})\nif err != nil {\n    log.Fatal(err)\n}\nservice.Register(deeplink.RedirectProcessor{})\n\n// Mount alongside your own routes.\nmux := http.NewServeMux()\nmux.Handle(\"/\", service.Handler())\nmux.HandleFunc(\"GET /hello\", yourHandler)\n\nlog.Fatal(http.ListenAndServe(\":8090\", mux))\n```\n\nCreate a short link:\n\n```bash\ncurl -X POST http://localhost:8090/shorten \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"type\":\"redirect\",\"url\":\"https://example.com/docs\",\"title\":\"Docs\"}'\n```\n\nOpen the returned `short_url` in a browser.\n\n## Custom processors\n\nImplement [Processor](https://pkg.go.dev/github.com/yinebebt/deeplink#Processor):\n\n```go\ntype Processor interface {\n    Type() string\n    Process(ctx context.Context, link *Link) error\n}\n```\n\nFor custom template data, also implement `Previewer`:\n\n```go\ntype Previewer interface {\n    Preview(link *Link) any\n}\n```\n\nSee [example/custom](example/custom/) for a working custom processor with tests.\n\n## Standalone server\n\nA ready-to-run Redis-backed server is included:\n\n```bash\ndocker compose up -d\ngo run ./cmd/deeplink\n```\n\n## HTTP routes\n\n| Method | Path | Description |\n| --- | --- | --- |\n| POST | `/shorten` | Create a short link |\n| GET | `/{shortID}` | Preview page (or 302 redirect) |\n| GET | `/links/{type}` | List links by type |\n| GET | `/links/{type}/{shortID}` | Link detail with click count |\n| GET | `/health` | Health check |\n\nWhen any store URL is set (`AndroidStoreURL`, `IOSStoreURL`, `WebFallbackURL`), these are also registered:\n\n| Method | Path | Description |\n| --- | --- | --- |\n| GET | `/preview/{shortID}` | Preview without auto-redirect |\n| GET | `/redirect` | App store redirect by platform |\n| GET | `/.well-known/` | Static files from template dir |\n\nFor iOS Universal Links and Android App Links, place your `apple-app-site-association`\nand `assetlinks.json` files in `\u003cTemplateDir\u003e/.well-known/`.\n\n## Configuration\n\nEnvironment variables for `cmd/deeplink`:\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `DEEPLINK_LISTEN_ADDR` | `:8090` | Listen address |\n| `DEEPLINK_BASE_URL` | `http://localhost:8090/` | Base URL for short links |\n| `DEEPLINK_REDIS_ADDR` | `localhost:6379` | Redis address |\n| `DEEPLINK_REDIS_PASSWORD` | | Redis password |\n| `DEEPLINK_ALLOWED_ORIGINS` | | CORS origins (comma-separated) |\n| `DEEPLINK_TEMPLATE_DIR` | `templates/default` | Template directory |\n| `DEEPLINK_SKIP_PATHS_FILE` | | Skip-path regex file |\n| `DEEPLINK_CLICK_BUFFER_SIZE` | `1024` | Async click event buffer capacity |\n| `DEEPLINK_CLICK_FLUSH_INTERVAL` | `1s` | How often buffered clicks are flushed to the store |\n\n## Templates\n\nThe default templates in `templates/default/` use these fields from `Link`:\n\n| Field | Template variable | Used for |\n| --- | --- | --- |\n| URL | `{{.URL}}` | Redirect target, og:url |\n| Title | `{{.Title}}` | Page title, og:title |\n| Description | `{{.Description}}` | og:description |\n| ImageURL | `{{.ImageURL}}` | og:image |\n\nTo customize, copy `templates/default/` and set `TemplateDir` in config.\n\n## Development\n\n```bash\ngo test ./...          # run tests\ngo run ./cmd/deeplink  # run standalone server (needs Redis)\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinebebt%2Fdeeplink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyinebebt%2Fdeeplink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinebebt%2Fdeeplink/lists"}