Welcome to the source code repository of /u/MemeInvestor_bot. This bot has been developed exclusively for /r/MemeEconomy. It allows users to create investment accounts with fictional MemeCoins, invest those MemeCoins in specific memes, and automatically evaluate meme performance resulting in positive or negative returns.
We welcome contributions from the public! If you'd like to help improve the bot, please fork our project and feel free to tackle any Issues. We also welcome feedback in the form of new issues, so feel free to create new ones for discussion.
The bot is implemented as a set of loosely-connected microservices written in Python and deployed with Docker. Each component handles a single job, such as:
- Monitoring /r/MemeEconomy for new meme submissions
- Monitoring /r/MemeEconomy for new commands to the bot
- Running the database of investor and investment data
- Monitoring the database for matured investments
- Serving the website
- Serving the REST API that provides data to the website
The following instructions will get a copy of the project up and running on your local machine for development and testing purposes.
In order to run the bot, you'll need to install Docker. You may also need to generate Reddit API credentials for the bot (see below).
After installing the prerequisites and cloning the project, you'll need to configure
the bot. To do so, copy the .env.example
flie to .env
and open it in the editor
of your choice:
git clone https://github.com/MemeInvestor/memeinvestor_bot.git
cd memeinvestor_bot
cp .env.example .env
nano .env
Follow the instructions in .env
to configure your test deployment. The instructions
include steps for generating Reddit bot credentials, which are necessary for clients
to fully access the Reddit API.
Once you've finished, save .env
and exit. You're now ready to deploy the bot locally.
From the root of the project directory, use docker-compose build
to build all the
microservices described above. Then use docker-compose up -d
to launch them. This
will spawn an empty investors database, spin up agents to monitor Reddit, and begin
serving the informational website.
You should be able to view the website at http://localhost:2015. By default the stats will be
boring (no investors and no investments) but you can interact with your test bot on Reddit to
populate the database. Alternatively you can manually set up investor accounts by modifying the
database with Python or a database manager like adminer
.
- praw, a Python package that allows for simple access to Reddit's API.
- fastnumbers, super-fast and clean conversions to numbers.
- Flask, a microframework for Python based on Werkzeug, Jinja 2 and good intentions.
- gunicorn, a Python WSGI HTTP Server for UNIX.
- mysqlclient, a MySQL database connector for Python (with Python 3 support).
- SQLAlchemy, a Python SQL toolkit and Object Relational Mapper.
- Sagindyk Urazayev - Core developer. Initial work & SQLite - thecsw
- Dimitris Zervas - Main back-end developer. MySQL, Docker, API and overall support - dzervas
- jimbobur - Our maths guy. Can make really pretty graphs - jimbobur
- Alberto Ventafridda - Main front-end and web developer - robalb
- rickles42 - Back-end and infrastructure developer - rickles42
- TwinProduction - Heavy outside contributor - TwinProduction
- ggppjj - Minor fixes - ggppjj
This project is licensed under the The GNU General Public License (see the LICENSE file for details), it explains everything pretty well.