Code Monkey home page Code Monkey logo

simplereddit's Introduction

Simple Reddit Client

Simple web app to display top reddit articles for a specific subreddit

Frameworks

The webapp is using Express as the backend server and React as the frontend.

Running locally

To run locally you need to run both the server and frontend. You can do this by running npm start in both the root directory and the client/ directory. The root contains the server and the client/ directory contains the react app.

Overview

The frontend has a simple input for the user to put in a subreddit name. When the user presses submit, this is sent to the Express server by using the following endpoint /api/:subreddit/articles. The server then requests the top 20 posts for that subreddit from Reddit and parses the JSON to only get the most relevant fields. This new JSON object is then returned. Currently this new object includes:

  • subreddit - Subreddit name
  • gold - Number of gold awards
  • silver - Number of silver awards
  • platinum - Number of platinum awards
  • title - Title of post
  • score - Score of post. Shows upvotes - downvotes (roughly)
  • created - When the post was created as a unix timestamp
  • spoiler - If it is marked as a spoiler
  • nsfw - If the post is marked as NSFW/Over 18
  • author - User that created the post
  • num_comments - Number of comments
  • stickied - If the post is stickied by a moderator
  • url - Context dependant URL. Could be image, video, external link or link to the post if it is a selftext post
  • text - Text of post if there is any
  • id - Id of post
  • locked - If the post has been locked by a moderator
  • thumbnail - Small image preview if there is one
  • link - Full permanent link to post

Demo

The webapp is running on Heroku here

simplereddit's People

Contributors

jamalmulla avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.