{"id":22767053,"url":"https://github.com/gitusergb/newnotes","last_synced_at":"2025-03-30T10:43:00.232Z","repository":{"id":211708858,"uuid":"729785391","full_name":"gitusergb/NewNotes","owner":"gitusergb","description":"deployed link/URL of my basic back end notes application , deployed it on Render ","archived":false,"fork":false,"pushed_at":"2025-01-12T14:48:00.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T12:35:42.377Z","etag":null,"topics":["controllers","express","express-middleware","html","javascript","jsonwebtoken","models","mongodb","mongodb-atlas","routes"],"latest_commit_sha":null,"homepage":"https://notes-server-o8j5.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/gitusergb.png","metadata":{"files":{"readme":null,"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":"2023-12-10T11:00:58.000Z","updated_at":"2025-01-12T14:48:03.000Z","dependencies_parsed_at":"2023-12-19T12:04:25.192Z","dependency_job_id":"5d8b495f-6400-4be1-bc8d-4f9d814f1322","html_url":"https://github.com/gitusergb/NewNotes","commit_stats":null,"previous_names":["gitusergb/newnotes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitusergb%2FNewNotes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitusergb%2FNewNotes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitusergb%2FNewNotes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitusergb%2FNewNotes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitusergb","download_url":"https://codeload.github.com/gitusergb/NewNotes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246307931,"owners_count":20756478,"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":["controllers","express","express-middleware","html","javascript","jsonwebtoken","models","mongodb","mongodb-atlas","routes"],"created_at":"2024-12-11T13:16:46.924Z","updated_at":"2025-03-30T10:43:00.225Z","avatar_url":"https://github.com/gitusergb.png","language":"JavaScript","readme":"\n\n## DAY1: We focused on building the BackEnd for our notes taking application with following features:\n\n### A new user should be able to register.\n### A registered user should be able to authenticate.\n### A user should be able to create a new note.\n### A user should be able view his/her notes.\n### A user should be able update his/her notes.\n### A user should be able delete his/her notes.\n\n## Implementing User Authentication and Authorization using JWT (JSON Web Tokens) and bcrypt\n\n### User section \n\n#### Step 1: Create a Registration system, take care of the hashing as well.\n\n#### Step 2: Create a Auth system, by the help of JWT.\n\n----\n\n### Notes  sction\n\n#### Create: /notes/create → POST\n\n#### Read: /notes → GET\n\n#### Update: /notes/update/:noteID → PATCH\n\n#### Delete: /notes/delete/:noteID DELETE\n\nAll these routes will be restricted,\nAlso a user should be able to Read,\nUpdate and Delete his or her notes only....\n\n#### Relationship \n#### propdriling\n\n```Login Rout =\u003e Middleware ==\u003e Notes```\n\n### Deploy BE application ,create frontend\nApplication Deployment, also known as Software Deployment, is the process of installing, configuring, updating, and enabling one application or suite of applications that make a software system available for use, like facilitating a certain URL on a server.\n\n### AWS/Azure not using \n\n### using render / Cyclic and Railway I have to deploy ..\n\n### link :https://notes-server-o8j5.onrender.com\n\n\n### *** POST:\n\n### users\n\n1) /users/register:\n\nhttp://localhost:3000/users/register\n\n\n//body:\n```\n{\n\"username\":\"user22\",\n  \"email\": \"user22@gmail.com\",\n     \"password\": \"user22\"\n}\n```\no/p:\n```\n{\"msg\":\"The new user has been registered\",\"registeredUser\":{\"username\":\"user22\",\"email\":\"user22@gmail.com\",\"password\":\"$2b$08$0gN8vr0RU1PtoNUCJtShV.R9u2TDr5GuCwiH07c/X.kNMj4.XU/hO\",\"_id\":\"659cea0c4293674305fbaff8\"}}\n```\n\n2) /users/login:\n\nhttp://localhost:3000/users/login\n\n//body:\n```\n{\n  \"email\": \"user22@gmail.com\",\n     \"password\": \"user22\"\n}\n```\n\no/p:\n```\n{\n    \"msg\": \"Login successful!\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOiI2NTljZWEwYzQyOTM2NzQzMDVmYmFmZjgiLCJ1c2VybmFtZSI6InVzZXIyMiIsImlhdCI6MTcwNDc4MjUxNH0.ViiFcHjy1OVkJwlaH7F75StYpS91OYaARkF3KqSBM00\"\n}\n```\n \n### notes\n1)notes/create\n\nhttp://localhost:3000/notes/create\n\n// pass the token in Headers ==\u003e key : value \n\n```Authorization\n```\n```\nBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOiI2NTljZWEwYzQyOTM2NzQzMDVmYmFmZjgiLCJ1c2VybmFtZSI6InVzZXIyMiIsImlhdCI6MTcwNDc4MjUxNH0.ViiFcHjy1OVkJwlaH7F75StYpS91OYaARkF3KqSBM00\n\n```\n\n//body:\n```\n{\n  \"title\": \"Relationships\",\n  \"body\": \"I implimented Relationship today\"\n}\n```\no/p:\n```\n{\n    \"msg\": \"A new note has been Created\",\n    \"Note\": {\n        \"title\": \"Relationships\",\n        \"body\": \"I implimented Relationship today\",\n        \"userID\": \"659cea0c4293674305fbaff8\",\n        \"username\": \"user22\",\n        \"_id\": \"659cf10a5e4ae552ecd420ec\"\n    }\n}\n\n```\n\na single user can add multiple notes like this \n//body:\n```\n{\n  \"title\": \"RBAC\",\n  \"body\": \"I implimented RBAC today\"\n}\n```\no/p:\n```\n{\n    \"msg\": \"A new note has been Created\",\n    \"Note\": {\n        \"title\": \"RBAC\",\n        \"body\": \"I implimented RBAC today\",\n        \"userID\": \"659cea0c4293674305fbaff8\",\n        \"username\": \"user22\",\n        \"_id\": \"659cf2fb0acea10c4e4bface\"\n    }\n}\n\n```\n\n---\n\n### *** GET:\n\n### users\n\n1) /users/logout:\n\nhttp://localhost:3000/users/logout\n\n//body:\n```\n\n```\n\no/p:\n```\n{\n    \"msg\": \"Logged out !\",\n}\n```\n\n---\n\n### notes\n\n1)notes/\n\nhttp://localhost:3000/notes/\n\n// pass the token in Headers ==\u003e key : value \n\n\n```Authorization\n```\n```\nBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOiI2NTljZWEwYzQyOTM2NzQzMDVmYmFmZjgiLCJ1c2VybmFtZSI6InVzZXIyMiIsImlhdCI6MTcwNDc4MjUxNH0.ViiFcHjy1OVkJwlaH7F75StYpS91OYaARkF3KqSBM00\n\n```\n\n//body:\n```\n\n```\n\nu will get the notes only added by user 22 as o/p:\n```\n[\n    {\n        \"_id\": \"659cf10a5e4ae552ecd420ec\",\n        \"title\": \"Relationships\",\n        \"body\": \"I implimented Relationship today\",\n        \"userID\": \"659cea0c4293674305fbaff8\",\n        \"username\": \"user22\"\n    },\n    {\n        \"_id\": \"659cf2fb0acea10c4e4bface\",\n        \"title\": \"RBAC\",\n        \"body\": \"I implimented RBAC today\",\n        \"userID\": \"659cea0c4293674305fbaff8\",\n        \"username\": \"user22\"\n    }\n]\n\n```\n\n### *** UPDATE/PATCH:\n\n\n### notes\n1)notes/update/:noteID\n\nhttp://localhost:3000/notes/update/:noteID\n\n// pass the token in Headers ==\u003e key : value \n//pass noteID in params :659e258510ef807111c29a87\n\n```Authorization\n```\n```\nBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOiI2NTljZWEwYzQyOTM2NzQzMDVmYmFmZjgiLCJ1c2VybmFtZSI6InVzZXIyMiIsImlhdCI6MTcwNDc4MjUxNH0.ViiFcHjy1OVkJwlaH7F75StYpS91OYaARkF3KqSBM00\n\n```\n\n//body:\n```\n{\n  \"title\": \"FIGMA ,WEB Designing \",\n  \"body\": \"I implimented FIGMA ,WEB Designing today\"\n}\n```\n\nu will get the notes update only added by user 22 as o/p:\n```\n{\n    \"msg\": \"Note with Id:659e258510ef807111c29a87 has been updated\"\n}\n\n```\n\n\n\n### *** DELETE:\n\n\n### notes\n1)notes/delete/:noteID\n\nhttp://localhost:3000/notes/delete/:noteID\n\n// pass the token in Headers ==\u003e key : value \n//pass noteID in params ex: 659cf2fb0acea10c4e4bface\n\n```Authorization\n```\n```\nBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOiI2NTljZWEwYzQyOTM2NzQzMDVmYmFmZjgiLCJ1c2VybmFtZSI6InVzZXIyMiIsImlhdCI6MTcwNDc4MjUxNH0.ViiFcHjy1OVkJwlaH7F75StYpS91OYaARkF3KqSBM00\n\n```\n\n//body:\n```\nNA\n```\n```\n{\n    \"msg\": \"Note with Id:659e257610ef807111c29a85 has been deleted\"\n}\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitusergb%2Fnewnotes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitusergb%2Fnewnotes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitusergb%2Fnewnotes/lists"}