SecureLink is a modern, secure URL shortening service built with React and Go. It provides features like authentication-protected links and email notifications.
demo_video.mp4
- Secure Short Links: Create shortened URLs with optional authentication protection
- User Authentication: Secure user registration and login system
- Access Control: Control who can access your shortened links
- Email Notifications: Get notified when protected links are accessed
- Dashboard: User-friendly dashboard to manage all your links
- React 19.0 with TypeScript
- Vite 6.2 for development and building
- TailwindCSS for styling
- React Router DOM for navigation
- React Toastify for notifications
- Lucide React for icons
- Go 1.24
- Chi router for HTTP routing
- GORM with PostgreSQL for database
- JWT for authentication
- SMTP for email notifications
- Godotenv for environment configuration
- Node.js 18+
- Go 1.24+
- PostgreSQL 15+
- SMTP server access for email notifications
- Navigate to the server directory:
cd server- Start PostgreSQL database using Docker Compose:
docker-compose -f docker-compose.dev.yaml up -dThis will start a PostgreSQL container with the following default credentials:
- Database: urlshortnerdb
- Username: postgres
- Password: postgres
- Port: 5432
- Create a
.envfile based on provided template:
# Server Configuration
SERVER_PORT=8080
SERVER_BASE_URL=http://localhost:8080
# Database Configuration
DB_CONNECTION_STRING=postgresql://postgres:postgres@localhost:5432/urlshortnerdb
DB_MAX_OPEN_CONNS=25
DB_MAX_IDLE_CONNS=25
DB_CONN_MAX_LIFETIME=5m
# Email Configuration
EMAIL_SMTP_HOST=smtp.gmail.com
EMAIL_SMTP_PORT=587
[email protected]
EMAIL_SMTP_PASSWORD=your-app-password
[email protected]- Install dependencies and run:
go mod tidy
go run cmd/main.goNote: To stop the database container, run:
docker-compose -f docker-compose.dev.yaml down- Navigate to the client directory:
cd client- Install dependencies:
npm install- Start development server:
npm run devclient/
├── src/
│ ├── components/ # Reusable React components
│ ├── context/ # React context providers
│ ├── pages/ # Page components
│ ├── App.tsx # Main app component
│ └── main.tsx # Entry point
├── public/ # Static assets
└── package.json # Project configuration
server/
├── cmd/
│ └── main.go # Application entry point
├── internal/
│ ├── auth/ # Authentication logic
│ ├── config/ # Configuration handling
│ ├── db/ # Database operations
│ ├── email/ # Email service
│ ├── handlers/ # HTTP handlers
│ ├── models/ # Data models
│ └── urlShortner/ # Core URL shortening logic
└── go.mod # Go module file