A full-stack URL shortener application with JWT-based authentication, comprehensive analytics, and modern UI components.
- Authentication: JWT-based authentication with modern login/register forms
- User Management: User-specific URL management with secure sessions
- Analytics Dashboard: Comprehensive analytics with visual charts and statistics
- Modern UI: Component-based architecture with improved design
- Responsive Design: Mobile-first design that works on all devices
- URL Management: Create, view, and track shortened URLs
- Click Analytics: Detailed click tracking and performance metrics
- Component Architecture: Modular, maintainable codebase
- Backend: Node.js, Express, MongoDB, JWT
- Frontend: React, TypeScript, Vite
- Authentication: JWT tokens with bcrypt password hashing
- UI Components: Custom React components with modern CSS
- AuthForm: Modern login/register interface with password visibility toggle
- Navbar: Responsive navigation with user profile and logout functionality
- Analytics: Comprehensive dashboard with statistics and visual charts
- UrlShortener: Enhanced URL creation form with success feedback
- UrlList: Improved URL display with better card design and interactions
- Navigate to backend directory:
cd backend
- Install dependencies:
npm install
- Set environment variables:
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production PORT=5000 MONGODB_URI=mongodb://localhost:27017/url-shortener
- Start server:
npm run dev
- Navigate to frontend directory:
cd frontend
- Install dependencies:
npm install
- Start development server:
npm run dev
- Users must register/login to access the application
- JWT tokens are stored in localStorage
- All URL operations require authentication
- Users can only see and manage their own URLs
POST /api/auth/register
- User registrationPOST /api/auth/login
- User login
POST /api/shorten
- Create short URLGET /api/urls
- Get user's URLsGET /:shortUrl
- Redirect to original URL (public)
Create a .env
file in the backend directory with:
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
PORT=5000
MONGODB_URI=mongodb://localhost:27017/url-shortener
``` # BlinkLink