This project was crafted with the help of Antigravity, an advanced AI coding assistant, ensuring premium design and functionality.
Watch the demo above to see TinyLink in action! Features showcased: smooth dark/light mode toggle with icon rotation, scrolling to view the footer, creating links with auto-generated codes, creating links with custom codes, animated gradient backgrounds, glassmorphism effects, and responsive design.
- Shorten URLs: Create short, memorable links instantly
- Custom Codes: Choose your own custom alias (6-8 alphanumeric characters)
- Analytics Dashboard: Track clicks and last access time for all your links
- Link Management: View, copy, and delete links with ease
- API: Full REST API for programmatic access
- 🌓 Dark Mode: Seamless dark/light theme toggle with persistent settings
- ✨ Smooth Animations: Beautiful transitions and micro-interactions throughout
- 🎨 Animated Gradients: Dynamic, flowing gradient backgrounds
- 💎 Glassmorphism: Modern frosted-glass card designs
- 🎭 Icon Animations: Rotating animations on dark mode toggle
- 📱 Fully Responsive: Optimized for all screen sizes
- 🎯 Modern Typography: Custom Outfit font family from Google Fonts
- Backend: Node.js, Express
- Database: PostgreSQL
- Frontend: React 18, Vite
- Styling: Tailwind CSS v4 (Oxide Engine)
- State Management: React Context API (Dark Mode)
- Routing: React Router v6
- Deployment: Render / Railway
- Node.js (v18+)
- PostgreSQL database
-
Clone the repository:
git clone https://github.com/yourusername/tinylink.git cd tinylink -
Install dependencies:
npm install cd client && npm install && cd ..
-
Set up environment variables: Create a
.envfile based on.env.exampleand add yourDATABASE_URL.cp .env.example .env
Example
.env:DATABASE_URL=postgresql://user:password@localhost:5432/tinylink BASE_URL=http://localhost:3000 PORT=3000 -
Run migrations:
npm run migrate
-
Start the development servers:
npm run dev
This will start both the backend (port 3000) and frontend (port 5173).
-
Open
http://localhost:5173in your browser to see the React app.
TinyLink features a premium, modern design that focuses on aesthetics and user experience:
- Animated Gradient Backgrounds: Dynamic, flowing gradients that shift smoothly using CSS keyframe animations
- Glassmorphism Effects: Frosted-glass card designs with backdrop blur for a sophisticated look
- Dark Mode: Context API-powered theme system with smooth 0.3s transitions on all elements
- Icon Rotation Animations: Delightful 360° rotation on the sun/moon icon when toggling themes
- Gradient Text: Eye-catching gradient text effects on headings
- Responsive Layout: Mobile-first design that scales beautifully across all devices
- Micro-interactions: Hover effects, transform animations, and shadow transitions on buttons and cards
- Light Mode: Vibrant gradients (coral, pink, cyan, teal) with purple accents
- Dark Mode: Deep gradients (royal blue, violet, pink, sky blue) with indigo accents
TinyLink/
├── api/ # API route handlers
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── Layout.jsx # Main layout with header/footer
│ │ │ ├── LinkForm.jsx # URL submission form
│ │ │ ├── LinkList.jsx # List of shortened links
│ │ │ └── DeleteModal.jsx # Confirmation modal
│ │ ├── context/ # React Context providers
│ │ │ └── DarkModeContext.jsx # Dark mode state management
│ │ ├── pages/ # Page components
│ │ ├── index.css # Global styles & animations
│ │ └── App.jsx # Main app router
├── migrations/ # Database migrations
├── public/ # Static assets
├── scripts/ # Utility scripts
├── db.js # Database connection
├── server.js # Express server
└── package.json
- Uses React Context API for global state management
- Persists user preference in
localStorage - Smooth 300ms transitions on all UI elements
- Animated icon rotation (600ms) when toggling
- Create links with auto-generated or custom codes (6-8 chars)
- Real-time validation and error handling
- Copy-to-clipboard functionality
- Delete with confirmation modal
- Click analytics tracking
POST /api/links
Request:
{
"url": "https://example.com/very/long/url",
"code": "custom" // optional
}Response (201 Created):
{
"code": "custom",
"url": "https://example.com/very/long/url"
}GET /api/links
Response (200 OK):
[
{
"code": "abc1234",
"url": "https://google.com",
"clicks": 5,
"last_clicked": "2023-10-27T10:00:00.000Z",
"created_at": "2023-10-26T10:00:00.000Z"
}
]GET /api/links/:code
Response (200 OK):
{
"code": "abc1234",
"url": "https://google.com",
"clicks": 5,
"last_clicked": "2023-10-27T10:00:00.000Z",
"created_at": "2023-10-26T10:00:00.000Z"
}DELETE /api/links/:code
Response (200 OK):
{ "ok": true }- Push code to GitHub.
- Create a new Web Service on Render or Railway.
- Connect your repository.
- Add Environment Variables:
DATABASE_URL: Your Postgres connection string (you can create a Postgres service on Render/Railway/Neon).BASE_URL: Your production URL.
- Build Command:
npm install - Start Command:
npm start - Important: Run the migration. You can add it to the start command
npm run migrate && node server.jsor run it manually via the shell.
MIT
Built with the help of Antigravity, an advanced AI coding assistant.
