Skip to content

JoanBency/UrlShortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

Table of Contents

URL Shortener

URL Shortener is an app where you can submit a long URL and display the registered shorten URL.

More Documentation can be found in the README.md file in backend directory.

Platform Used

Frontend - React.js

Backend - Node.js, Express, MongoDB

(back to top)

Deploying on Docker

Client and Server can be deployed using Docker compose

Backend Side:

  docker build -t "backend" ./backend/

Frontend Side:

  docker build -t "frontend" ./frontend/

Docker Compose

  docker compose up

(back to top)

Docker Images

Backend Side:

  docker pull joanbency/backend:latest

Frontend Side:

  docker pull joanbency/frontend:latest

Mongo:

  docker pull joanbency/mongo:3.6.19-xenial

(back to top)

Getting Started on local

Clone the code from GitHub and unzip it. Folder named frontend holds the React.js Client code while the folder backend holds the Node.js Server code.

Prerequisites

In order to run this project you need:

  1. Node.js
  2. npm

Setup

Backend Side:

  cd backend

  npm install

Frontend Side:

  cd frontend

  npm install

Create a .env.local file for backend and add the value for MONGO_URI, DB_URI, BASE_URL as the url of the localhost with port server is run on, if you want a new one. eg: BASE_URL=http://localhost:3000

Usage

Server Side:

  npm start

Client Side:

  npm start

Run tests

We use Jest for unit testing on the Server side. To run tests, run the following command:

Server Side:

  cd backend
  npm test

(back to top)

Documentation

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published