Giter VIP home page Giter VIP logo

url-shortener's Introduction

url-shortener

Description: Project is build using Angular, Node.js, Express.js, MySQL

Use Case:

  1. This is a url shortener web app which converts the original url to short and on using the short url generated it redirects the user to the original URL.
  2. User can also give his own custom name(optional) for the url which will be attached to the root url to form the full url which will be in usable form. This should be of min length of 5 characters.
  3. On statistics page, on entering a valid custom url address either full url or short url id/ custom name to get the insights about it. That is, shows the total num of views of the custom url, viewer ip, generates the graph of views/month

(A) Steps to run

  1. git clone https://github.com/divya661/url-shortener.git
  2. cd url-shortener

(B) Run Command to start the front-server: For angular project

  1. cd app-ui\url-shortener
  2. npm install
  3. ng serve
  4. http://localhost:4200/index

(C) Run command to start the backend server: For node.js( runs on port no 3000)

  1. cd app-server
  2. npm install
  3. Create database url_shortener using Create database url_shortener;
  4. Change the password in db_config.js file to password of your database in app-server folder
  5. Create the tables urls and stats in your database by running the below given DDL commands
  6. npm start

Schema for urls table:

create table urls(url_id int not null auto_increment,url_original varchar(5000) not null,url_short varchar(100),url_datetime datetime, url_ip varchar(16),url_num_of_views int,primary key(url_id) );

Schema for stats table:

create table stats(stat_id int auto_increment, url_id int,click_date datetime,url_ip varchar(16),url_short varchar(100),primary key(stat_id),constraint fk_url_id foreign key(url_id) references urls(url_id) on delete cascade);

The schema of the database and tables is present is schema.txt in app-server folder or check here https://github.com/divya661/url-shortener/blob/master/app-server/schema.txt

After running on my localhost results were obtained by me are concluded in the following below images:

Main site

  1. home_page.jpg
  2. result_page.jpg
  3. stat_page.jpg

Database result images:

  1. urls_mysql_table.jpg
  2. stats_mysql_table.jpg

Backend server results:

  1. custom_url_name_added.jpg
  2. added_new_url.jpg
  3. statistics_api_result.jpg

url-shortener's People

Contributors

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