An awesome URL Shortener application based on website
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
URL Shortener Application is a web application that allow their user to shorten a URL based on the original one. The shorter URL can be customize as well by user. If the shorter URL is not provided, then the system will automatically generate a random short URL for their user. This application also came with basic authentication features as well, such as login, register, and logout.
Main technology used to built this application are listed below:
To get started with this project locally, follow below steps:
Make sure you have package manager (either npm or yarn)
FYI: This project uses yarn as package manager, but you're free to use npm too.
- Install Yarn (Only for user who want to use yarn)
npm i -g yarn
Below steps will guide you through the local installation process of this application
- Clone the repo
git clone https://github.com/stanleyclaudius/url-shortener.git
- Install project dependency
Make sure that your terminal pointing at the root directory of this project (url-shortener folder). And you can open up 2 terminal to run below commands:cd client && yarn install
cd server && yarn install
- Complete the .env variable
Rename .env.example file atserver
directory become.env
, then fill the value for every key. Below is the guideline for filling the .env value:
Key What To Fill Example Value PORT Your server port 5000 DB_NAME Your database name url_shortify DB_USER Your PostgreSQL username postgres DB_PASS Your PostgreSQL password root CLIENT_URL Your client side URL http://localhost:3000 ACCESS_TOKEN_SECRET Random complex string for JWT DUhxdx183)_--aACN#2% REFRESH_TOKEN_SECRET Random complex string for JWT 17hdjcD7ud(-*&732~ - Create a database with name corresponding to your
DB_NAME
value at .env file - Change directory to client folder, and look for
fetchData.ts
file atclient/src/utils/
folder, then changeaxios.defaults.baseURL
to your server url (e.g. http://localhost:5000) - Lastly, spin off the application by running 2 terminal at the same time, with commands such as below:
cd client && yarn start
cd server && yarn dev
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
LinkedIn: Stanley Claudius
Project Link: https://github.com/stanleyclaudius/url-shortener
Special thanks to:
- Othneildrew for providing an amazing README template.
- React Icons for providing icon to be used in this application.
- Tailwind CSS for providing CSS framework to be used in this application.
- Vercel for providing frontend hosting service for this application.
- Heroku for providing backend hosting service for this application.