Code Monkey home page Code Monkey logo

xlug's Introduction

Xlug - Short and Manage your Long URLs

Link shortener tool that allows you to create shorter and more manageable versions of long URLs.

Stack

This is a Next.js project bootstrapped with create-next-app:

  • Next.js 13 /app directory + Typescript - The React Framework for the Web.
  • Tailwind CSS + shadcn/ui components - Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
  • Iconoir icons - An open-source library with 1300+ unique SVG icons, designed on a 24x24 pixels grid.
  • React Hook Form Performant, flexible and extensible forms with easy-to-use validation.
  • Sonner - An opinionated toast component for React.
  • SWR - React Hooks for Data Fetching.
  • Zustand - A small, fast and scalable bearbones state-management solution using simplified flux principles.

Getting Started

  1. Install dependencies:
pnpm install
  1. Create a .env file in the root folder and paste your variables:
cp -r .env.example .env

How to get Github OAuth Client ID and Client Secret

  • Click here to create new Github OAuth app
  • Set the Application name. Example: Xlug development
  • Set the Homepage URL to http://localhost:3000
  • Set the Authorization callback URL to http://localhost:54321/auth/v1/callback
  • Go to "Client secrets" and generate new client secret
  • Copy the Client ID and Client Secret, go to .env and paste them into GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET

How to setup local supabase instance

pnpm db:start

# Started supabase local development setup.

#          API URL: http://localhost:54321
#           DB URL: postgresql://postgres:postgres@localhost:54322/postgres
#       Studio URL: http://localhost:54323
#     Inbucket URL: http://localhost:54324
#       JWT secret: <jwt-secret>
#         anon key: <anon-key>
# service_role key: <service-role-key>

How to link to a supabase project

Setup supabase project

Setup database

Finally, if you followed all the previous steps your .env file should look like this:

# The supabase api url and anon key
NEXT_PUBLIC_SUPABASE_URL="<URL>"
NEXT_PUBLIC_SUPABASE_ANON_KEY="<ANON-KEY>"

# Supabase project
SUPABASE_PASSWORD="<PASSWORD>"
SUPABASE_PROJECT_REF="<REF-ID>"

# Github OAuth
GITHUB_CLIENT_ID="<CLIENT-ID>"
GITHUB_CLIENT_SECRET="<CLIENT-SECRET>"

then run the following command to setup the supabase project database:

# If not logged in run $ pnpm supabase login
pnpm db:link && pnpm db:push

Start developing

You are all set, now you can run:

pnpm dev

License

This project is MIT Licensed.

xlug's People

Contributors

dependabot[bot] avatar iswilljr avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

navezjt

xlug's Issues

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.