UrlshortenerApp is a web application that allows users to shorten long URLs into more manageable links. It provides a simple and efficient way to create, manage, and track shortened URLs.
urlshortener with nodejs and server side rendering
urlshortener.webm
shrinku with frontend vite and backend nodejs
linkshrink.webm
- Shorten long URLs
- Customizable short URLs
- Track click statistics
- User authentication and authorization
- RESTful API for URL management
To get started with UrlshortenerApp, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/UrlshortenerApp.git cd UrlshortenerApp -
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the root directory and add the necessary environment variables. Refer to.env.examplefor the required variables. --for shrinku app : go to shrinu folderPORT=3000 etc open cmd and type mongod if running on local machine then type mongosh for mongo shell MONGODB_URI=mongodb://localhost:27017/urlshort.... like :Current Mongosh Log ID: 678299a167255b97be4eeb85 Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.3.7 ```bash then run : npm install to restore the node modules do for whenever you clone the project first time and use any of shrinku or urlshortenerapp
frontend is vitejs and backend is expressjs so use npm run dev to run the project
-
Run the application: in backend directory
npm start
Once the application is running, you can access it at http://localhost:3000. Use the web interface to shorten URLs, or interact with the API using the following endpoints:
POST /api/shorten- Shorten a new URLGET /:shortUrl- Redirect to the original URLGET /api/stats/:shortUrl- Get click statistics for a short URL
We welcome contributions to improve UrlshortenerApp! To contribute, follow these steps:
-
Fork the repository.
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes and commit them:
git commit -m "Add your commit message" -
Push to the branch:
git push origin feature/your-feature-name
-
Open a pull request on GitHub.