Skip to content

tertt-dev/3205

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

A full-stack URL shortener application built with TypeScript, React, Express.js, and PostgreSQL.

Features

  • Create short URLs with optional custom aliases
  • Set expiration dates for URLs
  • Track click counts and visitor analytics
  • Modern, responsive UI with Tailwind CSS
  • Docker support for easy deployment

Prerequisites

  • Docker
  • Docker Compose

Getting Started

  1. Clone the repository:
git clone <repository-url>
cd url-shortener
  1. Start the application:
docker-compose up

The application will be available at:

API Endpoints

Create Short URL

POST /shorten
{
  "originalUrl": "https://example.com",
  "alias": "custom-alias",  // optional
  "expiresAt": "2024-12-31T23:59:59Z"  // optional
}

Redirect to Original URL

GET /:shortUrl

Get URL Info

GET /info/:shortUrl

Get URL Analytics

GET /analytics/:shortUrl

Delete URL

DELETE /delete/:shortUrl

Development

Frontend

The frontend is built with:

  • React
  • TypeScript
  • Tailwind CSS
  • Axios for API calls

Backend

The backend uses:

  • Express.js
  • TypeScript
  • PostgreSQL with Prisma ORM
  • Jest for testing

Testing

To run the tests:

# Backend tests
cd backend
yarn test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published