Skip to content

Sudharshaun/url-shortner

Repository files navigation

url-shortner

Pass your original URL and get a shortened version of it.

Introduction

The application is built on MERN stack. Node.js, Express as server and MongoDB for database. Client side code is written in React and the backend API is written using Express. Used Create React App boilerplate to get started.

This is a simple full stack React application with a Node.js and Express backend. Client side code is written in React and the backend API is written using Express. This application is configured with Airbnb's ESLint rules and formatted through prettier.

Prerequisite

  • NodeJS (12.0+)
  • ExpressJS
  • NPM latest.

Libraries Used (Backend)

Libraries used (Client)

Quick Start

# Clone the repository
git clone https://github.com/Sudharshaun/url-shortner.git

# Go inside the directory
cd url-shortener

# Install dependencies
yarn (or npm install)

# Start development server
yarn dev (or npm run dev)

# Build for production
yarn build (or npm run build)

# Start production server
yarn start (or npm start)

Folder Structure

All the source code will be inside src directory. Inside src, there is client and server directory. All the frontend code (react, css, js and any other assets) will be in client directory. Backend Node.js/Express code will be in the server directory.

APIs

  • /api/getAllUrls (GET) - Fetches all the URLs saved in the DB
  • /api/:shortUrl (GET) - Called when Short URL is hit. (In URL bar, usually)
  • /api/shorturl (POST) - Validates the given URL and generates a short URL then saves it in DB.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published