Code Monkey home page Code Monkey logo

shortly's Introduction

SHORTIFY | SELF HOSTE URL-SHORTER

Welcome to Shotify, your easy-to-use URL shortener! Quickly shorten your long links with a single click, making them perfect for sharing on social media, emails, or anywhere you need a concise link. Try it now!

SELF HOSTING

  1. Set up your own Pocketbase on your server or on PocketHost and sign in.
  2. Download the pb-schema.json file and open the settings in Pocketbase. Import the schema file.
  3. Clone this repository to your GitHub account.
  4. Navigate to the code in the src/lib folder and open pb.ts. Replace the URL with your own Pocketbase URL.
  5. Deploy the repository on Vercel or your preferred hosting platform. Create a .env file with the user credentials you used to sign in to Pocketbase (refer to .env.example).
  6. After completing all the previous steps, you can deploy the URL shortener.

Run Locally

To run this project locally, follow these steps:

  npm i pnpm -g
  pnpm i
  pnpm run dev

To build the project:

  pnpm run build

API Endpoints

  1. Make an account on Shortly and log in.
  2. Get your userID here
  3. To generate an API key, go to Profile Settings and click Generate API KEY.

Create Entry

curl --request POST \
  --url https://shortly.bytebridge.tech/api/v1/create \
  --header 'x_user: [Your_Username]' \
  --header 'x_key: [Your_API_Key]' \
  --header 'x_url: [Your_Url]'

Delete Entry

curl --request DELETE \
  --url https://shortly.bytebridge.tech/api/v1/delete \
  --header 'x_user: [Your_Username]'\
  --header 'x_key: [Your_API_Key]' \
  --header 'x_id: [Your_Entry_Id]'

You will receive your entry ID when you create an entry.

Get One Entry

curl --request GET \
  --url https://shortly.bytebridge.tech/api/v1/getOne \
  --header 'x_user: [Your_Username]' \
  --header 'x_key: [Your_API_Key]' \
  --header 'x_id: [Your_Entry_Id]'

Get All Entries

curl --request GET \
  --url https://shortly.bytebridge.tech/api/v1/getAll \
  --header 'x_key: [Your_API_Key]' \
  --header 'x_user: [Your_Username]'

Update Entry

curl --request PATCH \
  --url https://shortly.bytebridge.tech/api/v1/update \
  --header 'x_user: [Your_Username]'\
  --header 'x_key: [Your_API_Key]' \
  --header 'x_id: [Your_Entry_Id]' \
  --header 'x_name: [Your_new_Entryname | not required]' \
  --header 'x_url: [Your_new_url | not required]'

If you are self-hosting the platform, follow these steps using your own URL.

Roadmap

We welcome your suggestions! If you have any ideas, please feel free to create an issue. If you have any ideas, please do not hesitate to create a topic.

  • short urls ✔

  • Qr-codes ✔

  • add password requierd links ⭕

  • multi custome domain support ⭕

  • add meta tags ⭕

Live Version

Here

License

MIT

shortly's People

Contributors

tsc-home avatar louist2469 avatar

Watchers

 avatar

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.