Coder Social home page Coder Social logo

adithyapaib / lenk.cf Goto Github PK

View Code? Open in Web Editor NEW
14.0 1.0 4.0 356 KB

A URL shortener website and PWA build with vercel serverless cloud function, MongoDB and nodeJS

Home Page: https://lenk.cf

License: MIT License

JavaScript 32.58% HTML 24.74% SCSS 26.54% TypeScript 16.14%
url-shortener nodejs mongodb javscript typescript scss vercel-serverless vercel

lenk.cf's Introduction

❤️lenk.cf

A URL shortener made using NodeJS, MongoDB, and Vercel serverless function. This project also includes a serverless API. With the help of this API, we can Integrate the URL shortener with basic static (HTML/CSS/JS ) websites. This website can also serve as a Progressive Web Application (PWA) where you can install this website as a normal Application on your PC or Phone.

 

Tech Stack

Client: HTML, SCSS, JS, Bootstrap, Materialize

Server: Node,TS, MongDB, Vercel Serveless function.

🎦 Screenshots

 

App Screenshot

 

 

💻Requirements

  • NodeJS
  • MongoDB (Atlas)
  • Vercel CLI

 

🌐Deployment

To get this poject running, firstly install vercel CLI on your PC with the following command.

  npm i -g vercel

Secondly, goto MongoDB and configure a MongoDB Atlas cluter running, Setup the MongoDB clutter and copy the URI for NodeJS application.

After the MongoDB setup is done clone this project and install the packages.

  git clone https://github.com/adithyapaib/lenk.cf
  cd lenk.cf
  npm i

create .env file in the root folder and create variable DB and paste your MongoDB URI

 DB = YOUR_URI_WITHOUT_QUOTES

After everthing is installed to locally deploy this project type

 vercel dev

Login with your Vercel account and your all set for Local Deployment on.

 localhost:3000

For web Deployment on Vercel use

 vercel deploy

 

💢 API Reference

 

API Index

  localhost:300/api/
Type File Description
string index.js Displays info about API

 

Redirect to original URL

  localhost:300/${shortId}
Parameter File Description
ShortId redirect.js Required ID of item to redirect

 

Register a new URL

 localhost:300/p/
Parameter File Description
url p.js Required url of main URL. Responds with a random shortID.

 

List all the URL's in the Database

  localhost:300/all
Parameter File Description
all.js Displays all the URL's in the database.

   

Register a custom ShortId

  localhost:300/custom/<shortIDLength>_<shortId><original_url>
Parameter File Description
<shortIDLength>_<shortId><original_url> custom.js Checks if the shortID is taken, return true if shortID is unique else return false if there exits any conflict shortID

Example

Parameter File Example
<shortIDLength>_<shortId><original_url> custom.js http://localhost:3000/3_adihttps://github.com/adithyapaib

 

If the link dosen't exits in Database

  localhost:300/404
Parameter File Description
/404 404.html 404 Page

 

🛰Environment Variables

To run this project, you will need to add the following environment variables to your .env file

DB = YOUR_MONGOURI

 

🌐Domains

Other domains to this project.

https://4543.ml

https://urml.ml

 

🚦Acknowledgements

  • Dont forget to 🙋🏼‍♂️Follow me on Github and Star⭐ this Repo

 

📑License

MIT

 

lenk.cf's People

Contributors

adithyapaib avatar ggashwin avatar mprajwalkini avatar

Stargazers

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