Pages

Tuesday, 29 October 2024

slug, a URL shortener

 An open-source URL shortener.

slug.vercel.app  

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 git@github.com: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 ✨

from https://github.com/pheralb/slug

 示例:https://slug.vercel.app/bmbs

No comments:

Post a Comment