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.
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
Backend Side:
docker pull joanbency/backend:latest
Frontend Side:
docker pull joanbency/frontend:latest
Mongo:
docker pull joanbency/mongo:3.6.19-xenial
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.
In order to run this project you need:
- Node.js
- npm
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
Server Side:
npm start
Client Side:
npm start
We use Jest for unit testing on the Server side. To run tests, run the following command:
Server Side:
cd backend
npm test