{"id":21307277,"url":"https://github.com/jdegand/redditjs","last_synced_at":"2026-04-07T18:31:32.409Z","repository":{"id":110668812,"uuid":"518965261","full_name":"jdegand/redditjs","owner":"jdegand","description":"Make School Tutorial - Redditjs","archived":false,"fork":false,"pushed_at":"2024-09-08T02:53:55.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T13:11:03.668Z","etag":null,"topics":["bootstrap","chai","express","handlebars","jquery","makeschool","mocha","mongoose"],"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/jdegand.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":"2022-07-28T19:07:36.000Z","updated_at":"2024-09-08T02:53:59.000Z","dependencies_parsed_at":"2024-11-21T16:37:01.337Z","dependency_job_id":null,"html_url":"https://github.com/jdegand/redditjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jdegand/redditjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2Fredditjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2Fredditjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2Fredditjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2Fredditjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdegand","download_url":"https://codeload.github.com/jdegand/redditjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2Fredditjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31524524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bootstrap","chai","express","handlebars","jquery","makeschool","mocha","mongoose"],"created_at":"2024-11-21T16:30:58.509Z","updated_at":"2026-04-07T18:31:32.380Z","avatar_url":"https://github.com/jdegand.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eRedditjs\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n   Based on tutorial from  \u003ca href=\"https://makeschool.org/mediabook/oa/tutorials/reddit-clone-in-node-js/technical-planning/\" target=\"_blank\"\u003emakeschool.org\u003c/a\u003e.\n\u003c/div\u003e\n\n## Table of Contents\n\n- [Overview](#overview)\n  - [Screenshots](#screenshots)\n  - [Built With](#built-with)\n- [How to Use](#how-to-use)\n- [Thoughts](#thoughts)\n- [Continued Development](#continued-development)\n- [Useful Resources](#useful-resources)\n\n## Overview\n\nMakeSchool was a coding bootcamp that went under.  Most content was made free and I found this and decided to follow along.\n\n### Screenshots\n\n![Not logged in](screenshots/redditjs-home-not-loggedin.png)\n\n***\n\n![Signup](screenshots/redditjs-signup.png)\n\n***\n\n![Logged In](screenshots/redditjs-home-loggedin.png \"logged in\")\n\n***\n\n![Posts](screenshots/redditjs-posts.png)\n\n***\n\n![New Post](screenshots/redditjs-new-post.png)\n\n***\n\n![Filtering](screenshots/redditjs-category-filtering.png \"filter by subreddit category\")\n\n***\n\n![Post](screenshots/redditjs-post.png)\n\n***\n\n### Built With\n\n- bcryptjs\n- cookie-parser\n- express\n- express-handlebars\n- jsonwebtoken\n- mongoose\n- chai\n- mocha\n- bootstrap\n- jquery\n\n## How To Use\n\nTo clone and run this application, you'll need [Git](https://git-scm.com) and [Node.js](https://nodejs.org/en/download/) (which comes with [npm](http://npmjs.com)) installed on your computer. From your command line:\n\n```bash\n# Clone this repository\n$ git clone https://github.com/jdegand/redditjs\n\n# Install dependencies\n$ npm install\n\n# Add .env with MONGO_URI connection string and SECRET KEY\n\n# Run the app\n$ npm start\n```\n\n## Thoughts\n\n- Worked on this November 2021, I got stuck on the nested replies and put it down and forgot about it til July 2022.  \n- I deviated from the instructions at various points and that made this project harder to complete.  \n- I didn't add a controllers file.\n- I used mergeParams to make the nested routes.\n- I didn't create a separate db file - I like to just add it to the `app/index/server.js` file.\n- The final result is sort of held together by duct tape but it matches the functionality of the tutorial's completed result.  \n- Need to refresh to see the score change on the page index page although the score is updated automatically with the jquery.  \n- Could try to use the jquery to update the player score in the page index page.  \n- `lean()` is a critical fix for handlebars rendering issues.\n- Adding the pre's to the schemas fixed nested reply links from missing a postId property.\n- Populating in the routes didn't work as well.  \n- Unsure if the order of lean and populate calls matters i.e. `model.lean().populate('')` vs. `model.populate('').lean()`\n- Converting to async just requires using try and catch blocks. The tutorial makes it seem like a big deal.  \n- The tutorial used bcryptjs, but probably should have used regular bcrypt.\n- Not Found - problem with navbar - didn't reflect logged in status - fixed by passing currentUser variable in error handler\n\n## Continued Development\n\n- Dependencies could be updated further, but Mocha has breaking changes.\n- Bootstrap styling for tablets \u0026 up and down buttons\n- Redditjs and Home in the navbar are redundant.  Home Link could be eliminated.  \n- Nested reply order - works fine when starting from stratch.  Older replies from development didn't display correctly.\n- Add delete functionality.\n- Limit upvotes/downvotes to 1 per user - check array for user id before execution\n- Can't get a console.log to register in the ajax script\n- Middleware to pass currentUser to all routes\n- Doesn't show cookies are blocked until you try to login / signup\n\n## Useful Resources\n\n- [Stack Overflow](https://stackoverflow.com/questions/21396524/what-is-the-difference-between-assert-expect-and-should-in-chai) - assert vs expect\n- [Code For Geek](https://codeforgeek.com/unit-testing-nodejs-application-using-mocha/) - unit testing with mocha\n- [Stack Overflow](https://stackoverflow.com/questions/25260818/rest-with-express-js-nested-router) - nested routes\n- [Stack Overflow](https://stackoverflow.com/questions/24002342/node-js-express-nested-routes) - nested routes\n- [Github](https://gist.github.com/zcaceres/f38b208a492e4dcd45f487638eff716c) - nested routes\n- [YouTube](https://www.youtube.com/watch?v=_TI6iODy4yU) - Pursuit YT Express Video\n- [Stack Overflow](https://stackoverflow.com/questions/35733647/mongoose-instance-save-not-working) - mongoose save not working\n- [JQuery Docs](https://api.jquery.com/jquery.ajax/) - ajax method\n- [FreeCodeCamp](https://www.freecodecamp.org/news/how-to-update-npm-dependencies/) - updating npm dependencies\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdegand%2Fredditjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdegand%2Fredditjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdegand%2Fredditjs/lists"}