Giter Club home page Giter Club logo

slug's Introduction

Slug Logo

An open-source URL shortener built with T3 Stack.

Dashboard   ❖   Roadmap   ❖   Contribute   ❖   Create issue   ❖   X/Twitter

Next.js Badge Turso Badge Check workflow GitHub stars GitHub releases GitHub issues GitHub license

👨‍🚀 Introduction

Slug is a service that offers to shorten urls in a simple, fast and secure way. It's built with T3 Stack, a web development stack made by Theo focused on simplicity, modularity, and full-stack typesafety.

This project uses the following technologies:

⚠️ This is a community project, not associated with Vercel.

🚀 Getting Started

Requirements:

Steps:

  1. Fork this project:
  1. Clone the repository:
git clone [email protected]:YOU_USER/slug.git
  1. Install dependencies:
# Install pnpm globally if you don't have it:
npm install -g pnpm

# and install dependencies:
pnpm install
  1. Create a .env file with the following content:

🚧 The environment variables must match the following schema.

# Database:
DATABASE_URL= # "file:./dev.db"
TURSO_DATABASE_URL=
TURSO_AUTH_TOKEN=

# Auth.js =>
AUTH_SECRET=

# Github Provider =>
GITHUB_ID=
GITHUB_CLIENT_SECRET=

# Google Provider =>
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

Database:

Auth.js:

Github Credentials:

Google Credentials:

  1. Generate a new migration file with Prisma:
pnpm db:migrate
  1. 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 (2024xxxxxxxxxx_init) and run it in your terminal:
pnpm db:push
  1. Run:
  • Development server:
pnpm dev

and open http://localhost:3000 with your browser 🚀

  • Prisma Studio:
pnpm db:studio

and open http://localhost:5555 with your browser ✨

🔭 Roadmap

This is the roadmap I will be following for the complete migration to v3:

  • = Stable, completed.
  • 🔔 = Stable, but unexpected errors may appear.
  • ⚙️ = In progress.

⬆️ Known issues:

  • ⚙️ Fix issue when logging in with different provider but with the same email. Redirect to an existing route in the app (authjs error).

⬆️ Dependencies:

  • ✅ Update @prisma/adapter-libsql, @prisma/client & prisma to the stable version when it's released.
  • ⚙️ Update authjs to the stable version (v5) when it's released.

⬆️ Auth:

  • ✅ Sign In with Github.
  • 🔔 Sign In with Google.

🔔 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.

