{"id":28105381,"url":"https://github.com/05sanjaykumar/url-shortern","last_synced_at":"2026-04-15T05:31:57.786Z","repository":{"id":293129521,"uuid":"978246974","full_name":"05sanjaykumar/URL-shortern","owner":"05sanjaykumar","description":"A scalable, Dockerized URL Shortener built with Node.js and Redis — designed to explore backend architecture, caching, and deployment concepts.","archived":false,"fork":false,"pushed_at":"2025-05-13T19:55:52.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T20:55:06.004Z","etag":null,"topics":["devops","docker","express","express-js","nginx","node","redis","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/05sanjaykumar.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-05-05T17:35:32.000Z","updated_at":"2025-05-13T19:55:56.000Z","dependencies_parsed_at":"2025-05-13T21:06:06.467Z","dependency_job_id":null,"html_url":"https://github.com/05sanjaykumar/URL-shortern","commit_stats":null,"previous_names":["05sanjaykumar/url-shortern"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05sanjaykumar%2FURL-shortern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05sanjaykumar%2FURL-shortern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05sanjaykumar%2FURL-shortern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05sanjaykumar%2FURL-shortern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/05sanjaykumar","download_url":"https://codeload.github.com/05sanjaykumar/URL-shortern/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036843,"owners_count":22003654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["devops","docker","express","express-js","nginx","node","redis","url-shortener"],"created_at":"2025-05-13T22:17:53.240Z","updated_at":"2026-04-15T05:31:57.758Z","avatar_url":"https://github.com/05sanjaykumar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔗 URL Shortener\n\nA full-stack, production-grade URL shortening service built with **Node.js**, **Express**, **Redis**, and **Docker** — complete with rate limiting, RESTful API, unit tests, and deployment on Render.\n\n---\n\n## 🌍 Live Demo\n\n\u003e 🟢 Deployed on [Render](https://url-shortern-9qxj.onrender.com/)  \n\u003e Frontend: Static `HTML + JS`  \n\u003e Backend: Node.js + Redis  \n\u003e Dockerized with `Dockerfile` and `nginx` (for local use)\n\n---\n\n## 🧰 Tech Stack\n\n- **Frontend**: HTML, JavaScript (Vanilla)\n- **Backend**: Node.js + Express\n- **Database**: Redis (for storing shortened URLs)\n- **Testing**: Jest\n- **Rate Limiting**: Custom Express middleware\n- **DevOps**:\n  - Docker \u0026 docker-compose (for local setup)\n  - Render (for cloud deployment)\n  - NGINX (proxy for containerized routing)\n\n---\n\n## 📁 Project Structure\n\n```\n\n├── public/             # Static frontend\n├── src/\n│   ├── controllers/    # Shorten \u0026 redirect logic\n│   ├── routes/         # API endpoints\n│   ├── services/       # Redis + URL generation\n│   └── middleware/     # Rate limiter\n├── test/               # Unit tests (with mocks)\n├── Dockerfile          # Container setup\n├── docker-compose.yml  # Dev orchestration\n├── server.js           # Entry point\n├── README.md           # Project info\n\n````\n\n---\n\n## ✅ Features\n\n- 🔗 Shortens long URLs to 6-character codes\n- 🚀 Redirects to original URL from code\n- 🧠 Stores data in **Redis**\n- 🛡️ Built-in **rate limiter** middleware (basic DDoS protection)\n- 🧪 Unit tested with mocks for Redis\n- 🐳 Local Docker support\n- 🌐 Deployed on **Render**\n\n---\n\n## 🚀 Running Locally\n\n### Option 1: Docker (Recommended for full stack)\n\n```bash\ndocker-compose up\n````\n\n### Option 2: Manual\n\n```bash\nnpm install\nredis-server\nnpm start\n```\n\nThen visit: [http://localhost:3000](http://localhost:3000)\n\n---\n\n## 🧪 Run Tests\n\n```bash\nnpm test\n```\n\nIncludes mocks for Redis to ensure unit isolation.\n\n---\n\n## 🌐 Deployment (Render)\n\nThe backend and frontend are deployed using **Render.com**:\n\n* **Backend**: Connected to Redis instance\n* **Frontend**: Served via static files or nginx\n* **Base URL** is set dynamically in production\n\n---\n\n## 📌 Learnings\n\n* 📦 **Modular Express structure** with `controllers`, `routes`, and `services`\n* 🧪 Wrote **unit tests** with Redis mocks\n* 🐳 Learned how to containerize full-stack apps with Docker\n* 🚀 Deployed using **Render** and explored cloud hosting\n* 🛡️ Implemented basic **rate limiting**\n* 🌱 Explored logging, monitoring, and optional CI/CD pipelines\n\n---\n\n## 🙌 Author\n\n**Sanjay Kumar** — *Lifelong learner, Polyglot dev, and builder of things.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F05sanjaykumar%2Furl-shortern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F05sanjaykumar%2Furl-shortern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F05sanjaykumar%2Furl-shortern/lists"}