A full-stack URL shortener application built with TypeScript, React, Express.js, and PostgreSQL.
- 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
- Docker
- Docker Compose
- Clone the repository:
git clone <repository-url>
cd url-shortener- Start the application:
docker-compose upThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:4000
POST /shorten
{
"originalUrl": "https://example.com",
"alias": "custom-alias", // optional
"expiresAt": "2024-12-31T23:59:59Z" // optional
}
GET /:shortUrl
GET /info/:shortUrl
GET /analytics/:shortUrl
DELETE /delete/:shortUrl
The frontend is built with:
- React
- TypeScript
- Tailwind CSS
- Axios for API calls
The backend uses:
- Express.js
- TypeScript
- PostgreSQL with Prisma ORM
- Jest for testing
To run the tests:
# Backend tests
cd backend
yarn test