{"id":22771407,"url":"https://github.com/ramxcodes/advice-me-ram-backend","last_synced_at":"2026-05-07T18:47:33.971Z","repository":{"id":260619451,"uuid":"881854761","full_name":"ramxcodes/Advice-me-ram-backend","owner":"ramxcodes","description":"The backend of Advice Me Ram is a RESTful API built with Node.js, Express, and MongoDB. This API enables users to contribute advice and retrieve random pieces of advice from a database. The backend is designed to handle requests efficiently and provides endpoints for creating and fetching advice.","archived":false,"fork":false,"pushed_at":"2024-11-03T11:29:59.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T12:14:13.159Z","etag":null,"topics":["backend","backend-api","cronjob","full-stack","mern","mongodb","vercel"],"latest_commit_sha":null,"homepage":"https://advice-me-ram.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/ramxcodes.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-11-01T11:38:41.000Z","updated_at":"2024-11-04T11:15:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"30d5629b-6a83-4f01-90c1-43f97b168d01","html_url":"https://github.com/ramxcodes/Advice-me-ram-backend","commit_stats":null,"previous_names":["ramxcodes/advice-me-ram-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ramxcodes/Advice-me-ram-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramxcodes%2FAdvice-me-ram-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramxcodes%2FAdvice-me-ram-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramxcodes%2FAdvice-me-ram-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramxcodes%2FAdvice-me-ram-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramxcodes","download_url":"https://codeload.github.com/ramxcodes/Advice-me-ram-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramxcodes%2FAdvice-me-ram-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32751757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["backend","backend-api","cronjob","full-stack","mern","mongodb","vercel"],"created_at":"2024-12-11T16:13:34.391Z","updated_at":"2026-05-07T18:47:33.932Z","avatar_url":"https://github.com/ramxcodes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advice Me Ram Backend 📝💡\n\nThe backend of **Advice Me Ram** is a RESTful API built with Node.js, Express, and MongoDB. This API enables users to contribute advice and retrieve random pieces of advice from a database. The backend is designed to handle requests efficiently and provides endpoints for creating and fetching advice.\n\n🚀 **Live Site**: [https://advice-me-ram.vercel.app/](https://advice-me-ram.vercel.app/)\n\n## Features ✨\n\n- **Post Advice**: Submit advice with an author’s name to store in the database.\n- **Get Random Advice**: Fetch a random piece of advice from the database.\n- **Error Handling**: Robust error handling for database and server errors.\n- **Modular Structure**: Organized codebase with separate routes, controllers, and models for scalability.\n\n## Technologies 🛠️\n\n- **Node.js**: JavaScript runtime for server-side code.\n- **Express**: Fast and minimalist web framework for Node.js.\n- **MongoDB**: NoSQL database for storing advice data.\n- **Mongoose**: ODM for MongoDB to define models and schemas.\n\n## API Endpoints 📬\n\n### 1. **Post Advice**\n\n- **URL**: `/sendadvice`\n- **Method**: `POST`\n- **Description**: Accepts an advice text and author name, then saves it to the database.\n- **Body Parameters**:\n  - `advice`: (String) The advice content.\n  - `author`: (String) The name of the advice author.\n- **Example Request**:\n  ```json\n  {\n    \"advice\": \"Stay positive!\",\n    \"author\": \"John Doe\"\n  }\n  ```\n- **Example Response**:\n  ```json\n  {\n    \"message\": \"Advice saved successfully!\"\n  }\n  ```\n\n### 2. **Get Random Advice**\n\n- **URL**: `/getadvice`\n- **Method**: `GET`\n- **Description**: Returns a random piece of advice from the database.\n- **Example Response**:\n  ```json\n  {\n    \"advice\": \"Don't forget to smile!\",\n    \"author\": \"Jane Smith\"\n  }\n  ```\n\n## Getting Started 🚀\n\n### Prerequisites\n\n- **Node.js** (\u003e=12.x recommended)\n- **MongoDB**: A running MongoDB instance (local or cloud-based).\n\n### Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/ramxcodes/Advice-me-ram-backend.git\n   cd advice-me-ram-backend\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n3. Create a `.env` file in the root directory and add the following variables:\n   ```bash\n   PORT=5000\n   MONGODB_URI=your_mongodb_connection_string\n   ```\n\n4. Start the server:\n   ```bash\n   npm start\n   ```\n   The server should now be running at `http://localhost:5000`.\n\n## Folder Structure 📂\n\n- **`/models`**: Mongoose schemas for defining the `Advice` model.\n- **`/controllers`**: Contains logic for handling requests and responses.\n- **`/routes`**: Defines routes for posting and fetching advice.\n\n## Error Handling 🚫\n\n- If a required field is missing or there’s a database error, the server will respond with a `500` status and an appropriate error message.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framxcodes%2Fadvice-me-ram-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framxcodes%2Fadvice-me-ram-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framxcodes%2Fadvice-me-ram-backend/lists"}