Skip to content

vishwateja231/Url_shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

πŸš€ URL Shortener – CRUD Application

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.


✨ Features

  • 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

πŸ› οΈ Tech Stack

Frontend

  • React 18 – Hooks-based modern React
  • Tailwind CSS – Utility-first CSS framework
  • Custom CSS – Gradients, animations, and modern UI patterns

Backend

  • Node.js – JavaScript runtime
  • Express.js – Web application framework
  • MongoDB – NoSQL database
  • Mongoose – MongoDB object modeling
  • CORS – Cross-origin resource sharing

πŸš€ Getting Started

Prerequisites

  • Node.js v16+
  • MongoDB (local or Atlas)
  • npm or yarn package manager

Installation

  1. Clone the repository
git clone <repository-url>
cd URL-Shortener-main
  1. Install server dependencies
cd server
npm install
  1. Install client dependencies
cd ../client
npm install
  1. Environment Setup

server/.env

DATABASE_URL=mongodb://localhost:27017/url_shortener
BASE_URL=http://localhost:5000

client/.env

REACT_APP_API_URL=http://localhost:5000
  1. Start MongoDB
  • Local: Ensure the MongoDB service is running
  • Atlas: Use your MongoDB Atlas connection string
  1. Run the application
# Terminal 1 - Backend
cd server
npm run dev

# Terminal 2 - Frontend
cd client
npm start
  1. Access the application

πŸ“ Project Structure

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

πŸ”Œ API Endpoints

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

🎨 UI Components

  • 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

πŸ”§ Customization

Styling

  • Update client/src/index.css or Tailwind config for colors, fonts, and animations
  • Adjust component layouts for a unique look

Functionality

  • 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

πŸš€ Deployment

Frontend (React)

npm run build

Deploy 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.


🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit and push your changes
  4. Submit a pull request

πŸ“ License

This project is licensed under the MIT License.


πŸ™ Acknowledgments

  • 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.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors