I started doing a basic experiment with the Reddit API in May 2016. I was initially interested in working with web-based OAuth2 authentication, which I hadn’t done before, so I started hacking away using Flask, PRAW, and SQLAlchemy. There was really no set goal, I just wanted to experiment with extracting data from my account and displaying it on a webpage.
It later dawned on me that if you have had a Reddit account for awhile and have saved a few hundred different items, that there is no readily available tool to extract that and back it up somewhere. I began creating AccountMover.Com, which has evolved into a tool that enables Reddit users to:
- Transfer their subreddit subscriptions to a different account
- Transfer all saved items to a different account
- Export those saved links as an HTML file that can be imported into your browser
For users who are privacy conscious, they also have the option to:
- Delete all their submitted posts
- Delete all their comments
Performing these tasks for a (potentially) large amount of users concurrently, who may or may not have a lot of account data to load, parse, and transmit necessitated some fun choices in software. My tech stack for the website is detailed below.
For the backend, I used:
- Docker to contain, deploy, and network all the components
- Python 2.7 (Why not python 3? I ask myself that all the time and have no answer…)
- Flask, Flask-SQLAlchemy and Gunicorn
- Redis and redis-py for caching, rate limiting, and task queue brokering
- Celery task queue & Flower for monitoring
- PostgreSQL for persistent data storage
The site is hosted on the same DigitalOcean droplet I host my website on.
There were some hiccups in getting the task queues working effectively, especially with adding the Flask app context to Celery, so I could use the SQLAlchemy models inside the Celery tasks. This is also the first time I’ve put something out into the wild using React since I picked it up this summer. I’m definitely looking forward to hearing feedback regarding UX/UI, and any functional problems user have running the tasks. Feel free to let me know!