Skip to content

andmast/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Short.ly url shortener

Preview

Full site

Top 5 visited Short.ly Links

Scoreboard

All Short.ly Links

Full Url List

Error handling

Validating Url with Http(s)

Success

Success

Yuhu Project

Part 1 (Backend).

Add API endpoints that allow a user to submit a URL and access a shortened version.

Considerations:

  • What pieces of data do we care about storing? What if we wanted statistics?
  • Should the data be mutable?
  • How long should the shortened part of the URL be? Could it be dynamically sized?

Part 2 (Front end) .

Create a front end in React that allows for submitting a URL and displaying the shortened version.

Considerations:

  • What is important to validate?
  • How should the network requests be sent?
  • How would we view statistics about a URL?

Part 3 (Optional) .

This section can be considered a nice-to-have. Add a scoreboard to the landing page displaying the top 5 URLs.

Considerations:

  • You can choose to rank based on number of times requested vs number of times submitted

Dependencies

Server

  • config - "^3.2.4",
  • express - "^4.17.1"
  • metaget - "^1.0.6"
  • mongoose - "^5.8.7"
  • shortid - "^2.2.15",
  • valid-url - "^1.0.9"

Client

  • axios - "^0.19.1",
  • react - "^16.12.0",
  • react-dom - "^16.12.0",
  • react-scripts - "3.3.0",
  • semantic-ui-react - "^0.88.2",
  • valid-url - "^1.0.9"

Setup

  1. Fork and clone repo into your machine

  2. npm install
    cd client
    npm install
    cd ..
    
  3. Create an MONGODB ATLAS Account

  4. Deploy a Free Tier Cluster

  5. Whitelist Your Connection IP Address

  6. Create a MongoDB User for Your Cluster

  7. Connect to Your Cluster using Node.js

Click Connect Click Connect Tab Click Connect your Application Tab Click Connect your Application Tab Click Connect your Application Tab Copy Connection String

  1. Using the default.example.json in /config as a guide create a default.json file and add in your connection string filling out the password section with your newly created user and password.
{
  "mongoURI": "mongodb+srv://<user>:<password>@cluster0-cecdk.mongodb.net/test?retryWrites=true&w=majority",
  "baseUrl": "http://localhost:5000"
}
  1. Start up server and client by running conncurrently command npm run dev

  2. You can now view client in the browser.

About

url-shortener

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published