{"id":23031403,"url":"https://github.com/sinanptm/shortify","last_synced_at":"2026-04-08T20:03:01.166Z","repository":{"id":268252849,"uuid":"903681310","full_name":"sinanptm/shortify","owner":"sinanptm","description":"Shortify is a powerful and secure URL shortening service designed for developers who need an efficient way to manage and shorten long URLs. Built using modern technologies like Node.js, TypeScript, Express, and Redis, this API ensures high performance, scalability, and security for users.","archived":false,"fork":false,"pushed_at":"2025-01-03T13:18:08.000Z","size":472,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T01:45:00.462Z","etag":null,"topics":["caching","express","jest","jwt","nodejs-api","passportjs","redis","rest-api","testing","url-shortener-api"],"latest_commit_sha":null,"homepage":"https://shortify.avm-ayurvedic.online/api/auth/google","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinanptm.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-15T09:16:49.000Z","updated_at":"2025-01-09T02:47:19.000Z","dependencies_parsed_at":"2024-12-15T15:32:03.294Z","dependency_job_id":"c6ddc530-4f61-4013-ae11-d1cb8719dea3","html_url":"https://github.com/sinanptm/shortify","commit_stats":null,"previous_names":["sinanptm/shortify"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sinanptm/shortify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanptm%2Fshortify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanptm%2Fshortify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanptm%2Fshortify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanptm%2Fshortify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinanptm","download_url":"https://codeload.github.com/sinanptm/shortify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinanptm%2Fshortify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["caching","express","jest","jwt","nodejs-api","passportjs","redis","rest-api","testing","url-shortener-api"],"created_at":"2024-12-15T15:36:55.816Z","updated_at":"2026-04-08T20:03:01.133Z","avatar_url":"https://github.com/sinanptm.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔗 Shortify - URL Shortener API\n\n[![TypeScript](https://img.shields.io/badge/TypeScript-4.0-blue.svg)](https://www.typescriptlang.org/)\n[![Node.js](https://img.shields.io/badge/Node.js-22.x-green.svg)](https://nodejs.org/)\n[![Express](https://img.shields.io/badge/Express-4.x-lightgrey.svg)](https://expressjs.com/)\n[![Redis](https://img.shields.io/badge/Redis-4.x-red.svg)](https://redis.io/)\n[![Jest](https://img.shields.io/badge/Jest-29.x-orange.svg)](https://jestjs.io/)\n[![Passport](https://img.shields.io/badge/Passport-0.6-green.svg)](https://www.passportjs.org/)\n\n## 📚 Contents\n[📖 Overview](#-overview) | \n[⚙️ Prerequisites](#%EF%B8%8F-prerequisites) | \n[🛠 Tech Stack](#-tech-stack) | \n[📊 Features](#-features) | \n[🔌 API Endpoints](#-api-endpoints) | \n[🔐 Authentication Setup](#-authentication-setup) | \n[⚙️ Environment Variables](#%EF%B8%8F-environment-variables) | \n[🚀 Installation](#-installation) | \n[🧪 Testing](#-testing) | \n[📚 API Documentation](#-api-documentation)\n\n## 📖 Overview\n\nShortify is a powerful URL shortening service built with scalability and analytics in mind. It provides advanced features including topic-based organization, detailed analytics, and Google Sign-In authentication, making it perfect for both personal and enterprise use.\n\n## 🌐 Live Endpoints\n\n- **Authentication Endpoint**: [https://shortify.avm-ayurvedic.online/api/auth/google](https://shortify.avm-ayurvedic.online/api/auth/google)\n- **API Documentation**: [Postman Documentation](https://documenter.getpostman.com/view/32102231/2sAYHzGiKx)\n\n## 🛠 Tech Stack\n\n- **Backend**: Node.js with Express\n- **Database**: MongoDB with Mongoose\n- **Caching**: Redis\n- **Authentication**: Passport.js with Google OAuth 2.0\n- **Testing**: Jest\n- **Analytics**: Custom implementation with geolocation tracking\n\n## ⚙️ Prerequisites\n\nBefore running the application, ensure you have:\n\n- Node.js 22.x or higher\n- Redis Server\n- MongoDB\n- Yarn package manager\n- Google Cloud Console account\n\n## 📊 Features\n\n### 1. User Authentication\n- Google Sign-In integration\n- Secure session management\n- JWT token-based authentication\n- HTTP-only cookie implementation\n\n### 2. URL Shortening\n- Custom alias support\n- Topic-based organization\n- Automatic URL validation\n- Collision detection\n- Rate limiting protection\n\n### 3. Advanced Analytics\n- **Click Tracking**\n  - Total clicks\n  - Unique visitors\n  - Geographic distribution\n  - Time-based analytics\n\n- **Device Analytics**\n  - Operating system tracking\n  - Device type detection\n  - Browser statistics\n  - Screen resolution data\n\n- **Topic-Based Insights**\n  - Category-wise performance\n  - Comparative analytics\n  - Trend analysis\n  - Engagement metrics\n\n### 4. Performance Features\n- Redis caching\n- Load balancing ready\n- Rate limiting\n- Response compression\n\n### 5. Security Measures\n- URL sanitization\n- XSS protection\n- Rate limiting\n- CORS configuration\n- Input validation\n\n## 🔌 API Endpoints\n\n### Authentication\n```javascript\nGET /api/auth/google\nGET /api/auth/callback\n```\n\n### URL Management\n```javascript\nPOST /api/shorten\n{\n  \"longUrl\": \"https://example.com\",\n  \"customAlias\": \"my-link\",\n  \"topic\": \"acquisition\"\n}\n\nGET /api/shorten/:alias\n```\n\n### Analytics\n```javascript\nGET /api/analytics/alias/:alias\nGET /api/analytics/topic/:topic\nGET /api/analytics/overall\n```\n\n## 🔐 Authentication Setup\n\n### Google OAuth Configuration\n\n1. **Create Google Cloud Project**:\n   - Go to [Google Cloud Console](https://console.cloud.google.com/)\n   - Create a new project\n   - Enable Google+ API and OAuth API\n\n2. **Configure OAuth Consent Screen**:\n   - Set application name\n   - Add authorized domains\n   - Configure scopes (email, profile)\n\n3. **Get OAuth Credentials**:\n   - Create OAuth Client ID\n   - Configure redirect URIs\n   - Save Client ID and Secret\n\n## ⚙️ Environment Variables\n\n```env\n# Environment Configuration\nNODE_ENV=development\nMONGO_URI=mongodb://localhost:27017/Shortify\nCLIENT_URL=http://localhost:3000\nPORT=8000\n\n# Redis Configuration\nREDIS_HOST=127.0.0.1\nREDIS_PORT=6379\n\n# Security\nTOKEN_SECRET=your_jwt_secret_key\n\n# External Services\nGEOLOCATION_PROVIDER=http://ip-api.com/json/\n\n# URLs\nSERVER_URL=http://localhost:8000\n\n# Google OAuth\nGOOGLE_CLIENT_ID=your_client_id\nGOOGLE_CLIENT_SECRET=your_client_secret\n```\n\n## 🚀 Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/sinanptm/shortify.git\ncd shortify\n```\n\n2. Install dependencies:\n```bash\nyarn install\n```\n\n3. Set up environment:\n```bash\ncp .env.example .env\n```\n\n4. Start development server:\n```bash\nyarn dev\n```\n\n## 🧪 Testing\n\nRun the test suite:\n```bash\nyarn test\n```\n\n## 📚 API Documentation\n\nFor detailed API documentation and examples, visit our [Postman Documentation](https://documenter.getpostman.com/view/32102231/2sAYHzGiKx).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinanptm%2Fshortify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinanptm%2Fshortify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinanptm%2Fshortify/lists"}