{"id":15110057,"url":"https://github.com/akunna1/api-mongodb-node-express-","last_synced_at":"2026-02-09T22:33:09.669Z","repository":{"id":256237012,"uuid":"854687374","full_name":"akunna1/API-MongoDB-Node-Express-","owner":"akunna1","description":"Creating an API using MongoDB, Express.js, and Node.js to create a social media post with CRUD operations. The post includes a message and an image upload","archived":false,"fork":false,"pushed_at":"2024-09-09T16:03:00.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T16:33:38.002Z","etag":null,"topics":["crud-api","database","express-js","mongodb","mongoose","multer","node-js"],"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/akunna1.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}},"created_at":"2024-09-09T15:54:46.000Z","updated_at":"2024-09-09T16:03:03.000Z","dependencies_parsed_at":"2024-09-09T19:42:48.208Z","dependency_job_id":null,"html_url":"https://github.com/akunna1/API-MongoDB-Node-Express-","commit_stats":null,"previous_names":["akunna1/api-mongodb-node-express-"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akunna1/API-MongoDB-Node-Express-","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akunna1%2FAPI-MongoDB-Node-Express-","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akunna1%2FAPI-MongoDB-Node-Express-/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akunna1%2FAPI-MongoDB-Node-Express-/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akunna1%2FAPI-MongoDB-Node-Express-/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akunna1","download_url":"https://codeload.github.com/akunna1/API-MongoDB-Node-Express-/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akunna1%2FAPI-MongoDB-Node-Express-/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271722265,"owners_count":24809664,"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-08-22T02:00:08.480Z","response_time":65,"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":["crud-api","database","express-js","mongodb","mongoose","multer","node-js"],"created_at":"2024-09-25T23:40:30.778Z","updated_at":"2026-02-09T22:33:09.629Z","avatar_url":"https://github.com/akunna1.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API-MongoDB-Node-Express\n\nThis project is a simple social media post API built using MongoDB, Express.js, and Node.js. It supports CRUD operations including image upload for posts.\n\n---\n\n## Features\n\n* Create social media posts with a message and image\n* Read all posts or a single post by ID\n* Update posts with new messages and images\n* Delete posts\n* Uses MongoDB database: `social_media_db`\n* Posts stored in the `posts` collection\n\n---\n\n## Technologies Used\n\n* Node.js\n* Express.js\n* MongoDB\n* Mongoose (for schema and database modeling)\n* Multer (for image upload handling)\n* Body-parser (to parse incoming request bodies)\n\n---\n\n## Installation\n\n1. Initialize npm and install dependencies:\n\n```bash\nnpm init -y\nnpm install express mongoose multer body-parser\n```\n\n2. Run your MongoDB server locally or use a MongoDB cloud instance.\n\n3. Start the server:\n\n```bash\nnode index.js\n```\n\n*(Assuming your main file is named `index.js`)*\n\n---\n\n## MongoDB Schema (using Mongoose)\n\n* The post schema is defined in code, no need to create schema manually in MongoDB shell.\n* Contains fields for message (text) and image (file info).\n\n---\n\n## API Endpoints\n\n| Method | Endpoint     | Description                  |\n| ------ | ------------ | ---------------------------- |\n| POST   | `/posts`     | Create a new post with image |\n| GET    | `/posts`     | Retrieve all posts           |\n| GET    | `/posts/:id` | Retrieve a single post by ID |\n| PUT    | `/posts/:id` | Update a post and its image  |\n| DELETE | `/posts/:id` | Delete a post by ID          |\n\n---\n\n## Notes\n\n* Image uploads handled using Multer middleware.\n* Requests with images must be sent as multipart/form-data.\n* Message is a text string associated with each post.\n\n---\n\nThis API serves as a foundation for building social media applications with image support and basic CRUD functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakunna1%2Fapi-mongodb-node-express-","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakunna1%2Fapi-mongodb-node-express-","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakunna1%2Fapi-mongodb-node-express-/lists"}