{"id":20277143,"url":"https://github.com/darthdevv/node-mongodb","last_synced_at":"2026-04-12T01:41:36.406Z","repository":{"id":244400965,"uuid":"815109068","full_name":"Darthdevv/node-mongodb","owner":"Darthdevv","description":"Car rental system where users can rent Cars.","archived":false,"fork":false,"pushed_at":"2024-07-01T01:14:55.000Z","size":97,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T06:46:44.707Z","etag":null,"topics":["express","mongodb","mongoose","nodejs","rest-api"],"latest_commit_sha":null,"homepage":"https://node-mongodb-production-947e.up.railway.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/Darthdevv.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-06-14T11:22:06.000Z","updated_at":"2024-07-01T01:26:48.000Z","dependencies_parsed_at":"2024-06-14T14:03:27.137Z","dependency_job_id":"aee17d7e-baa9-4e11-a54f-9f15b8181d63","html_url":"https://github.com/Darthdevv/node-mongodb","commit_stats":null,"previous_names":["darthdevv/node-mongodb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darthdevv%2Fnode-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darthdevv%2Fnode-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darthdevv%2Fnode-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darthdevv%2Fnode-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Darthdevv","download_url":"https://codeload.github.com/Darthdevv/node-mongodb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241768283,"owners_count":20017117,"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","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":["express","mongodb","mongoose","nodejs","rest-api"],"created_at":"2024-11-14T13:17:10.565Z","updated_at":"2026-04-12T01:41:31.378Z","avatar_url":"https://github.com/Darthdevv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Car Rental API Documentation\nWelcome to the Car Rental API! This API allows users to manage cars, customers, and rental transactions for a car rental service. Below you will find a comprehensive guide on how to use the API.\n\n## Table of Contents\n1. Getting Started\n2. Authentication\n3. Endpoints\n- User APIs\n- Car APIs\n- Rental APIs\n- Special APIs\n4. Models\n- Car\n- Customer\n- Rental\n5. Error Handling\n6. Rate Limiting\n7. Changelog\n8. Support\n### Getting Started\nTo start using the Car Rental API, follow these steps:\n\nRegister an Account: Sign up for an API key by registering on our website.\nBase URL: All API requests should be made to the following base URL: https://api.carrental.com/v1\n### Authentication\nAll API requests require an API key. Pass your API key in the Authorization header:\n\n```\nAuthorization: Bearer YOUR_API_KEY\n```\n\n### Endpoints\nUser APIs\nSignup\nCreate a new user account.\n\nEndpoint: /users/signup\nMethod: POST\n\n```\nPOST /users/register\nContent-Type: application/json\n\n{\n  \"name\": \"John Doe\",\n  \"email\": \"john.doe@example.com\",\n  \"password\": \"securepassword\",\n  \"phone\": \"555-1234\"\n}\n```\n\nSign in\nAuthenticate a user and obtain an API token.\n\nEndpoint: /users/signin\nMethod: POST\n\n```\nPOST /users/login\nContent-Type: application/json\n\n{\n  \"email\": \"john.doe@example.com\",\n  \"password\": \"securepassword\"\n}\n```\nGet a Specific User\nRetrieve details of a specific user by their ID.\n\nEndpoint: /users/:id\nMethod: GET\n```\nGET /users/:id\n```\nGet All Users\nRetrieve a list of all users.\n\nEndpoint: /users\nMethod: GET\n```\nGET /users\n```\nUpdate User (Owner Only)\nUpdate details of an existing user (only the owner can update).\n\nEndpoint: /users/:id\nMethod: PATCH\n```\nPATCH /users/{id}\nContent-Type: application/json\n\n{\n  \"name\": \"Jane Doe\",\n  \"email\": \"jane.doe@example.com\",\n  \"password\": \"securepassword\",\n  \"phone\": \"555-5678\"\n}\n```\nDelete User (Owner Only)\nRemove a user from the system (only the owner can delete).\n\nEndpoint: /users/:id\nMethod: DELETE\n```\nDELETE /users/:id\n```\nCar APIs\nAdd Car\nAdd a new car to the fleet.\n\nEndpoint: /cars\nMethod: POST\n```\nPOST /cars\nContent-Type: application/json\n\n{\n  \"name\": \"Ferrari Enzo\",\n  \"model\": \"Ferrari\",\n  \"rentalStatus\": \"available\"\n}\n```\nGet a Specific Car\nRetrieve details of a specific car by its ID.\n\nEndpoint: /cars/:id\nMethod: GET\n```\nGET /cars/:id\n```\nGet All Cars\nRetrieve a list of all cars.\n\nEndpoint: /cars\nMethod: GET\n```\nGET /cars\n```\nUpdate Car\nUpdate details of an existing car.\n\nEndpoint: /cars/:id\nMethod: PATCH\n```\nPATCH /cars/:id\nContent-Type: application/json\n\n{\n  \"name\": \"Ferrari Laferrari\",\n  \"model\": \"Ferrari\",\n  \"rentalStatus\": \"available\"\n}\n```\nDelete Car\nRemove a car from the fleet.\n\nEndpoint: /cars/:id\nMethod: DELETE\n```\nDELETE /cars/:id\n```\nRental APIs\nCreate Rental\nCreate a new rental transaction.\n\nEndpoint: /rentals\nMethod: POST\n```\nPOST /rentals\nContent-Type: application/json\n\n{\n  \"car\": \"1\",\n  \"rental_date\": \"2024-07-01\",\n  \"return_date\": \"2024-07-10\"\n}\n```\nUpdate Rental\nUpdate details of an existing rental.\n\nEndpoint: /rentals/:id\nMethod: PUT\n```\nPUT /rentals/:id\nContent-Type: application/json\n\n{\n  \"car\": \"2\",\n  \"rental_date\": \"2024-06-01\",\n  \"return_date\": \"202:-0-10\"\n}\n```\nDelete Rental\nDelete a rental record.\n\nEndpoint: /rentals/:id\nMethod: DELETE\n```\nDELETE /rentals/:id\n```\nGet All Rentals\nRetrieve a list of all rentals.\n\nEndpoint: /rentals\nMethod: GET\n```\nGET /rentals\n```\nGet a Specific Rental\nRetrieve details of a specific rental by its ID.\n\nEndpoint: /rentals/:id\nMethod: GET\n```\nGET /rentals/:id\n```\nSpecial APIs\nGet Cars by Model (Honda and Toyota)\nRetrieve a list of all cars whose model is either Honda or Toyota.\n\nEndpoint: /cars\nMethod: GET\nQuery Params: model=Honda,Toyota\n```\nGET /cars?model=Honda,Toyota\n```\nGet Available Cars of a Specific Model\nRetrieve a list of all available cars of a specific model.\n\nEndpoint: /cars\nMethod: GET\nQuery Params: model=\u003cmodel\u003e\u0026status=available\n```\nGET /cars?model=Corolla\u0026status=available\n```\nGet Cars that are Either Rented or of a Specific Model\nRetrieve a list of cars that are either rented or of a specific model.\n\nEndpoint: /cars\nMethod: GET\nQuery Params: model=\u003cmodel\u003e\u0026status=rented\n```\nGET /cars?model=Camry\u0026status=rented\n```\nGet Available Cars of Specific Models or Rented Cars of a Specific Model\nRetrieve a list of available cars of specific models or rented cars of a specific model.\n\nEndpoint: /cars\nMethod: GET\nQuery Params: model=\u003cmodel1\u003e,\u003cmodel2\u003e\u0026status=available,rented\n```\nGET /cars?model=Accord,Civic\u0026status=available,rented\n```\n### Models\n```\nconst carSchema = new mongoose.Schema(\n  {\n    name: {\n      type: String,\n      required: true\n    },\n    model: {\n      type: String,\n      required: true\n    },\n    rentalStatus: {\n      type: String,\n      enum: [\"available\", \"rented\"],\n      default: \"available\",\n    },\n  },\n  { timestamps: true }\n);\n\n```\n```\nconst customerSchema = new mongoose.Schema(\n  {\n    name: {\n      type: String,\n      required: true\n    },\n    password: {\n      type: String,\n      required: true\n    },\n    email: {\n      type: String,\n      required: true,\n      unique: true\n    },\n    phonenumber: {\n      type: String,\n      required: true\n    },\n  },\n  { timestamps: true }\n);\n\n```\n```\nconst rentalSchema = new mongoose.Schema(\n  {\n    car: {\n      type: Schema.Types.ObjectId,\n      ref: \"Car\",\n      required: true\n    },\n    customer: {\n      type: Schema.Types.ObjectId,\n      ref: \"Customer\",\n      required: true,\n    },\n    rentalDate: {\n      type: Date,\n      default: Date.now\n    },\n    returnDate: { type: Date },\n  },\n  { timestamps: true }\n);\n\n```\n\n### Error Handling\nThe API uses standard HTTP status codes to indicate success or failure of requests:\n\n- 200 OK: The request was successful.\n- 201 Created: The resource was successfully created.\n- 400 Bad Request: The request was invalid or cannot be otherwise served.\n- 401 Unauthorized: Authentication failed or user does not have permissions.\n- 404 Not Found: The requested resource could not be found.\n- 500 Internal Server Error: An error occurred on the server.\n### Rate Limiting\nTo ensure fair usage and prevent abuse, the API has rate limiting in place. Each API key is limited to 1000 requests per hour. Exceeding this limit will result in a 429 Too Many Requests response.\n\n### Changelog\nv1.0: Initial release with user, car, and rental management.\n### Support\nIf you need assistance, please contact our support team at support@carrental.com.\n\nHappy renting!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarthdevv%2Fnode-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarthdevv%2Fnode-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarthdevv%2Fnode-mongodb/lists"}