{"id":31023289,"url":"https://github.com/lovnishverma/mern-task-manager","last_synced_at":"2026-06-19T01:31:16.271Z","repository":{"id":313741415,"uuid":"1052481416","full_name":"lovnishverma/mern-task-manager","owner":"lovnishverma","description":"A simple MERN stack task manager with CRUD operations using React, Node.js, Express, and MongoDB.","archived":false,"fork":false,"pushed_at":"2025-09-08T05:58:36.000Z","size":3051,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T15:39:52.069Z","etag":null,"topics":["mern-stack","mongodb-atlas","tailwindcss","task-management-system"],"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/lovnishverma.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"lovnishverma","custom":["https://buymeacoffee.com/lovnishverma","https://www.paypal.com/paypalme/princelv"]}},"created_at":"2025-09-08T05:48:41.000Z","updated_at":"2025-09-14T07:25:05.000Z","dependencies_parsed_at":"2025-09-08T07:34:21.604Z","dependency_job_id":null,"html_url":"https://github.com/lovnishverma/mern-task-manager","commit_stats":null,"previous_names":["lovnishverma/mern-task-manager"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lovnishverma/mern-task-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovnishverma%2Fmern-task-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovnishverma%2Fmern-task-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovnishverma%2Fmern-task-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovnishverma%2Fmern-task-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovnishverma","download_url":"https://codeload.github.com/lovnishverma/mern-task-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovnishverma%2Fmern-task-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34514282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"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":["mern-stack","mongodb-atlas","tailwindcss","task-management-system"],"created_at":"2025-09-13T13:54:11.476Z","updated_at":"2026-06-19T01:31:16.250Z","avatar_url":"https://github.com/lovnishverma.png","language":"JavaScript","funding_links":["https://github.com/sponsors/lovnishverma","https://buymeacoffee.com/lovnishverma","https://www.paypal.com/paypalme/princelv"],"categories":[],"sub_categories":[],"readme":"# MERN Task Manager\n\nA simple to-do application built using the **MERN stack**—MongoDB, Express.js, React, and Node.js. Learn full-stack development with basic functionality to **Add**, **View**, **Update**, and **Delete** tasks.\n\n## 🔗 Live Demo\n\n* **Frontend (UI):** [https://mern-task-frontend-gwue.onrender.com/](https://mern-task-frontend-gwue.onrender.com/)\n* **Backend (API):** [https://mern-task-manager-b89p.onrender.com/](https://mern-task-manager-b89p.onrender.com/)\n\n---\n\n## 📂 What’s Inside?\n\n-   **Backend** (`backend/`): REST API using Node.js, Express.js, and MongoDB to manage tasks.\n-   **Frontend** (`frontend/`): React app (via Vite) that lets you interact with tasks in a modern UI.\n-   **Tailwind CSS** already integrated for quick and clean styling.\n\n---\n\n## 🚀 Setup Guide (Local Development)\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/lovnishverma/mern-task-manager.git\ncd mern-task-manager\n\n```\n\n### 2. Setup the Backend (API server)\n\n```bash\ncd backend\nnpm install\n\n```\n\n1. Create a `.env` file in the `backend/` folder and add your MongoDB connection string:\n```env\nMONGO_URI=your_mongodb_connection_string\n\n```\n\n\n2. Start the backend server:\n```bash\nnode server.js\n\n```\n\n\n*It should run on `http://localhost:5000`.*\n\n### 3. Setup the Frontend (User interface)\n\nOpen a new terminal window:\n\n```bash\ncd ../frontend\nnpm install\nnpm run dev -- --host\n\n```\n\n* This starts the app at `http://localhost:5173`.\n* Use `--host` so it works even on other devices on the same network.\n\n### 4. Use the App\n\n* Open the app in your browser.\n* Add tasks in the input field.\n* Click on a task to mark it complete (strikethrough).\n* Use the delete option to remove a task.\n\n---\n\n## ☁️ Deployment Guide (Render)\n\nDeploy your app for free using Render. You will create two separate services: one for the backend and one for the frontend.\n\n### Step 1: Deploy the Backend (Web Service)\n\n1. Log in to [Render](https://render.com/).\n2. Click **New +** and select **Web Service**.\n3. Connect your GitHub repository.\n4. Configure the service:\n* **Name:** `mern-task-backend`\n* **Root Directory:** `backend`\n* **Environment:** Node\n* **Build Command:** `npm install`\n* **Start Command:** `node server.js`\n\n\n5. Scroll down to **Environment Variables** and add:\n* `MONGO_URI`: Your MongoDB connection string.\n* `PORT`: `10000` (Render's default port).\n\n\n6. Click **Create Web Service**.\n7. **Copy the URL** provided by Render (e.g., `https://your-backend.onrender.com`). You will need this for the frontend.\n\n### Step 2: Deploy the Frontend (Static Site)\n\n1. Go back to the Render Dashboard.\n2. Click **New +** and select **Static Site**.\n3. Connect the same GitHub repository.\n4. Configure the service:\n* **Name:** `mern-task-frontend`\n* **Root Directory:** `frontend`\n* **Build Command:** `npm install \u0026\u0026 npm run build`\n* **Publish Directory:** `dist`\n\n\n5. **Environment Variables:**\n* Add a variable named `VITE_API_URL`.\n* Set the value to your **Backend URL** from Step 1 (e.g., `https://your-backend.onrender.com/api`).\n\n\n6. **Rewrite Rules:**\n* To ensure React Router works correctly, go to the **Redirects/Rewrites** tab.\n* Add a new rule:\n* **Source:** `/*`\n* **Destination:** `/index.html`\n* **Action:** Rewrite\n\n\n\n\n7. Click **Create Static Site**.\n\n---\n\n## 🌐 Alternative: Deploy Frontend to GitHub Pages\n\nIf you prefer to host the frontend on GitHub Pages instead of Render, follow these steps.\n\n### 1. Install `gh-pages`\n\nIn your `frontend/` directory:\n\n```bash\nnpm install gh-pages --save-dev\n\n```\n\n### 2. Update `vite.config.js`\n\nAdd the `base` path property:\n\n```javascript\nimport { defineConfig } from 'vite'\nimport react from '@vitejs/plugin-react'\n\n// [https://vitejs.dev/config/](https://vitejs.dev/config/)\nexport default defineConfig({\n  plugins: [react()],\n  base: \"/mern-task-manager/\", // REPLACE \"mern-task-manager\" with your repo name\n})\n\n```\n\n### 3. Update `package.json`\n\nIn `frontend/package.json`, add the `homepage` and scripts:\n\n```json\n{\n  \"name\": \"frontend\",\n  \"homepage\": \"https://\u003cyour-github-username\u003e.github.io/mern-task-manager\", \n  \"scripts\": {\n    \"dev\": \"vite\",\n    \"build\": \"vite build\",\n    \"predeploy\": \"npm run build\",\n    \"deploy\": \"gh-pages -d dist\" \n  }\n}\n\n```\n\n### 4. Deploy\n\n```bash\nnpm run deploy\n\n```\n\n### ⚠️ Crucial: Backend Connection for GitHub Pages\n\nSince your frontend is on GitHub Pages but backend is on Render:\n\n1. **Frontend API URL:** Ensure your `api.js` points to the Render Backend URL.\n2. **Backend CORS:** Update `backend/server.js` to allow the GitHub Pages URL:\n```javascript\napp.use(cors({\n  origin: [\"[https://lovnishverma.github.io](https://lovnishverma.github.io)\", \"http://localhost:5173\"] \n}));\n\n```\n\n\n\n---\n\n## 💡 Why It’s Helpful for Beginners\n\n* Clear separation of **frontend** and **backend** code.\n* Learn how React interacts with a **REST API**.\n* Explore essential web development skills: routing, CRUD, state management, styling.\n* Lightweight and easy to run—no heavy setup required.\n\n---\n\n## 🛠 Tips if It Doesn’t Work\n\n* **Backend First:** Make sure the backend is running before using the frontend.\n* **Connection Issues:** If tasks don’t load:\n* **Locally:** Ensure the `api.js` in `frontend/src` points to `http://localhost:5000` (or your LAN IP).\n* **On Render:** Ensure you added the `VITE_API_URL` environment variable correctly.\n\n\n* **Windows Users:** If you see line-ending warnings from Git (`LF will be replaced by CRLF`), that’s normal and safe to ignore.\n\n---\n\n## Happy Coding!\n\nBuild, break, fix, and learn—this app is your sandbox to explore full-stack development with MERN. Feel free to tweak it, experiment, and make it your own!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovnishverma%2Fmern-task-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovnishverma%2Fmern-task-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovnishverma%2Fmern-task-manager/lists"}