{"id":31033200,"url":"https://github.com/ismail-dev-code/meal-giver-server","last_synced_at":"2026-04-13T08:31:32.736Z","repository":{"id":310325356,"uuid":"1020853565","full_name":"ismail-dev-code/meal-giver-server","owner":"ismail-dev-code","description":"The MealGiver Server is the core API service for the MealGiver platform — a MERN stack-based food donation and redistribution system connecting restaurants with verified charities and individuals to reduce food waste.","archived":false,"fork":false,"pushed_at":"2025-08-17T09:42:10.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-14T01:39:17.930Z","etag":null,"topics":["decoded","dotenv","express-js","firebse","middleware","mongodb-atlas","stripe-payments"],"latest_commit_sha":null,"homepage":"https://meal-giver.web.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/ismail-dev-code.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-07-16T13:48:35.000Z","updated_at":"2025-08-17T09:42:13.000Z","dependencies_parsed_at":"2025-08-17T11:33:34.873Z","dependency_job_id":"62dc22fa-abef-4be8-a9d6-f071f0eb7d2f","html_url":"https://github.com/ismail-dev-code/meal-giver-server","commit_stats":null,"previous_names":["ismail-dev-code/meal-giver-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ismail-dev-code/meal-giver-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismail-dev-code%2Fmeal-giver-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismail-dev-code%2Fmeal-giver-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismail-dev-code%2Fmeal-giver-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismail-dev-code%2Fmeal-giver-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ismail-dev-code","download_url":"https://codeload.github.com/ismail-dev-code/meal-giver-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismail-dev-code%2Fmeal-giver-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31746101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T06:26:45.479Z","status":"ssl_error","status_checked_at":"2026-04-13T06:26:44.645Z","response_time":93,"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":["decoded","dotenv","express-js","firebse","middleware","mongodb-atlas","stripe-payments"],"created_at":"2025-09-14T01:39:15.880Z","updated_at":"2026-04-13T08:31:32.718Z","avatar_url":"https://github.com/ismail-dev-code.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🍽️ MealGiver Server API\n\nThe **MealGiver Server** is the core API service for the MealGiver platform — a MERN stack-based food donation and redistribution system connecting restaurants with verified charities and individuals to reduce food waste.\n\n\n\n## 🔗 Live\n\n\u003e ⚙️ Site: `https://meal-giver-web.app`\n\n\n\n\n\n## ⚙️ Technologies Used\n\n- **Node.js**\n- **Express.js**\n- **MongoDB**\n- **Firebase Admin SDK (Authentication \u0026 Role Management)**\n- **Stripe API (Payments)**\n- **Dotenv**\n- **CORS**\n- **Firebase Token Verification**\n\n\n\n\n\n\n## 🔐 Authentication \u0026 Middleware\n\n- **Firebase Authentication** (`verifyFBToken`)\n- **Role-based Authorization** (`verifyAdmin`, `verifyRestaurant`, `verifyCharity`)\n\n\n\n\n\n## 🛠️ Base URL\n\n\u003e `https://mealgiver-server.vercel.app`\n\n\n\n## ✅ Auth \u0026 User Endpoints\n\n| Method   | Endpoint             | Access        | Description                |\n| -------- | -------------------- | ------------- | -------------------------- |\n| `GET`    | `/users`             | Admin         | Get all users              |\n| `POST`   | `/users`             | Public        | Register a new user        |\n| `PATCH`  | `/users/role/:email` | Admin         | Update a user’s role       |\n| `DELETE` | `/users/:id`         | Admin         | Delete a user              |\n| `GET`    | `/users/role/:email` | Authenticated | Get current user's role    |\n\n\n\n## 🍽️ Donations Endpoints\n\n| Method   | Endpoint                 | Access     | Description                        |\n| -------- | ------------------------ | ---------- | ---------------------------------- |\n| `POST`   | `/donations`             | Restaurant | Create a new donation              |\n| `GET`    | `/donations/restaurant`  | Restaurant | Get all donations by restaurant    |\n| `PATCH`  | `/donations/:id`         | Restaurant | Update a donation                  |\n| `DELETE` | `/donations/:id`         | Restaurant | Delete a donation                  |\n| `GET`    | `/donations/featured`    | Public     | Get featured donations             |\n| `GET`    | `/donations/verified`    | Public     | Get all verified donations         |\n| `GET`    | `/donations/:id`         | Public     | Get donation details               |\n| `PATCH`  | `/donations/approve/:id` | Admin      | Approve a donation submission      |\n\n\n\n## 📦 Donation Request Endpoints\n\n| Method  | Endpoint                          | Access     | Description                                  |\n| ------- | --------------------------------- | ---------- | -------------------------------------------- |\n| `POST`  | `/requests`                       | Charity    | Submit request for a donation                |\n| `GET`   | `/requests/charity`               | Charity    | Get all requests by the logged-in charity    |\n| `GET`   | `/requests/restaurant`            | Restaurant | Get all requests for restaurant’s donations  |\n| `PATCH` | `/requests/:id/approve`           | Restaurant | Approve a charity’s request                  |\n| `PATCH` | `/requests/:id/reject`            | Restaurant | Reject a charity’s request                   |\n| `GET`   | `/charity/received-donations`     | Charity    | Get all received/picked-up donations         |\n| `GET`   | `/charity/latest-requests/recent` | Public     | Get recent charity requests (for homepage)   |\n\n\n\n## 🚚 Pickup Confirmation Endpoints\n\n| Method  | Endpoint                      | Access  | Description              |\n| ------- | ----------------------------- | ------- | ------------------------ |\n| `GET`   | `/charity/my-pickups`         | Charity | Get all assigned pickups |\n| `PATCH` | `/charity/pickup-confirm/:id` | Charity | Confirm a pickup         |\n\n\n\n## 💳 Charity Role Requests (Stripe)\n\n| Method  | Endpoint                   | Access | Description                      |\n| ------- | -------------------------- | ------ | -------------------------------- |\n| `POST`  | `/charity-role-request`    | Auth   | Submit role request with payment |\n| `GET`   | `/admin/role-requests`     | Admin  | View all role requests           |\n| `PATCH` | `/admin/role-requests/:id` | Admin  | Approve or reject role request   |\n| `POST`  | `/create-payment-intent`   | Auth   | Generate Stripe payment intent   |\n\n\n\n## 🌟 Review Endpoints\n\n| Method | Endpoint                  | Access  | Description                         |\n| ------ | ------------------------- | ------- | ----------------------------------- |\n| `POST` | `/reviews`                | Charity | Submit a review for a donation      |\n| `GET`  | `/reviews?donationId=xxx` | Public  | Get reviews for a specific donation |\n| `GET`  | `/reviews/mine`           | Charity | Get logged-in user's reviews        |\n| `GET`  | `/reviews/community`      | Public  | Get latest community stories        |\n\n\n\n## 📊 Dashboard Stats\n\n| Method | Endpoint            | Access     | Description                             |\n| ------ | ------------------- | ---------- | --------------------------------------- |\n| `GET`  | `/admin/stats`      | Admin      | Get total stats (users, donations, etc) |\n| `GET`  | `/restaurant/stats` | Restaurant | Restaurant-specific stats               |\n| `GET`  | `/charity/stats`    | Charity    | Charity-specific stats                  |\n\n\n\n## 🧪 Testing the API\n\nYou can test the endpoints using:\n\n- 🧪 Postman  \n- ⚛️ Frontend app integration\n\nAll secured routes require this header:  \n`Authorization: Bearer \u003cfirebase_id_token\u003e`\n\n\n\n## 🙋 Contributing\n\nFeel free to fork the project, open issues, or submit PRs. Contributions, suggestions, and feedback are always welcome!\n\n\n\n## 🧑‍💻 Developer\n\n**Ismail Hossain**  \n📧 hm.ismail772@gmail.com  \n🌍 Noakhali, Bangladesh  \n🔗 [GitHub](https://github.com/ismail-dev-code) | [LinkedIn](https://www.linkedin.com/in/ismail-hossain24)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismail-dev-code%2Fmeal-giver-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fismail-dev-code%2Fmeal-giver-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismail-dev-code%2Fmeal-giver-server/lists"}