A modern full-stack URL shortener built with React and Node.js/Express. Users can create short links, customize slugs, track visits, and manage their links in a user-friendly dashboard.
- Current Frontend: https://urlchanged.vercel.app
- Current Backend/API: https://url-shortner-eoyu.onrender.com
Previously deployed on the custom domain shrtit.tech with the API hosted at api.shrtit.tech. The project has since been migrated to its current Vercel and Render deployment infrastructure.
- Shorten URLs with optional custom slugs
- User authentication with login and registration
- Custom aliases for authenticated users
- Personal dashboard to manage links
- Visit tracking and analytics
- One-click copy to clipboard
- Responsive UI with modern design
- Smooth animations using Framer Motion
- Data synchronization with TanStack React Query
- React
- Tailwind CSS
- Framer Motion
- TanStack React Query
- Redux Toolkit
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT Authentication
- HttpOnly Cookies
- Frontend: Vercel
- Backend: Render
- Node.js
- npm
- MongoDB Atlas or Local MongoDB
git clone https://github.com/Sohaibkundi2/url-shortner.git
cd url-shortnercd BACKEND
npm installCreate a .env file:
PORT=3000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
CLIENT_URL=http://localhost:5173Run backend:
npm run devBackend runs at:
http://localhost:3000
cd FRONTEND
npm install
npm run devCreate .env frontend and backend:
frontend:
VITE_API_BASE_URL=http://localhost:3000/backend:
PORT = 3000
MONGO_URI = ...
APP_URL = http://localhost:3000/
JWT_SECRET = ...Frontend runs at:
http://localhost:5173
- Open the application.
- Register or log in.
- Enter a long URL.
- Optionally create a custom slug.
- Generate and share your shortened URL.
- Track link activity from your dashboard.
url-shortner/
├── BACKEND/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ └── app.js
│
├── FRONTEND/
│ ├── src/
│ │ ├── api/
│ │ ├── components/
│ │ ├── pages/
│ │ └── App.jsx
│ └── vite.config.js
│
├── README.md
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
└── .gitignore
The project uses rewrites to support:
- React client-side routing
- URL slug redirection
- API proxying
- JWT-based authentication
- Secure HttpOnly cookies
- Protected frontend and backend routes
- Persistent login sessions
This project is intended for educational and portfolio purposes.
- React
- Express.js
- MongoDB
- Framer Motion
- TanStack Query
Sohaib Kundi
Full-Stack Developer | Web Engineer
GitHub: https://github.com/Sohaibkundi2

