I wrote this prototype because I wanted to explore two things
I was to hoping to achieve some things with this effort
I choose to integrate with the Reddit API because they have a lot of comments in the typical tree structure and generating sample data didn't seem like much fun. I wanted to apply my idea against a real dataset. Reddit did do a nice job with its API. It is fairly straightforward to use. This tricky bit is getting OAuth configured. I opted to do the token exchange manually instead of using a library.
Reddit API
Usage You'll need to configure a .env with a the client_id and secret from https://www.reddit.com/prefs/apps with type 'web app'
Use the values from the application and add them to a new local file at the root the project '.env'. The project will load these values to connect to the reddit API.
REDDIT_AGENT=javascript/svelte graph-comments test (by /u/<YOUR REDDIT USERNAME>)
REDDIT_CLIENT_ID=<extract from Reddit Application>
REDDIT_CLIENT_SECRET=<extract from Reddit Application>
Versions
$ node --version
v12.16.3
$ npm --version
6.14.5
To fun this application yourself you'll need to setup your own account in reddit as an application developer.
Start the app
npm run dev
I'm new to developing in Node.js and I followed some breadcrumbs to attach a debugger:
npm run debug_server