{"id":30685888,"url":"https://github.com/mohit138928/url_shortener_app","last_synced_at":"2026-05-08T14:09:19.324Z","repository":{"id":309017298,"uuid":"1034872478","full_name":"Mohit138928/URL_Shortener_app","owner":"Mohit138928","description":"A full-stack MERN application for shortening URLs with an admin dashboard.","archived":false,"fork":false,"pushed_at":"2025-08-09T08:26:46.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-09T10:07:27.637Z","etag":null,"topics":["react","react-project","react-projects","react-projects-for-beginners","reactjs","url-shortener","vite","vitejs-react"],"latest_commit_sha":null,"homepage":"https://url-shortener-app-nsaf.vercel.app/","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/Mohit138928.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-08-09T06:40:29.000Z","updated_at":"2025-08-09T08:58:42.000Z","dependencies_parsed_at":"2025-08-09T10:20:41.805Z","dependency_job_id":null,"html_url":"https://github.com/Mohit138928/URL_Shortener_app","commit_stats":null,"previous_names":["mohit138928/url_shortener_app"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Mohit138928/URL_Shortener_app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohit138928%2FURL_Shortener_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohit138928%2FURL_Shortener_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohit138928%2FURL_Shortener_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohit138928%2FURL_Shortener_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mohit138928","download_url":"https://codeload.github.com/Mohit138928/URL_Shortener_app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohit138928%2FURL_Shortener_app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273197534,"owners_count":25062307,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["react","react-project","react-projects","react-projects-for-beginners","reactjs","url-shortener","vite","vitejs-react"],"created_at":"2025-09-01T22:09:45.381Z","updated_at":"2026-05-08T14:09:14.298Z","avatar_url":"https://github.com/Mohit138928.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL Shortener App\n\nA full-stack MERN application for shortening URLs with an admin dashboard.\n\n## Features\n\n- **URL Shortening**: Convert long URLs into short, manageable links\n- **Redirect Service**: Automatically redirect short URLs to original destinations\n- **Admin Dashboard**: View all shortened URLs, visit counts, and statistics\n- **Visit Tracking**: Track how many times each short URL has been visited\n- **Responsive Design**: Works on desktop and mobile devices\n\n## Tech Stack\n\n- **Frontend**: React + Vite, Tailwind CSS, React Router, Axios\n- **Backend**: Node.js, Express.js, MongoDB, Mongoose\n- **URL Generation**: nanoid for unique short codes\n\n## Prerequisites\n\n- Node.js (v16 or higher)\n- MongoDB (local installation or MongoDB Atlas)\n- npm or yarn\n\n## Installation \u0026 Setup\n\n### 1. Clone and Install Dependencies\n\n```bash\n# Install frontend dependencies\nnpm install\n\n# Install backend dependencies\ncd backend\nnpm install\ncd ..\n```\n\n### 2. Database Setup\n\n#### Option A: Local MongoDB\n- Install MongoDB on your system\n- Start MongoDB service\n- Database will be created automatically at `mongodb://localhost:27017/urlshortener`\n\n#### Option B: MongoDB Atlas (Cloud)\n- Create a free MongoDB Atlas account\n- Create a new cluster\n- Get your connection string\n- Update `backend/.env` with your MongoDB URI\n\n### 3. Environment Configuration\n\nThe backend `.env` file is already configured for local development:\n```\nMONGODB_URI=mongodb://localhost:27017/urlshortener\nPORT=5000\n```\n\nFor production or MongoDB Atlas, update the `MONGODB_URI` in `backend/.env`.\n\n### 4. Running the Application\n\n#### Start Backend Server\n```bash\ncd backend\nnpm run dev\n```\nBackend will run on `http://localhost:5000`\n\n#### Start Frontend Development Server\n```bash\n# In a new terminal, from the root directory\nnpm run dev\n```\nFrontend will run on `http://localhost:5173`\n\n## API Endpoints\n\n### Backend Routes\n\n- `POST /api/shorten` - Create a shortened URL\n- `GET /api/urls` - Get all URLs (for admin page)\n- `GET /:shortcode` - Redirect to original URL\n- `GET /health` - Health check\n\n### Example API Usage\n\n```javascript\n// Shorten a URL\nconst response = await axios.post('http://localhost:5000/api/shorten', {\n  original_url: 'https://example.com/very/long/url'\n});\n\n// Response\n{\n  \"original_url\": \"https://example.com/very/long/url\",\n  \"short_code\": \"abc123\",\n  \"short_url\": \"http://localhost:5000/abc123\",\n  \"created_at\": \"2024-01-01T00:00:00.000Z\"\n}\n```\n\n## Usage\n\n### Shortening URLs\n\n1. Go to `http://localhost:5173`\n2. Enter a long URL in the input field\n3. Click \"Shorten URL\"\n4. Copy the generated short URL\n5. Use the short URL to redirect to the original\n\n### Admin Dashboard\n\n1. Navigate to `http://localhost:5173/admin`\n2. View statistics: total URLs, total visits, average visits per URL\n3. See all shortened URLs in a table format\n4. Test short URLs directly from the admin panel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohit138928%2Furl_shortener_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohit138928%2Furl_shortener_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohit138928%2Furl_shortener_app/lists"}