{"id":25407886,"url":"https://github.com/likhithkp/advanced-url-shortener","last_synced_at":"2026-04-10T11:02:31.825Z","repository":{"id":276968908,"uuid":"930835322","full_name":"likhithkp/advanced-url-shortener","owner":"likhithkp","description":"A simple yet efficient URL shortener built with Node.js, Express, PostgreSQL, and Redis for caching. Generates unique short URLs and supports retrieval with optimized performance.","archived":false,"fork":false,"pushed_at":"2025-02-12T07:09:58.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T14:00:42.979Z","etag":null,"topics":["express","express-js","expressjs","nodejs","postgres","postgresql","postgresql-database","rdbms","redis","redis-cache","redis-client","sequelize","supabase","supabase-db","url-shortener"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/likhithkp.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,"zenodo":null}},"created_at":"2025-02-11T09:41:47.000Z","updated_at":"2025-02-12T07:13:43.000Z","dependencies_parsed_at":"2025-04-14T13:47:17.528Z","dependency_job_id":null,"html_url":"https://github.com/likhithkp/advanced-url-shortener","commit_stats":null,"previous_names":["likhithkp/advanced-url-shortener"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/likhithkp/advanced-url-shortener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likhithkp%2Fadvanced-url-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likhithkp%2Fadvanced-url-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likhithkp%2Fadvanced-url-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likhithkp%2Fadvanced-url-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/likhithkp","download_url":"https://codeload.github.com/likhithkp/advanced-url-shortener/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likhithkp%2Fadvanced-url-shortener/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31639524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: 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":["express","express-js","expressjs","nodejs","postgres","postgresql","postgresql-database","rdbms","redis","redis-cache","redis-client","sequelize","supabase","supabase-db","url-shortener"],"created_at":"2025-02-16T07:19:09.246Z","updated_at":"2026-04-10T11:02:31.820Z","avatar_url":"https://github.com/likhithkp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advanced URL Shortener\n\nThis is a URL Shortener service built with Node.js, Express, PostgreSQL, and Redis for caching. It generates short URLs for long ones and retrieves the original URL when requested.\n\n## Features\n- Generate a short URL for a given long URL\n- Retrieve the original URL using the short URL\n- Store previously requested URLs in Redis for faster access\n- Prevent duplicate short URLs for the same long URL\n- API response handling with proper status codes\n\n## Tech Stack\n- **Backend**: Node.js, Express.js\n- **Database**: PostgreSQL with Sequelize ORM\n- **Cache**: Redis\n- **Security**: Helmet, CORS\n\n## Installation\n\n1. Clone the repository:\n   ```sh\n   git clone https://github.com/your-username/url-shortener.git\n   cd url-shortener\n   ```\n\n2. Install dependencies:\n   ```sh\n   npm install\n   ```\n\n3. Set up the `.env` file with the following variables:\n   ```env\n   DATABASE_URL=your_postgres_connection_string\n   REDIS_HOST=localhost\n   REDIS_PORT=6379\n   BASE_URL=http://localhost:3001\n   ```\n\n4. Run database migrations:\n   ```sh\n   npx sequelize-cli db:migrate\n   ```\n\n5. Start the Redis server (if not already running):\n   ```sh\n   redis-server\n   ```\n\n6. Start the application:\n   ```sh\n   npm start\n   ```\n\n## API Endpoints\n\n### Shorten URL\n- **Endpoint**: `POST /shorten`\n- **Request Body**:\n  ```json\n  {\n    \"url\": \"https://www.example.com/long-url-to-shorten\"\n  }\n  ```\n- **Response**:\n  ```json\n  {\n    \"status\": 201,\n    \"data\": {\n      \"shortUrl\": \"http://localhost:3000/abc123\"\n    },\n    \"message\": \"URL shortened successfully.\",\n    \"error\": null\n  }\n  ```\n\n### Retrieve Original URL\n- **Endpoint**: `GET /:shortCode`\n- **Response**:\n  ```json\n  {\n    \"status\": 200,\n    \"data\": {\n      \"originalUrl\": \"https://www.example.com/long-url-to-shorten\"\n    },\n    \"message\": \"URL retrieved successfully.\",\n    \"error\": null\n  }\n  ```\n\n## Future Improvements\n- Implement user authentication for URL management\n- Add analytics tracking for shortened URLs\n- Implement a frontend UI\n\n## License\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikhithkp%2Fadvanced-url-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flikhithkp%2Fadvanced-url-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikhithkp%2Fadvanced-url-shortener/lists"}