drgatooo / fwrd.lol

Official code for fwrd.lol website RELEASED :))))))))))
https://fwrd.lol
MIT License
0 stars 0 forks source link
google-oauth2 linkinbio mongodb nextjs oauth2 prisma qrcode url-shortener

fwrd.lol ๐Ÿ”—

An open-source URL shortener, QR code generator, and link-in-bio service. Built with Next.js, Tailwind CSS, and Prisma.

Getting Started ๐Ÿš€

  1. Clone the repository:
git clone https://github.com/drgatooo/fwrd.lol.git
  1. Install the dependencies:
npm install
# or
yarn install
# or
pnpm install
  1. Set up the environment variables:

Rename the .env.example file to .env and fill in the required environment variables. Here is a guide to the environment variables:

๐Ÿ“‚ Database

By default, the application uses MongoDB, and Prisma as the ORM. You can change the database to any other supported by Prisma.

datasource db {
    provider = "mongodb" // Change this to your preferred database
    url      = env("DATABASE_URL")
}

Update the DATABASE_URL .env variable with your database connection string.

๐Ÿ”‘ Google OAuth

๐Ÿ”’ NextAuth

To create a good value for the NEXTAUTH_SECRET, run the following command:

openssl rand -base64 32

In NEXTAUTH_URL, set the URL of your application (or localhost if you're on development).

NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret

๐Ÿ“ท ImgBB API key

๐Ÿ”ฎ Admin Key

Set a custom ADMIN_KEY in the .env file. This key is used to make POST requests to set Premium users.

๐Ÿ”ง KV Store

  1. Generate Prisma database
npx|yarn|pnpm prisma generate
  1. Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result.

Contributing ๐Ÿค

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.