ShortMe
Fast & Secure URL Shortener
Fast, simple, and secure URL shortening service built with Next.js. Create short, memorable links with user authentication and dashboard management.
Tech Stack
ShortMe is a fast, simple, and secure URL shortening service built with Next.js. Create short, memorable links from long URLs with user authentication, analytics, and a modern dashboardβall backed by MySQL for reliable data persistence.
β¨ Key Features
URL Shortening
Create short, memorable links from long URLs instantly
User Authentication
Secure registration and login system for link management
Dashboard
Manage all your shortened links in one centralized place
JWT Security
Secure session management with JWT token authentication
MySQL Database
Reliable data persistence and link history tracking
Modern UI
Built with Tailwind CSS for a sleek, responsive interface
Type-Safe
Full TypeScript support for reliability and better DX
Production Ready
Fast, scalable, and ready for deployment
π Getting Started
π¦ Installation
1. Clone the repository:
git clone https://github.com/kibaofficial/shortme.git cd shortme2. Install dependencies:
npm install3. Set up database (.env):
NEXT_PUBLIC_HOSTNAME=http://localhost:3000
DEBUG=false
DB_HOST="localhost"
DB_USER="shortme"
DB_PASS="shortme"
DB_NAME="shortme"4. Start development server:
npm run devPrerequisites
- βNode.js v16 or higher
- βMySQL or MariaDB
- βnpm, yarn, pnpm, or bun
π How to Use
Register/Login
Navigate to the authentication page and create your account
Access Dashboard
After login, you'll be redirected to your personal dashboard
Create Link
Enter a long URL and get a short code instantly
Share & Track
Use your shortened link: http://localhost:3000/ShortCodeHere
ποΈ Project Structure
shortme/ βββ src/ β βββ app/ β β βββ api/ # API routes β β β βββ create-short/ # Create shortened URL β β β βββ delete-code/ # Delete link β β β βββ login/ # User login β β β βββ register/ # User registration β β β βββ ... β β βββ auth/ # Authentication page β β βββ dashboard/ # User dashboard β β βββ [code]/ # Dynamic redirect route β βββ components/ # React components β β βββ auth/ # Auth components β β βββ ui/ # UI components β β βββ ... β βββ lib/ # Utilities & services β β βββ api.ts β β βββ DB.ts β β βββ middleware.ts β β βββ ... β βββ utils/ β βββ GenerateDB.sql βββ public/ # Static assets βββ .env.example βββ next.config.mjs βββ tsconfig.json βββ tailwind.config.ts
π― Core Components
URL Shortener Engine
Efficient algorithm for generating unique short codes and managing redirects
JWT Authentication
Secure token-based session management with expiration handling
Link Management
Dashboard for viewing, editing, and deleting shortened URLs
MySQL Integration
Persistent storage with schema for users, links, and metadata
API Routes
RESTful endpoints for all shortening and auth operations
Dynamic Routing
Instant redirects using Next.js dynamic routes with [code]
π οΈ Tech Stack
βΈ Frontend
- Next.js - React framework
- TypeScript - Type safety
- Tailwind CSS - Styling
βΈ Backend & Database
- Next.js API Routes
- JWT Authentication
- MySQL/MariaDB
π‘ API Endpoints
/api/registerRegister new user account
/api/loginUser login with credentials
/api/create-shortCreate a new shortened URL
/api/[code]Redirect to original URL
/api/delete-codeRemove a shortened link
πΎ Database Schema
ShortMe uses MySQL to store user accounts, shortened links, and metadata:
Users Table
- β’id (Primary Key)
- β’username
- β’email
- β’password (hashed)
- β’created_at
Links Table
- β’id (Primary Key)
- β’user_id (FK)
- β’original_url
- β’short_code
- β’created_at
- β’expires_at
π― Status
β Completed Features
- βUser registration & login
- βURL shortening engine
- βDashboard for link management
- βJWT authentication
- βMySQL database integration
- βRedirect functionality
- βTypeScript support
π Future Enhancements
- βClick analytics & statistics
- βCustom short codes
- βQR code generation
- βLink expiration dates
- βPassword protection
- βAPI rate limiting
- βSocial sharing metrics
π Learn More
Next.js Docs
Official Next.js documentation and guides
JWT Auth
JSON Web Token authentication patterns
MySQL Docs
Database design and optimization
TypeScript
Type safety and advanced patterns
"Made with β€οΈ for efficient URL shortening and link management"