A modern full-stack URL shortening application built with React, Node.js, Express, and MongoDB. It features a clean, responsive design and complete CRUD functionality.
- Create β Generate short URLs with optional titles and descriptions
- Read β View all your shortened URLs with detailed information
- Update β Edit existing URLs, titles, and descriptions
- Delete β Remove URLs you no longer need
- Modern UI β Responsive design with smooth animations
- Real-time Updates β Instant feedback with on-screen notifications
- Click Tracking β Monitor how many times each URL is accessed
- MongoDB Integration β Persistent, scalable data storage
- React 18 β Hooks-based modern React
- Tailwind CSS β Utility-first CSS framework
- Custom CSS β Gradients, animations, and modern UI patterns
- Node.js β JavaScript runtime
- Express.js β Web application framework
- MongoDB β NoSQL database
- Mongoose β MongoDB object modeling
- CORS β Cross-origin resource sharing
- Node.js v16+
- MongoDB (local or Atlas)
- npm or yarn package manager
- Clone the repository
git clone <repository-url>
cd URL-Shortener-main- Install server dependencies
cd server
npm install- Install client dependencies
cd ../client
npm install- Environment Setup
server/.env
DATABASE_URL=mongodb://localhost:27017/url_shortener
BASE_URL=http://localhost:5000client/.env
REACT_APP_API_URL=http://localhost:5000- Start MongoDB
- Local: Ensure the MongoDB service is running
- Atlas: Use your MongoDB Atlas connection string
- Run the application
# Terminal 1 - Backend
cd server
npm run dev
# Terminal 2 - Frontend
cd client
npm start- Access the application
- Frontend β http://localhost:3000
- Backend API β http://localhost:5000
URL-Shortener-main/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # UI components
β β β βββ Header.jsx
β β β βββ Hero.jsx
β β β βββ Main.jsx
β β β βββ Shortener.jsx
β β β βββ Notification.jsx
β β βββ App.js
β β βββ index.js
β β βββ index.css
β βββ package.json
βββ server/ # Node.js backend
β βββ controllers/ # Business logic
β βββ models/ # MongoDB schemas
β βββ routes/ # API endpoints
β βββ utils/ # Helper functions
β βββ server.js # Main server file
β βββ package.json
βββ README.md
| Method | Endpoint | Description |
|---|---|---|
POST |
/ |
Create a new short URL |
GET |
/all |
Get all URLs |
GET |
/url/:id |
Get URL by ID |
PUT |
/url/:id |
Update URL by ID |
DELETE |
/url/:id |
Delete URL by ID |
GET |
/:shortUrlId |
Redirect to original URL |
- Header β Minimal logo-based header
- Hero β Focused intro with a call-to-action
- Shortener Form β Full CRUD interface
- URL List β Card-based display with edit/delete actions
- Notifications β Real-time success/error feedback
- Statistics β Click tracking and analytics
- Update
client/src/index.cssor Tailwind config for colors, fonts, and animations - Adjust component layouts for a unique look
- Add new fields to the URL schema in
server/models/Url.js - Extend API logic in
server/controllers/url.js - Add validation or authentication for advanced use cases
Frontend (React)
npm run buildDeploy to Vercel, Netlify, or other static hosting.
Backend (Node.js) Deploy to Heroku, Railway, Render, or any Node hosting. Update environment variables for production and ensure MongoDB connection is secure.
- Fork the repository
- Create a feature branch
- Commit and push your changes
- Submit a pull request
This project is licensed under the MIT License.
- Built with modern web technologies
- Responsive and accessible UI design
- End-to-end CRUD functionality with MongoDB persistence
If you want a shorter, portfolio-ready README (one that recruiters can scan in ~10 seconds), tell me and Iβll create it.