Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShortURL

A modern, secure URL shortener built with React and Express.js.

Developed by Aadi, 2025

Screenshots

ShortURL Homepage Clean, modern interface for shortening URLs

URL Shortened Result Result view with copy functionality

Features

  • URL Shortening - Convert long URLs into short, memorable links
  • Custom Codes - Create personalized short codes
  • Analytics - Track click counts and access times
  • Responsive Design - Optimized for desktop and mobile
  • Security - Rate limiting, input validation, and security headers

Quick Start

Prerequisites

  • Node.js v14 or higher
  • npm

Installation

  1. Clone the repository:
git clone <repository-url>
cd urlshortner
  1. Install dependencies:
npm run install-all
  1. Configure environment variables:
cp .env.example .env

Edit .env with your settings (see Environment Variables section below).

  1. Start the development servers:
npm run dev
  • Frontend: http://localhost:3000
  • Backend API: http://localhost:5000

Environment Variables

Create a .env file in the root directory:

Variable Description Default
PORT Server port 5000
BASE_URL Base URL for generated short links http://localhost:5000
REACT_APP_API_URL Frontend API endpoint http://localhost:5000/api

Important: Never commit .env files to version control.

Project Structure

urlshortner/
├── assets/             # Screenshots and images
├── server/
│   ├── index.js        # Express server
│   └── database.js     # SQLite operations
├── client/
│   ├── public/
│   └── src/
│       ├── App.js      # Main component
│       └── App.css     # Styles
└── package.json

API Reference

Method Endpoint Description
POST /api/shorten Create short URL
GET /api/urls List all URLs
GET /api/stats/:code Get URL statistics
DELETE /api/urls/:code Delete a URL
GET /:code Redirect to original URL

Tech Stack

  • Backend: Express.js, SQLite, Helmet, Rate Limiting
  • Frontend: React, Framer Motion, Axios

Security

This application includes:

  • Helmet.js for security headers
  • Rate limiting (100 requests/15 min per IP)
  • Input validation and sanitization
  • SQL injection prevention via parameterized queries

For production deployment, ensure you:

  • Use HTTPS
  • Configure CORS to allow only your domain
  • Set secure environment variables
  • Use a reverse proxy (nginx/Apache)

Roadmap

Planned features and improvements for future releases:

  • User authentication and personal dashboards
  • QR code generation for short URLs
  • Custom expiration dates for links
  • API key support for developers

License

MIT


Developed by Aadi, 2025

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages