{"id":16298401,"url":"https://github.com/spences10/sveltekit-short-urls","last_synced_at":"2025-08-24T11:38:30.246Z","repository":{"id":37033330,"uuid":"453491256","full_name":"spences10/sveltekit-short-urls","owner":"spences10","description":"Short URLs with SvelteKit","archived":false,"fork":false,"pushed_at":"2025-08-23T21:40:32.000Z","size":1775,"stargazers_count":8,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-24T09:13:04.077Z","etag":null,"topics":["short-url","short-urls","svelte","sveltekit","vercel"],"latest_commit_sha":null,"homepage":"https://sveltekit-short-urls.vercel.app/links","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spences10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-01-29T18:58:36.000Z","updated_at":"2025-07-27T15:12:36.000Z","dependencies_parsed_at":"2023-02-13T19:30:19.990Z","dependency_job_id":"8636eb6d-5aba-4a0e-9671-30b03910a24d","html_url":"https://github.com/spences10/sveltekit-short-urls","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/spences10/sveltekit-short-urls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2Fsveltekit-short-urls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2Fsveltekit-short-urls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2Fsveltekit-short-urls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2Fsveltekit-short-urls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spences10","download_url":"https://codeload.github.com/spences10/sveltekit-short-urls/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2Fsveltekit-short-urls/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271854475,"owners_count":24834453,"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-08-24T02:00:11.135Z","response_time":111,"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":["short-url","short-urls","svelte","sveltekit","vercel"],"created_at":"2024-10-10T20:44:15.640Z","updated_at":"2025-08-24T11:38:30.198Z","avatar_url":"https://github.com/spences10.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SvelteKit Short URLs\n\nA modern URL shortener built with SvelteKit and Turso (libSQL).\nFeatures link management, click tracking, and referrer analytics.\n\n## Features\n\n- Short URL creation and redirection\n- Click tracking and analytics\n- Referrer tracking\n- Web interface for viewing active links\n- Position-based link ordering\n- Visibility controls for links\n\n## Database Schema\n\nThe application uses Turso (libSQL) with two main tables:\n\n### Links Table\n\n- `id`: Unique identifier\n- `source`: Short URL path\n- `destination`: Target URL\n- `position`: Order position\n- `description`: Link description\n- `clicks`: Click counter\n- `visible`: Visibility flag\n\n### Referrers Table\n\n- Tracks traffic sources for each link\n- Maintains count of visits per referrer\n\n## Setup\n\n1. Create a Turso database and obtain credentials\n2. Set environment variables:\n   ```bash\n   TURSO_DB_URL=your_database_url\n   TURSO_DB_AUTH_TOKEN=your_auth_token\n   TURSO_SYNC_URL=your_sync_url  # Optional\n   ```\n\n## Database Operations\n\n### Adding a Link\n\n```sql\nINSERT INTO links (source, destination, description, visible, position)\nVALUES ('key', 'https://destination.com', 'Description', true, 1);\n```\n\n### Updating a Link\n\n```sql\nUPDATE links\nSET destination = 'new-url', description = 'new description'\nWHERE source = 'key';\n```\n\n### Deleting a Link\n\n```sql\nDELETE FROM links WHERE source = 'key';\n```\n\n### Viewing Links\n\n```sql\n-- All visible links\nSELECT * FROM links WHERE visible = true;\n\n-- Most clicked links\nSELECT source, destination, clicks\nFROM links\nORDER BY clicks DESC\nLIMIT 10;\n\n-- Top referrers\nSELECT r.referrer, SUM(r.count) as total_referrals\nFROM referrers r\nGROUP BY r.referrer\nORDER BY total_referrals DESC\nLIMIT 10;\n```\n\n## Development\n\n```bash\n# Install dependencies\npnpm install\n\n# Run development server\npnpm dev\n\n# Run tests\npnpm test\n```\n\n## Security Features\n\n- Server-side database operations only\n- No client-side fetch operations\n- Secure redirect handling\n- Environment variable protection\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspences10%2Fsveltekit-short-urls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspences10%2Fsveltekit-short-urls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspences10%2Fsveltekit-short-urls/lists"}