Git Product home page Git Product logo

url-shortner's Introduction

URL Shortener

Setup

  1. Clone the repository by running the following command
$ git clone [email protected]:chaharshivam/url-shortner.git
  1. Now, go to the cloned directory
$ cd url-shortner
  1. Install dependencies by running the following commands
$ yarn install --check-files
$ bundle i
  1. Setup the database
$ rails db:create db:migrate db:setup
  1. Now create a env file with ROOT_URL
$ touch .env
$ echo "ROOT_URL=http://localhost:3000" > .env
  1. Now we can run the rake tasks as follows
$ URL=https://bigbinary.com/jobs bundle exec rake app:encode

$ SHORTURL=https://short.is/tkLo2367 bundle exec rake app:decode 

Assignment 2 - Reactify App

App is deployed here

Design

  • urls table should have a boolean field pinned with a default value of false
  • The urls returned at index action are in the following order:
    • Pinned urls in chronological order i.e. The latest pinned url is at the top
    • Non-Pinned urls in chronological order but after the pinned urls

API

index:
  method: 'GET'
  path: '/'
  responses:
    200: Returns a list of urls
    404: Not Found
    422: Unprocessable Entity

create:
  method: 'POST'
  path: '/urls'
  parameters:
    url:
      original: 'original url e.g. https://bigbinary.com'
  responses:
    200: Returns the url with shortened link
    422: Unprocessable Entity

show:
  method: 'GET'
  path: '/urls/:slug'
  parameters:
    slug: unique slug
  responses:
    200: Returns the url object with original url
    404: Not Found

update:
  method: 'PUT'
  path: '/urls/:slug'
  parameters:
    slug: unique slug
    url:
      pinned: 'true/false'
  responses:
    200: Returns the updated url
    404: Not Found
    422: Unprocessable Entity
  

url-shortner's People

Contributors

shivamsinghchahar avatar

Stargazers

 avatar

Watchers

 avatar

url-shortner's Issues

Name of the app

Please change the name of the app from "Ur.ly" to "Citly".

In case you are wondering why this issue is coming up, I'm trying to get this app to the state where I could show to the future interns what they need to build.

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.