Giter Club home page Giter Club logo

rethink-url-shortener's Introduction

Rethink URL Shortener

https://drive.google.com/file/d/1t-h0blhJePqqwrOg7O5L3AV84yFnSRBv/view?usp=sharing

Scope

(adjusted based on time constraint)

Must have:

  • Ability to create unique, short URL from a given destination URL - done
  • Redirect short URL to destination URL - done
  • API documentation - in progress: needs to provide schema and examples
  • Test coverage - in progress

Nice to have:

  • In memory cache - in progress
  • Anlytics on usage - not started
  • Custom short URLs - not started
  • Docker file for fast configurations and deployment - not started
  • distributed servers and load balancing - not started

Not in scope:

  • short urls suggestions

run locally

  • FORK this repo

back-end

  • cd backend
  • update mongodb credentials in .env
  • Add this line to nginx config
location ~* "^/[0-9a-zA-Z]{1,15}$"  {
	        rewrite ^/(.*)$ http://localhost:1337/shortLink/get/$1 redirect;
}

change port 1337 to process.env.PORT if neccesary

  • run npm install && node database/seed.js && npm start

  • documentation: localhost:1337/api-docs

  • example usage: Create short link: curl -H "Content-Type: application/json" -X POST -d '{"destinationURL":"aloha.com"}' http://localhost:1337/shortLink/create

    Redirect to destinational URL: curl -X GET http://localhost:1337/shortLink/get/hht response: Found. Redirecting to https://goplanatrip.com

  • testing: npm test

front-end

  • cd frontend
  • run npm install & npm start

TODO

(in addition to scope)

  • return existing short url if destination url exisits
  • clean and adequate success and error response and messages

libraries used

Swagger for API Documentation

Mongoose object modeling for Mongo

mocha, chai, and mongo-unit with minimum set-up and fast in-memory database for testing

rethink-url-shortener's People

Contributors

cherchercher avatar

Watchers

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