⬆️ Middleware:

  • ✅ Redirect with /* and /s/*.
  • ✅ Separate public, protected & authentication routes.

⬆️ Dashboard (main):

  • ✅ Create a new short URL.
  • ✅ List all shorted URLs.
  • ✅ Delete a shorted URL.
  • ✅ Update a shorted URL.`

⬆️ Dashboard (tags):

  • ✅ Add search links by tags in the dashboard.
  • 🔔 Create a new tag.
  • ✅ Delete a tag.
  • ⚙️ Update the tags of a link.

🔔 Add option to change tag color.

⬆️ Dashboard (settings):

  • ✅ Change name.
  • ✅ Change email.
  • ✅ Delete account.
  • ✅ Download all links data.

✌️ Contributing

☁️ Deploy on Vercel

🔑 License

slug's People

Contributors

david-ponc avatar hyuuh avatar imjesusc avatar oggnimodd avatar pheralb avatar roberthgnz avatar turbobot-temp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

slug's Issues

not working (🚧 Error (urlFromServer))

Hi! I've followed the installation instructions and I've the same version on everything but i get this error when trying to sign in with github:

in the browser: {"error":"Something went wrong."}

in the terminal:

prisma:query SELECT main.Account.id, main.Account.userId FROM main.Account WHERE ((main.Account.provider = ? AND main.Account.providerAccountId = ?) AND 1=1) LIMIT ? OFFSET ?
prisma:error
Invalid prisma.account.findUnique() invocation:

SERVER_ERROR: Server returned HTTP status 401
[auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror
[auth][cause]: PrismaClientKnownRequestError:
Invalid prisma.account.findUnique() invocation:

SERVER_ERROR: Server returned HTTP status 401
at In.handleRequestError (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:122:6854)
at In.handleAndLogRequestError (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:122:6188)
at In.request (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:122:5896)
at async l (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:127:10871)
at async getUserByAccount (webpack-internal:///(rsc)/./node_modules/.pnpm/@auth+prisma-adapter@1.5.1_@prisma[email protected]/node_modules/@auth/prisma-adapter/index.js:226:29)
at async acc. (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]/node_modules/@auth/core/lib/init.js:178:24)
at async Module.callback (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]/node_modules/@auth/core/lib/actions/callback/index.js:53:33)
at async AuthInternal (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]/node_modules/@auth/core/lib/index.js:39:24)
at async Auth (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]/node_modules/@auth/core/index.js:126:34)
at async /mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:63809
at async eU.execute (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:53964)
at async eU.handle (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:65062)
at async doRender (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1317:42)
at async cacheEntry.responseCache.get.routeKind (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1527:40)
at async DevServer.renderToResponseWithComponentsImpl (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1447:28)
at async DevServer.renderPageComponent (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1844:24)
at async DevServer.renderToResponseImpl (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1882:32)
at async DevServer.pipeImpl (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:895:25)
at async NextNodeServer.handleCatchallRenderRequest (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/next-server.js:269:17)
at async DevServer.handleRequestImpl (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:791:17)
at async /mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/dev/next-dev-server.js:331:20
at async Span.traceAsyncFn (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/trace/trace.js:151:20)
at async DevServer.handleRequest (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/dev/next-dev-server.js:328:24)
at async invokeRender (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:174:21)
at async handleRequest (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:353:24)
at async requestHandlerImpl (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:377:13)
at async Server.requestListener (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/start-server.js:140:13)
[auth][details]: {}
[auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror
[auth][cause]: PrismaClientKnownRequestError:
Invalid prisma.account.findUnique() invocation:

SERVER_ERROR: Server returned HTTP status 401
at In.handleRequestError (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:122:6854)
at In.handleAndLogRequestError (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:122:6188)
at In.request (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:122:5896)
at async l (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:127:10871)
at async getUserByAccount (webpack-internal:///(rsc)/./node_modules/.pnpm/@auth+prisma-adapter@1.5.1_@prisma[email protected]/node_modules/@auth/prisma-adapter/index.js:226:29)
at async acc. (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]/node_modules/@auth/core/lib/init.js:178:24)
at async Module.callback (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]/node_modules/@auth/core/lib/actions/callback/index.js:53:33)
at async AuthInternal (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]/node_modules/@auth/core/lib/index.js:39:24)
at async Auth (webpack-internal:///(rsc)/./node_modules/.pnpm/@[email protected]/node_modules/@auth/core/index.js:126:34)
at async /mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:63809
at async eU.execute (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:53964)
at async eU.handle (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:65062)
at async doRender (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1317:42)
at async cacheEntry.responseCache.get.routeKind (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1527:40)
at async DevServer.renderToResponseWithComponentsImpl (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1447:28)
at async DevServer.renderPageComponent (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1844:24)
at async DevServer.renderToResponseImpl (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:1882:32)
at async DevServer.pipeImpl (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:895:25)
at async NextNodeServer.handleCatchallRenderRequest (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/next-server.js:269:17)
at async DevServer.handleRequestImpl (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:791:17)
at async /mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/dev/next-dev-server.js:331:20
at async Span.traceAsyncFn (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/trace/trace.js:151:20)
at async DevServer.handleRequest (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/dev/next-dev-server.js:328:24)
at async invokeRender (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:174:21)
at async handleRequest (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:353:24)
at async requestHandlerImpl (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/router-server.js:377:13)
at async Server.requestListener (/mnt/c/Users/user/Documents/slug/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/start-server.js:140:13)
[auth][details]: {}
prisma:query SELECT main.Links.id, main.Links.url, main.Links.slug, main.Links.description, main.Links.createdAt, main.Links.creatorId, main.Links.clicks, main.Links.lastClicked FROM main.Links WHERE (main.Links.slug = ? AND 1=1) LIMIT ? OFFSET ?
prisma:error
Invalid prisma.links.findUnique() invocation:

SERVER_ERROR: Server returned HTTP status 401
🚧 Error (urlFromServer): [PrismaClientKnownRequestError:
Invalid prisma.links.findUnique() invocation:

SERVER_ERROR: Server returned HTTP status 401] {
name: 'PrismaClientKnownRequestError',
code: 'SERVER_ERROR',
clientVersion: '5.11.0',
meta: { modelName: 'Links' }
}


I have windows 11 but I'm doing everything in a wsl 2 ubuntu

I don't know if I've done something wrong or it's a bug


this is my .env file:

image

and this is my github oauth configuration:

image

Inicio de sesión error

Hola, reciénteme he tratado de acceder a tu aplicación, pero al momento de iniciar sesión no redirecciona correctamente.

2024-03-19.15-58-30.mp4

Proposal for Comprehensive Website Updates: Login with Apple, Plan Pro, Dashboard Enhancements, and Footer Redesign

I hope this message finds you well. I'm reaching out to propose a series of updates for Slug Website that I believe will significantly enhance user experience and elevate our platform to new heights.

Login with Apple Integration:
To bolster security and streamline the login process for our users, I propose integrating "Login with Apple" as an additional authentication option. This will provide a seamless and secure login experience, aligning with our commitment to user convenience and data protection.

Introducing Plan Pro:
Recognizing the needs of our power users, I suggest introducing a premium subscription tier called "Plan Pro." This tier will offer users the ability to add more than 30 links to their profiles, providing enhanced customization options and greater flexibility in showcasing their content.

Enhanced Link Management with Stripe Integration:
Integrating with Stripe for subscription management and payments will not only streamline the user experience but also ensure secure and efficient handling of transactions. This integration will provide users with a seamless upgrade process to Plan Pro, further enhancing their satisfaction with our platform.

Interactive Tutorial Videos:
To assist users in fully utilizing the features of Plan Pro, I recommend creating interactive tutorial videos. These videos will guide users through the subscription process and demonstrate how to make the most of the additional features. This proactive approach to user education will drive engagement and satisfaction.

Dashboard Enhancements:
In line with the introduction of Plan Pro, I propose making enhancements to the dashboard to accommodate the new features seamlessly. Specifically, I suggest allowing users to manage their Plan Pro subscription directly from the dashboard, providing them with greater control and convenience. For inspiration, I recommend reviewing similar implementations on websites like dub.sh.

Footer Redesign:
A well-designed footer is essential for improving navigation and accessibility on our website. I propose redesigning our footer to include essential links such as support, FAQs, and legal information, making them easily accessible to users. This will enhance user experience and ensure that important information is readily available.

These proposed updates are strategically aligned with our goals of enhancing user satisfaction, driving engagement, and fostering growth on Slug Website. I am eager to discuss these suggestions further and address any questions or concerns you may have.

Thank you for considering these proposals. I am confident that these updates will contribute to the continued success of Slug Website.

Best regards,
Screenshot 2024-04-05 at 8 11 01 AM
Screenshot 2024-04-05 at 8 20 26 AM
Screenshot 2024-04-05 at 8 21 01 AM

Error de login con GitHub

Holisss pheralbbb!! 😊 Como estas?

Hay un pequeño error al hacer login con GitHub, al darle a sign in, me hace un redirect a esta url 👇:

http://localhost:3000/api/auth/callback/github?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdocs.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=fNJ0FGjk2aaZmViRWOlNCOqDBQEo4nLgt6RVXIy20ZY

Vi que no hiciste cambios grandes hace poquito como para afectar algo, así que tal vez sea el token de GitHub que expiró? O el callback-url en las settings? 🤔 Te lo dejo a ti crack!! Cualquier detalle a las ordenes!!

PD: amo la app!! 🚀 🙌

Fallo de validación en el input del "Short link" (modal de edición)

Me he percatado que si eliminas la clase disabled del input "Short Link", en el modal de edición, te deja guardar el valor en base de datos y no te arroja ningún error de validación por parte del backend.

Me he creado un nuevo link llamado: "/qqqqqqq"

slug1

Si me dirijo al modal de edición y elimino la clase "disabled" me habilita el input para poder modificar el texto

slug2

Entiendo que el input será reactivo por lo tanto si guardas se modifica en el panel de links, pero no en el del modal de edición:

slug3

Pero si refrescas la página y vuelves a abrir el modal de edición si que cambia la url:

slug4

Espero que haya servido de ayuda.

Un saludo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.