{"id":31390850,"url":"https://github.com/ui-adiii/reel-view-backend","last_synced_at":"2026-05-03T01:41:40.208Z","repository":{"id":316049077,"uuid":"1061743002","full_name":"Ui-Adiii/reel-view-backend","owner":"Ui-Adiii","description":"Reel-Food Backend is a Node.js + Express API powering a short-form food video platform. It handles user and food partner accounts, authentication via JWT cookies, food creation, likes, saves, and media uploads via ImageKit, with MongoDB as the database.","archived":false,"fork":false,"pushed_at":"2025-09-22T10:28:28.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-30T19:35:18.225Z","etag":null,"topics":["bcypt","cookieparser","cors","dotenv","expressjs","imagekit","jwt","mongoose","multer","nodejs","uuid"],"latest_commit_sha":null,"homepage":"https://reel-view-backend.onrender.com","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/Ui-Adiii.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}},"created_at":"2025-09-22T10:20:43.000Z","updated_at":"2025-09-22T10:53:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb00953c-9e3b-4c62-8fa1-c0e88cd7b382","html_url":"https://github.com/Ui-Adiii/reel-view-backend","commit_stats":null,"previous_names":["ui-adiii/reel-view-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ui-Adiii/reel-view-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ui-Adiii%2Freel-view-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ui-Adiii%2Freel-view-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ui-Adiii%2Freel-view-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ui-Adiii%2Freel-view-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ui-Adiii","download_url":"https://codeload.github.com/Ui-Adiii/reel-view-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ui-Adiii%2Freel-view-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280923455,"owners_count":26414237,"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-10-25T02:00:06.499Z","response_time":81,"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":["bcypt","cookieparser","cors","dotenv","expressjs","imagekit","jwt","mongoose","multer","nodejs","uuid"],"created_at":"2025-09-29T01:37:26.729Z","updated_at":"2025-10-25T08:06:04.020Z","avatar_url":"https://github.com/Ui-Adiii.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Reel-Food Backend\n\nNode.js/Express backend for Reel-Food: a short-form food video platform with user accounts, food partner accounts, likes, saves, and media uploads via ImageKit.\n\n### Tech Stack\n- **Runtime**: Node.js (ES Modules)\n- **Framework**: Express\n- **Database**: MongoDB with Mongoose\n- **Auth**: JWT (httpOnly cookie)\n- **Security/Utils**: bcryptjs, cookie-parser, cors, dotenv\n- **Uploads**: multer (memoryStorage) + ImageKit SDK\n\n### Project Structure\n```\nbackend/\n  server.js\n  package.json\n  src/\n    app.js\n    db/db.js\n    controllers/\n      auth.controller.js\n      food.controller.js\n      food-partner.controller.js\n    middlewares/\n      auth.middleware.js\n      multer.middleware.js\n    models/\n      user.model.js\n      food.model.js\n      likes.model.js\n      saved.model.js\n      foodpartner.model.js\n    routes/\n      auth.route.js\n      food.route.js\n      food-partner.route.js\n    services/\n      storage.service.js\n```\n\n### Getting Started\n1) Prerequisites\n- Node.js 18+ and npm\n- MongoDB instance and credentials\n- ImageKit account (for media uploads)\n\n2) Install dependencies\n```bash\nnpm install\n```\n\n3) Environment variables\nCreate a `.env` file in `backend/` with:\n```bash\nPORT=3000\nCLIENT_URL=frontend_url\n\n# MongoDB\nDB_URI=mongodb_url\nDB_NAME=db_name\n\n# Auth\nJWT_SECRET=replace-with-a-strong-secret\n\n# ImageKit\nIMAGEKIT_PUBLIC_KEY=your_public_key\nIMAGEKIT_PRIVATE_KEY=your_private_key\nIMAGEKIT_URL_ENDPOINT=imagekit_url\n```\n\n4) Run the server (with nodemon)\n```bash\nnpm start\n```\nServer starts at `http://localhost:3000`. Health check: `GET /` -\u003e `{ success: true, message: \"API is working\" }`.\n\n### Scripts\n- `npm start`: Run `nodemon server.js`\n\n### API Overview\nBase URL: `http://localhost:3000`\n\n- Root\n  - `GET /` → API health\n\n- Auth (`/api/auth`)\n  - `POST /user/register` → Register user `{ fullName, email, password }`\n  - `POST /user/login` → Login user `{ email, password }` (sets `token` cookie)\n  - `GET /user/logout` → Logout user (clears cookie)\n  - `POST /food-partner/register` → Register partner `{ name, email, password, phone, address, contactName }`\n  - `POST /food-partner/login` → Login partner `{ email, password }` (sets `token` cookie)\n  - `GET /food-partner/logout` → Logout partner\n\n- Food (`/api/food`)\n  - `GET /` → List food items\n  - `POST /add-food` → Create food (partner auth required)\n    - multipart/form-data fields: `video` (file, required), `name` (string), `description` (string)\n  - `POST /like` → Toggle like on a food (user auth required) `{ foodId }`\n  - `POST /save` → Toggle save on a food (user auth required) `{ foodId }`\n  - `GET /save` → Get saved foods for the current user (user auth required)\n\n- Food Partner (`/api/food-partner`)\n  - `GET /:id` → Get food partner profile plus their food items (user auth required)\n\nNotes:\n- Auth middleware reads JWT from `token` httpOnly cookie. Cookies are set with `secure: true` and `sameSite: \"None\"`; use HTTPS or appropriate dev tooling.\n\n### Data Models (Mongoose)\n- `User`: `fullName`, `email` (unique), `password` (select: false)\n- `FoodPartner`: `name`, `contactName`, `phone` (unique), `address`, `email` (unique), `password` (select: false)\n- `Food`: `name`, `video`, `description?`, `foodPartner` (ref), `likeCount`, `saveCount`\n- `Like`: `user` (ref), `food` (ref)\n- `Save`: `user` (ref), `food` (ref)\n\n### Configuration Details\n- CORS: `origin` is set from `CLIENT_URL`; `credentials: true` is enabled.\n- Uploads: `multer.memoryStorage()` buffers the file and `ImageKit.upload()` stores it; store your keys in `.env`.\n- DB: `mongoose.connect(DB_URI, { dbName: DB_NAME })`.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fui-adiii%2Freel-view-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fui-adiii%2Freel-view-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fui-adiii%2Freel-view-backend/lists"}