{"id":27240995,"url":"https://github.com/adammcodes/the-scoop","last_synced_at":"2025-10-07T00:25:37.107Z","repository":{"id":76415179,"uuid":"369870404","full_name":"adammcodes/the-scoop","owner":"adammcodes","description":"A project inherited from Codecademy PRO back-end skill path. For the purpose of practicing database and routing logic.","archived":false,"fork":false,"pushed_at":"2021-05-28T15:42:23.000Z","size":533,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-07T20:58:14.033Z","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/adammcodes.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}},"created_at":"2021-05-22T17:39:12.000Z","updated_at":"2021-05-28T15:42:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"8fe8366d-6072-40dc-9a3b-b892960cfe8d","html_url":"https://github.com/adammcodes/the-scoop","commit_stats":null,"previous_names":["adammcodes/the-scoop"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adammcodes/the-scoop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adammcodes%2Fthe-scoop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adammcodes%2Fthe-scoop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adammcodes%2Fthe-scoop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adammcodes%2Fthe-scoop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adammcodes","download_url":"https://codeload.github.com/adammcodes/the-scoop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adammcodes%2Fthe-scoop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278703204,"owners_count":26031201,"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-06T02:00:05.630Z","response_time":65,"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":"2025-04-10T19:56:21.638Z","updated_at":"2025-10-07T00:25:37.092Z","avatar_url":"https://github.com/adammcodes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Scoop\n\n## Project Overview\n\nIn this project, I built all of the routing and database logic for an article submission web app called The Scoop.\n\nThe Scoop allows users to:\n- Create and log in to custom username handles\n- Submit, edit, and delete articles containing a link and description\n- Upvote and downvote articles\n- Create, edit, and delete comments on articles\n- Upvote and downvote comments\n- View all of a user's articles and comments\n\n## Run Locally\n\nTo start your server, run `npm install` and then `node server.js` from the root directory of this project. \n\nTo view your local version of the site, open **index.html** in Google Chrome.\n\n### Database Properties\n\n* **comments** - an object with keys of IDs and values of the corresponding comments\n  - id - Number, unique to each comment\n  - body - String\n  - username - String, the username of the author\n  - articleId - Number, the ID of the article the comment belongs to\n  - upvotedBy - Array of usernames, corresponding to users who upvoted the comment\n  - downvotedBy - Array of usernames, corresponding to users who downvoted the comment\n\n* **nextCommentId** - a number representing the ID of the next comment to create (to ensure all comments have unique IDs), initializes to `1`\n\n\n### Route Paths and Functionality\n\n**/comments**\n- POST\n  - Receives comment information from `comment` property of request body\n  - Creates new comment and adds it to database, returns a 201 response with comment on `comment` property of response body\n  - If body isn't supplied, user with supplied username doesn't exist, or article with supplied article ID doesn't exist, returns a 400 response\n\n**/comments/:id**\n- PUT\n  - Receives comment ID from URL parameter and updated comment from `comment` property of request body\n  - Updates body of corresponding comment in database, returns a 200 response with the updated comment on `comment` property of the response body\n  - If comment with given ID does not exist, returns 404 response\n  - If no ID or updated comment is supplied, returns 200 response\n- DELETE\n  - Receives comment ID from URL parameter\n  - Deletes comment from database and removes all references to its ID from corresponding user and article models, returns 204 response\n  - If no ID is supplied or comment with supplied ID doesn't exist, returns 400 response\n\n**/comments/:id/upvote**\n- PUT\n  - Receives comment ID from URL parameter and username from `username` property of request body\n  - Adds supplied username to `upvotedBy` of corresponding comment if user hasn't already upvoted the comment, removes username from `downvotedBy` if that user had previously downvoted the comment, returns 200 response with comment on `comment` property of response body\n  - If no ID is supplied, comment with supplied ID doesn't exist, or user with supplied username doesn't exist, returns 400 response\n\n**/comments/:id/downvote**\n- PUT\n  - Receives comment ID from URL parameter and username from `username` property of request body\n  - Adds supplied username to `downvotedBy` of corresponding comment if user hasn't already downvoted the comment, remove username from `upvotedBy` if that user had previously upvoted the comment, returns 200 response with comment on `comment` property of response body\n  - If no ID is supplied, comment with supplied ID doesn't exist, or user with supplied username doesn't exist, returns 400 response\n\n**JSON Database load/save with Figg (node module)**\n\n**loadDatabase**\n\n- Reads a JSON file containing the database and returns a JavaScript object representing the database\n\n**saveDatabase**\n\n- Writes the current value of `database` to a JSON file\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadammcodes%2Fthe-scoop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadammcodes%2Fthe-scoop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadammcodes%2Fthe-scoop/lists"}