{"id":13455104,"url":"https://github.com/pheralb/slug","last_synced_at":"2025-05-15T08:09:13.391Z","repository":{"id":62828384,"uuid":"537823074","full_name":"pheralb/slug","owner":"pheralb","description":"🌱 An open-source URL shortener built with T3 Stack.","archived":false,"fork":false,"pushed_at":"2025-01-11T22:26:59.000Z","size":2797,"stargazers_count":672,"open_issues_count":4,"forks_count":72,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T03:12:58.150Z","etag":null,"topics":["hacktoberfest","next-auth","nextjs","prisma","shadcn-ui","sqlite","t3","t3-stack","tailwindcss","turso","typescript","vercel"],"latest_commit_sha":null,"homepage":"https://slug.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pheralb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"pheralb"}},"created_at":"2022-09-17T13:51:40.000Z","updated_at":"2025-04-04T02:10:01.000Z","dependencies_parsed_at":"2024-09-19T01:31:01.332Z","dependency_job_id":"3f086342-67dd-4589-8746-302f4374d6b3","html_url":"https://github.com/pheralb/slug","commit_stats":{"total_commits":397,"total_committers":11,"mean_commits":36.09090909090909,"dds":"0.10075566750629728","last_synced_commit":"e903c4b7349b075c6a9f52f5154b27635dd98080"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pheralb%2Fslug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pheralb%2Fslug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pheralb%2Fslug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pheralb%2Fslug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pheralb","download_url":"https://codeload.github.com/pheralb/slug/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248889852,"owners_count":21178306,"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","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":["hacktoberfest","next-auth","nextjs","prisma","shadcn-ui","sqlite","t3","t3-stack","tailwindcss","turso","typescript","vercel"],"created_at":"2024-07-31T08:01:01.327Z","updated_at":"2025-04-14T13:41:05.691Z","avatar_url":"https://github.com/pheralb.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://slug.vercel.app\"\u003e\n    \u003cimg\n      src=\"https://raw.githubusercontent.com/pheralb/slug/refs/heads/main/public/images/logo_svg.svg\"\n      alt=\"Slug Logo\"\n      height=\"64\"\n    /\u003e\n  \u003c/a\u003e\n  \u003cp\u003e\u003c/p\u003e\n  \u003cp\u003e\n    \u003cb\u003e\n      An open-source URL shortener built with T3 Stack.\n    \u003c/b\u003e\n  \u003c/p\u003e\n\n\u003ca href=\"https://slug.vercel.app/dashboard\"\u003eDashboard\u003c/a\u003e\n\u003cspan\u003e\u0026nbsp;\u0026nbsp;❖\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\u003ca href=\"#-roadmap\"\u003eRoadmap\u003c/a\u003e\n\u003cspan\u003e\u0026nbsp;\u0026nbsp;❖\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\u003ca href=\"#-getting-started\"\u003eContribute\u003c/a\u003e\n\u003cspan\u003e\u0026nbsp;\u0026nbsp;❖\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\u003ca href=\"https://github.com/pheralb/slug/issues/new/choose\"\u003eCreate issue\u003c/a\u003e\n\u003cspan\u003e\u0026nbsp;\u0026nbsp;❖\u0026nbsp;\u0026nbsp;\u003c/span\u003e\n\u003ca href=\"https://twitter.com/pheralb_\"\u003eX/Twitter\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://slug.vercel.app\"\u003e\n\u003cimg src=\"public/images/screenshot_png.png\"\u003e\n\u003c/a\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n![Next.js Badge](https://img.shields.io/badge/Next.js\u0026nbsp;14-000?logo=nextdotjs\u0026logoColor=fff\u0026style=flat)\n![Turso Badge](https://img.shields.io/badge/Turso-4FF8D2?logo=turso\u0026logoColor=000\u0026style=flat)\n![Check workflow](https://github.com/pheralb/slug/actions/workflows/ci.yml/badge.svg)\n![GitHub stars](https://img.shields.io/github/stars/pheralb/slug)\n![GitHub releases](https://img.shields.io/github/release/pheralb/slug)\n![GitHub issues](https://img.shields.io/github/issues/pheralb/slug)\n![GitHub license](https://img.shields.io/github/license/pheralb/slug)\n\n\u003c/div\u003e\n\n## 👨‍🚀 Introduction\n\n[**Slug**](slug.vercel.app) is a service that offers to shorten urls in a simple, fast and secure way. It's built with [**T3 Stack**](https://create.t3.gg/), a web development stack made by [**Theo**](https://twitter.com/t3dotgg) focused on simplicity, modularity, and full-stack **typesafety**.\n\nThis project uses the following technologies:\n\n- [**create-t3-app**](https://create.t3.gg) - The best way to start a full-stack, typesafe Next.js app.\n- [**Next.js 14 App Router**](https://nextjs.org/) - The React Framework for the Web.\n- [**Auth.js v5**](https://authjs.dev/) - Authentication for the Web.\n- [**Prisma**](https://prisma.io) - A next-generation Node.js and TypeScript ORM.\n- [**Turso**](https://turso.tech/) (SQLite) + [**libSQL**](https://github.com/tursodatabase/libsql) - SQLite for Production.\n- [**Next.js Server Actions**](https://nextjs.org/docs/api-reference/server-actions) - Asynchronous functions that are executed on the server.\n- [**TailwindCSS**](https://tailwindcss.com) + [**shadcn/ui**](https://ui.shadcn.com) \u0026 [**Radix Primitives**](https://www.radix-ui.com) - Design System.\n- [**Prettier**](https://prettier.io) with [**prettier-plugin-tailwindcss**](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) - Code Formatter.\n- [**Lucide Icons**](https://lucide.dev) + [**svgl**](https://svgl.app) - Beautiful SVG icons \u0026 logos for the web.\n\n\u003e ⚠️ This is a community project, not associated with [Vercel](https://vercel.com/).\n\n## 🚀 Getting Started\n\n**Requirements:**\n\n- [x] [Node.js](https://nodejs.org) (+v18.x) installed.\n- [x] [pnpm](https://pnpm.io) (v8+) installed.\n- [x] [Turso CLI](https://docs.turso.tech/cli/install) installed (for Windows users, it's necessary to [activate WSL 2](https://docs.microsoft.com/en-us/windows/wsl/install)).\n- [x] [Visual Studio Code](https://code.visualstudio.com) with the recommended extensions installed (ESLint, Prettier, Tailwind CSS IntelliSense).\n\n**Steps:**\n\n1. Fork this project:\n\n- [Click here](https://github.com/pheralb/slug/fork).\n\n2. Clone the repository:\n\n```bash\ngit clone git@github.com:YOU_USER/slug.git\n```\n\n3. Install dependencies:\n\n```bash\n# Install pnpm globally if you don't have it:\nnpm install -g pnpm\n\n# and install dependencies:\npnpm install\n```\n\n4. Create a **.env** file with the following content:\n\n\u003e 🚧 The environment variables must match the following [schema](https://github.com/pheralb/slug/blob/main/src/env/schema.mjs#L8).\n\n```bash\n# Database:\nDATABASE_URL= # \"file:./dev.db\"\nTURSO_DATABASE_URL=\nTURSO_AUTH_TOKEN=\n\n# Auth.js =\u003e\nAUTH_SECRET=\n\n# Github Provider =\u003e\nGITHUB_ID=\nGITHUB_CLIENT_SECRET=\n\n# Google Provider =\u003e\nGOOGLE_CLIENT_ID=\nGOOGLE_CLIENT_SECRET=\n```\n\n**Database:**\n\n- [**Create** a new database with Turso](https://docs.turso.tech/cli/db/create).\n- [Get Turso **Auth Token**](https://docs.turso.tech/cli/auth/token).\n- [Get Turso **Database URL**](https://docs.turso.tech/cli/db/show).\n\n**Auth.js:**\n\n- [Get Auth.js **Secret**](https://authjs.dev/getting-started/installation#setup-environment).\n- ``AUTH_URL`` is the URL of your Auth.js API, for example, ``/api/auth``. You can change it in the [**``auth.ts`` file**](https://github.com/pheralb/slug/blob/next/src/auth.ts#L20).\n\n**Github Credentials:**\n\n- [Create a new OAuth App](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app).\n\n**Google Credentials:**\n\n- [Create a new OAuth 2.0 App from Google API Console](https://developers.google.com/identity/protocols/oauth2#1.-obtain-oauth-2.0-credentials-from-the-dynamic_data.setvar.console_name-.).\n\n5. Generate a new migration file with Prisma:\n\n```bash\npnpm db:migrate\n```\n\n6. Insert the migration data into the Turso database. To do this, go to ``package.json``, modify the ``db:push`` command with the name of the migration folder (2024***xxxxxxxxxx***_init) and run it in your terminal:\n\n```bash\npnpm db:push\n```\n\n7. Run:\n\n- Development server:\n\n```bash\npnpm dev\n```\n\nand open [http://localhost:3000](http://localhost:3000) with your browser 🚀\n\n- Prisma Studio:\n\n```bash\npnpm db:studio\n```\n\nand  open [http://localhost:5555](http://localhost:5555) with your browser ✨\n\n## 🔭 Roadmap\n\nThis is the roadmap I will be following for the complete migration to v3:\n\n\u003e - *✅* = Stable, completed.\n\u003e - *🔔* = Stable, but unexpected errors may appear.\n\u003e - *⚙️* = In progress.\n\n⬆️ **Known issues:**\n\n- ⚙️ Fix issue when logging in with different provider but with the same email. Redirect to an existing route in the app ([authjs error](https://authjs.dev/reference/core/errors#accountnotlinked)).\n\n⬆️ **Dependencies:**\n\n- ✅ Update `@prisma/adapter-libsql`, `@prisma/client` \u0026 `prisma` to the stable version when it's released.\n- ⚙️ Update `authjs` to the stable version (v5) when it's released.\n\n⬆️ **Auth:**\n\n- ✅ Sign In with Github.\n- 🔔 Sign In with Google.\n\n🔔 Only for users who have not previously logged in with an existing email address in their Github account. This is an issue that will be worked on soon.\n\n⬆️ **Middleware:**\n\n- ✅ Redirect with `/*` and `/s/*`.\n- ✅ Separate public, protected \u0026 authentication routes.\n\n⬆️ **Dashboard (main):**\n\n- ✅ Create a new short URL.\n- ✅ List all shorted URLs.\n- ✅ Delete a shorted URL.\n- ✅ Update a shorted URL.`\n\n⬆️ **Dashboard (tags):**\n\n- ✅ Add search links by tags in the dashboard.\n- 🔔 Create a new tag.\n- ✅ Delete a tag.\n- ⚙️ Update the tags of a link.\n\n🔔 Add option to change tag color.\n\n⬆️ **Dashboard (settings):**\n\n- ✅ Change name.\n- ✅ Change email.\n- ✅ Delete account.\n- ✅ Download all links data.\n\n## ✌️ Contributing\n\n\u003ca href=\"https://github.com/pheralb/slug/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=pheralb/slug\" /\u003e\n\u003c/a\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n## ☁️ Deploy on Vercel\n\n- ✅ [slug.vercel.app](https://slug.vercel.app/).\n\n## 🔑 License\n\n- [GPL-3.0 license](https://github.com/pheralb/slug/blob/main/LICENSE).\n","funding_links":["https://github.com/sponsors/pheralb"],"categories":["TypeScript","Self Hosting Opensource","vercel"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpheralb%2Fslug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpheralb%2Fslug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpheralb%2Fslug/lists"}