This is a full-stack URL shortener application that allows users to generate shortened URLs for long links, manage their shortened links, and track their usage statistics. Built with the PERN (PostgreSQL, Express, React, Node.js) stack, this project is designed to offer a simple and intuitive interface with a robust backend API.
- Shorten long URLs with a unique, shortened identifier.
- Store URLs in a PostgreSQL database.
- Frontend interface built with React.
- Backend server using Express and Node.js and TypeScript.
- Deployed for production use on Vercel.
- Frontend: React, CSS, React Router Dom
- Backend: Express, Node.js, Typescript
- Database: PostgreSQL
-
Clone the repository:
git clone https://github.com/Sairajepawar/URLshortner.git
-
Navigate to the project directory and set up both
frontendandbackendfolders. -
Install dependencies:
cd frontend npm install cd ../backend npm install
-
Configure environment variables in
.envfor both frontend and backend, including database credentials and API keys as needed.
a. Create .env file in frontend directoryVITE_API_BASE_URL=http://localhost:3000/
b. Create .env file in backend directory
DB_USER = user name who can access database instance PASSWORD = password of respective owner HOST = host name of database instance PORT = port number of database instance DATABASE = name of database CA = certificate authority
-
Start the application:
# In backend npm run start # In frontend npm run dev
Feel free to fork the project, raise issues, and create pull requests. All contributions are welcome!