Giter VIP home page Giter VIP logo

url-shorting-tool's Introduction

Url-Shorting-Tool

Url shorter written with using angular-2 framework(on client side) and spring framework(on server side)

Important info

Backend has feature that removes expired links. I set expiring period on 24 hours (in milleseconds) To change expiring period see com.github.olegbal.urlshortingtool.service.impl.ExpiredLinksServiceImpl class

Prerequisites

Make sure that you have inststalled

* nodejs v6.9.5 and higher.
* jdk 8
* maven 

Installing

cd ./client
npm install

Running

Client

To run client use

cd ./client
npm start 

Client port 4200

Server

To run server

cd ./server
mvn spring-boot:run

Server port 8080

Testing

mvn test

Server api

Auth

  • POST /api/v1/login -log in system.
  • POST /api/v1/register - register with role user/admin.

Links

  • GET /api/v1/links?page=0&size=5 -- getting paginated links
  • GET /api/v1/links?tag=tagname&page=0&size=5 -- get paged links by tag
  • GET /api/v1/links/{id} -- get link info by id
  • GET /api/v1/links?userId=1 -- get all paged user's links
  • GET /api/v1/links/check?url="adress" -- check is url exists in db
  • POST /api/v1/links?userId=1 -- create link
  • PUT /api/v1/links?userId=1 -- update user's link
  • DELETE /api/v1/links/{id} remove link by id

Shortedlinks

  • GET /api/v1/shortlinks/{linkValue} find original link in db and redirect to it (by shorted link)

Users

  • GET /api/v1/account?userName="login" -- get user account details (logn + links)

  • GET /api/v1/users -- get all registered users with role USER

  • DELETE /api/v1/user/{id} --remove user by id

Production mode

To make unified jar file use

cd ./client
ng build
cd ../server
mvn clean install

Then to run from IDE

mvn spring-boot:run

url-shorting-tool's People

Contributors

olegbal avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

url-shorting-tool's Issues

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.