{"id":22435175,"url":"https://github.com/zichkoding/the_son_api","last_synced_at":"2025-10-09T15:26:26.923Z","repository":{"id":158549627,"uuid":"439148157","full_name":"ZichKoding/THE_SoN_API","owner":"ZichKoding","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-28T23:22:41.000Z","size":28,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T15:26:26.178Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ZichKoding.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,"zenodo":null}},"created_at":"2021-12-16T22:53:43.000Z","updated_at":"2021-12-28T23:22:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0524ff1-b1f5-4ebf-81e1-305f089a0801","html_url":"https://github.com/ZichKoding/THE_SoN_API","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ZichKoding/THE_SoN_API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZichKoding%2FTHE_SoN_API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZichKoding%2FTHE_SoN_API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZichKoding%2FTHE_SoN_API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZichKoding%2FTHE_SoN_API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZichKoding","download_url":"https://codeload.github.com/ZichKoding/THE_SoN_API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZichKoding%2FTHE_SoN_API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001656,"owners_count":26083147,"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-10-09T02:00:07.460Z","response_time":59,"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":[],"created_at":"2024-12-05T23:12:41.574Z","updated_at":"2025-10-09T15:26:26.891Z","avatar_url":"https://github.com/ZichKoding.png","language":"JavaScript","readme":"# THE_SoN_API\n\n[Click here for a walkthrough video!](https://www.youtube.com/watch?v=mss8h-YdLt0\u0026t=1s\u0026ab_channel=ZichKoding)\n\n## Description\n\nTHE_SoN_API stands for The Social Network API. With this API you are able to create users, thoughts (posts), reactions to a thought (replies), and a user can have a friend list. The database used is a NoSQL database called MongoDB, and I have used mongoose for all CRUD interactions with MongoDB.\n#\n\n## Table of Contents\n\n* [How to create a user](#How-to-create-a-user)\n* [How to update a user](#How-to-update-a-user)\n* [How to delete a user](#How-to-delete-a-user)\n* [How to GET all users or one](#How-to-GET-all-users-or-one)\n* [How to add and remove a friend from friend list](#How-to-add-and-remove-a-friend-from-friend-list)\n* [How to create a thought](#How-to-create-a-thought)\n* [How to update a thought](#How-to-update-a-thought)\n* [How to delete a thought](#How-to-delete-a-thought)\n* [How to GET all thoughts or one thought](#How-to-GET-all-thoughts-or-one-thought)\n* [How to add and remove a reaction](#How-to-add-and-remove-a-reaction)\n\n#\n\n### **How to create a user**\n To create a user the url is `/api/users/`. Then the body must consist of the following:\n ```\n firstName\n lastName\n username\n email\n password\n ```\nThe fields above are required, and the username and email have to be unique. There are validators to ensure the username and email is unique and that the email is in email address format. \n\nThe password, also, has validators to ensure a minimum length and has encryption with mongoose-bcrypt package. \n#\n\n### **How to update a user**\nTo update a user the url is `/api/users/:username`, where `:username` is the unique username of the user needing to be updated.\n#\n### **How to delete a user**\nTo delete a user the url is `/api/users/:username`, where `:username` is the unique username of the user needing to be deleted.\n#\n### **How to GET all users or one**\nTo get all Users from the database along with their friend list (this list consists of the ids of the users) and thoughts the route is `/api/users`. \n\nTo get one User from the database along with their friend list (this list consists of the ids of the users) and thoughts the route is `/api/users/:username`. \n#\n### **How to add and remove a friend from friend list**\nFor adding and removing a friend from a user's friend list it is the same route, `/api/users/:username/friends/:friendId`, where `:username` is the user's name that wants to add a user to the friend list, and `:friendId` is the user's **_id_** that will be stored into the friend list.\n#\n### **How to create a thought**\n To create a user the url is `/api/thoughts/`. Then the body must consist of the following:\n ```\n thoughtText\n username\n ```\nThe fields above are required. The `thoughtText` has a minimum character length of 1 and a maximum character length of 280. The `username` is for a unique user in the User database. \n#\n### **How to update a thought**\nTo update a thought the url is `/api/thoughts/:id` where `:id` is the thought id that is needing to be updated. Also, only the `thoughtText` is allowed to be updated on this route. If you are needing to update a user's username refer to the [How to update a user](#) above.\n#\n### **How to delete a thought**\nTo delete a thought the url is `/api/thoughts/:username/:id` where `:username` is the user's username that owns the thought and  `:id` is the thought id that is needing to be deleted. \n#\n### **How to GET all thoughts or one thought**\nTo get all thoughts the url is `/api/thoughts`. This will return all thoughts with the user that owns the thought and a reaction list, which stores the reaction's id to a thought.\n\nTo get a single thought the url is `/api/thoughts/:id` where `:id` is the thought's id you are wanting to see. This will return one thought with the user that owns the thought and a reaction list, which stores the reaction's id, text, and reaction's owner to a thought.\n#\n### **How to add and remove a reaction**\nTo create a reaction the url is `/api/thoughts/:thoughtId/reactions` where `:thoughtId` is the thought id the reaction will be related to. The reaction's body must consist of the following:\n```\nreactionBody\nusername\n```\nThe `reactionBody` stores up to 280 characters and is required. The `username` is the user's username that is adding a reaction to the thought. \n\nTo delete a reaction the url is `/api/thoughts/:thoughtId/reactions/:reactionId` where `:thoughtId` is the thought's id the reaction is related to, and `:reactionId` is the reaction's id that is being deleted. \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzichkoding%2Fthe_son_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzichkoding%2Fthe_son_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzichkoding%2Fthe_son_api/lists"}