{"id":20779933,"url":"https://github.com/atakansn/nodejs-rest","last_synced_at":"2025-12-26T04:32:30.313Z","repository":{"id":190825967,"uuid":"615960626","full_name":"atakansn/nodejs-rest","owner":"atakansn","description":"NodeJS and MongoDB, simple ecommerce rest api","archived":false,"fork":false,"pushed_at":"2023-03-19T15:13:41.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T08:45:12.888Z","etag":null,"topics":["javascript","mongodb","node","rest-api","restfull-api"],"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/atakansn.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}},"created_at":"2023-03-19T07:36:15.000Z","updated_at":"2023-03-19T15:12:37.000Z","dependencies_parsed_at":"2023-08-26T15:42:42.929Z","dependency_job_id":null,"html_url":"https://github.com/atakansn/nodejs-rest","commit_stats":null,"previous_names":["atakansn/nodejs-rest"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atakansn%2Fnodejs-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atakansn%2Fnodejs-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atakansn%2Fnodejs-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atakansn%2Fnodejs-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atakansn","download_url":"https://codeload.github.com/atakansn/nodejs-rest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243120628,"owners_count":20239514,"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":["javascript","mongodb","node","rest-api","restfull-api"],"created_at":"2024-11-17T13:30:49.337Z","updated_at":"2025-12-26T04:32:30.269Z","avatar_url":"https://github.com/atakansn.png","language":"JavaScript","readme":"\n# NodeJS E-Commerce Basic Rest Api\n\nNodeJS and MongoDB basic rest api.\n\n## Install\n```bash \n  git clone https://github.com/atakansn/nodejs-rest.git\n  \n  cd nodejs-rest\n```\n\n## Running in a Developer Environment\n\n```bash\n  npm run dev\n```\n\n## Configuration\n\n#### Env File Editing\n```env\n#Stack displays in the error output during development, if production is set, it is not displayed.\n\nNODE_ENV=development\n\n#Application Settings\n\nAPP_NAME=\"Restfull Api\"\nAPP_PORT=3000\nAPP_URL=http://localhost\nAPP_HOSTNAME=localhost #It is the hostname that ExpressJS uses.\n\nDB_HOST=127.0.0.1 #mongodb host\nDB_PORT=27017 #mongodb port\nDB_NAME= #mongodb db name\n\n#If disk is selected, the uploaded image will be moved to public/images. If s3 is selected, the uploaded image will be uploaded to aws s3 cloud storage.\n\nFILE_UPLOAD=disk\n\n#It uses jwt for authentication. You must enter the secret keys here.\n\nJWT_ACCESS_SECRET_KEY=\nJWT_REFRESH_SECRET_KEY=\n\n#If FILE_UPLOAD field is selected as s3, aws settings must be made.\n\nAWS_S3_ACCESS_KEY_ID=\nAWS_S3_SECRET_ACCESS_KEY=\nAWS_S3_BUCKET=\nAWS_S3_REGION=\nAWS_S3_ACL=\n\n```\n\n## API Usage\n\n#### User Routes\n\n```http\nThe following routes can be used by logged in users.\n\nBearer {token} is required on all routes.\n\nGET /api/v1/users\nPATCH /api/v1/users\nDELETE /api/v1/users\nPATCH /api/v1/users/password-change\n```\n| Request | Route     | Descripiton                       |\n| :-------- | :------- | :-------------------------------- |\n| GET      | /api/v1/users | Displays the logged in user's information. |\n| PATCH      | /api/v1/users | Updates user information. {first_name,last_name,email} any field can be updated.|\n| DELETE      | /api/v1/users | Deletes the user. |\n| PATCH      | /api/v1/users | Updates user password. {password} field is required. |\n\n```http\nPOST /api/v1/users\nPOST /api/v1/users/password-reset\nPOST /api/v1/users/password-reset/:token\nPOST /api/v1/users/login\n```\n| Request | Route     | Descripiton                       |\n| :-------- | :------- | :-------------------------------- |\n| POST      | /api/v1/users | Creates a new user. {first_name,last_name,email,password} fields are required. |\n| POST      | /api/v1/users/password-reset | It sends a password reset link to the registered email address. The {email} field is required. |\n| POST      | /api/v1/users/login | User login. {email,password} fields are required.|\n\n\n```http\nPOST /api/v1/users/password-reset/:token\n```\n\n| Parameter | Type     | Descripiton                |\n| :-------- | :------- | :------------------------- |\n| `token` | `string` | It is the password reset link sent to the e-mail address, it receives an ?email query at the end. |\n\n#### Login Process\n\n```http\n  POST /api/v1/users\n```\n\nSample output of logged in user\n\n```json\n{\n    \"user\": {\n        \"_id\": \"XXXXXXXXXXXXXXXXXXX\",\n        \"first_name\": \"Jhon\",\n        \"last_name\": \"Doe\",\n        \"email\": \"mail@mail.com\"\n    },\n    \"tokens\": {\n        \"access_token\": \"Foo\",\n        \"refresh_token\": \"Bar\"\n    }\n}\n```\n\n#### Category Routes\n\n```http\nGET /api/v1/categories\nGET /api/v1/categories/:id\nPOST /api/v1/categories\nPATCH /api/v1/categories/:id\nDELETE /api/v1/categories/:id\n```\n| Request | Route     | Descripiton                       |\n| :-------- | :------- | :-------------------------------- |\n| GET      | /api/v1/categories | Brings all categories. |\n| GET      | /api/v1/categories/:id | The :id returns the category. |\n| POST      | /api/v1/categories | Creates a new category. The {name} field is required. The slug field is created automatically. |\n| PATCH      | /api/v1/categories/:id | Updates the category with the :id parameter. |\n| DELETE      | /api/v1/categories/:id | Deletes the category with the :id parameter. |\n\n#### Product Routes\n\n```http\nGET /api/v1/products\nGET /api/v1/products/:id\nPOST /api/v1/products\nPATCH /api/v1/products/:id\nDELETE /api/v1/products/:id\n```\n| Request | Route     | Descripiton                       |\n| :-------- | :------- | :-------------------------------- |\n| GET      | /api/v1/products | It brings all the products. |\n| GET      | /api/v1/products/:id | Brings the product with :id.|\n| POST      | /api/v1/products | Creates a new product. The {name,price,quantity,image,category_id,description} field is required. Slug,SKU field is created automatically. |\n| PATCH      | /api/v1/products/:id | Updates the product with the :id parameter. |\n| DELETE      | /api/v1/products/:id | Deletes the product with the :id parameter. |\n\n#### User Address Routes\n\n```http\nGET /api/v1/user-address\nGET /api/v1/user-address/:id\nPOST /api/v1/user-address\nPATCH /api/v1/user-address/:id\nDELETE /api/v1/user-address/:id\n```\n| Request | Route     | Descripiton                       |\n| :-------- | :------- | :-------------------------------- |\n| GET      | /api/v1/user-address | Returns all addresses. |\n| GET      | /api/v1/user-address/:id | The :id returns the address. |\n| POST      | /api/v1/user-address | Creates a new address. The {user_id,phone_number,country,city,street1,state,zip} field is required. The {stree2} field can be created optionally. |\n| PATCH      | /api/v1/user-address/:id | Updates the address with the :id parameter. |\n| DELETE      | /api/v1/user-address/:id | It deletes the address with the :id parameter. |\n\n\n\n  ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatakansn%2Fnodejs-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatakansn%2Fnodejs-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatakansn%2Fnodejs-rest/lists"}