Coder Social home page Coder Social logo

shortlr's Introduction

alt text

shortlr

An URL shortening service written in express

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

  • NodeJS
  • Node Package Manager(NPM)
  • Git
  • PostgreSQL

Installing

A step by step series of examples that tell you have to get a development environment running

  1. Download ZIP file or clone the repository to create your own copy.
git clone https://github.com/coding-blocks/shortlr
  1. Move to the shortlr repository
cd ./shortlr
  1. Install all project dependency packages via NPM
npm install
  1. Set up PostgreSQL
  • If you don't have PostgreSQL setup on you machine you can download it from here.

  • After Installation is complete create a new PostgreSQL user shorturl with password as shorturl.

  • Create a new database in PostgreSQL server with name shorturl.

  1. Start the server.
npm start

And see it working on http://localhost:4000/admin

Deploying to Heroku

heroku create
git push heroku master
heroku open

Alternatively, you can deploy your own copy of the app using this button:

Deploy to Heroku

Authors

See also the list of contributors who are participating in this project.

Demo

Shortlr demo

NPM

shortlr's People

Contributors

abhishek97 avatar ananay avatar apoorvaagupta avatar bajajerk avatar bhavyaagg avatar championswimmer avatar dhroov7 avatar ghoomtaaaina avatar pg07codes avatar prateek27 avatar rahulyadav170923 avatar replaycoding avatar rishabh570 avatar roh777 avatar shuboy2014 avatar tech4gt avatar thenamankumar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shortlr's Issues

Add a COPY Button

Add a Copy Button to Copy the generated shortened URL to clipboard.

18596956_10209150888798638_1060438098_o

What is the license

It would be nice to know which license this code is released under. Thanks.

Find a bug / suggest a feature

Win 20 bounty points by doing either -

  • Find a bug

For this you have to mention expected result, and actual outcome, and post screenshots (if required) to substantiate. Vague bug reports that can't be reproduced will not be entertained

or

  • Suggest a feature

Suggest a feature that can be added. Flesh it out with technical details, and steps required to implement. Post mocks (if required) to explain the feature. It will be considered for bounty if the maintainers consider the feature suggestion valid and decide to work on it.


For either case, file a bug or suggest a feature by opening a new issue.

URL Field accepts invalid URL

wergt

The URL Field accepts any input and generates short URL for that input, URL checking can be done using a regular expression for URL (Regex)
The code below can be used to check if the input is a valid URL

let expression = /[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi;
let regex = new RegExp(expression);

if(!siteURL.match(regex)){
    alert('Please use a valid URL');
    return false;
}

SHORTLR home page UI Changes

shotlr_ui_fix

Changes to be made -
Add a medium size SHORTLR Logo ( use CB Logo for now ) in the middle.
Followed these two headlines -
Bigger - "A link contains much more than you think "
Smaller - "Shorten and share links with Shortlr"

Reduce form width.

When going to cb.lk/admin, always redirect to https://

Let's just do it from the frontend with a simple js line, instead of setting up nginx/apache redirects on the hosting provider.

We need to make sure the passcode never goes over http. Rest of the api can work over http, not an issue

unable to start development server

I followed all the steps as explained in the readme. But after npm start server does not start, but keeps giving out this error:

internal/modules/cjs/loader.js:584
    throw err;
    ^

Error: Cannot find module '../secrets'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/adityasrivast/shortlr/utils/db.js:8:17)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/adityasrivast/shortlr/utils/shortner.js:5:12)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.

add search by longurl

allow searching by long url, to see if any shortcodes of that url exist.
(make it restricted via a secret passphrase, so only admins can use this search functionality)

Heroku app deployment fails

When deploying on heroku or cloning and running on local machine, it breaks.

The issue is with secrets.json file

Rectify Stats Page

Stats Page only shows top 30 Results. Add more results for Admin/Employee after OneAuth Login.

add captcha

Add Invisible recaptcha to the webpage.
The script must be loaded using the HTTPS protocol and can be included from any point on the page without restriction.

UI improvements needed

/static/admin/ UI should be improved. Currently based on bootstrap only. The form and also the stats table don't look good.

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.