3 ms·
do you mind explaining your stack / tech a bit? would love to whip up something similar for a pet project
by lambo2991 5y ago
do you mind explaining your stack / tech a bit? would love to whip up something similar for a pet project
- bambax 5y agoSorry for the late answer. The db (sqlite) has four tables: users tasks prompts items Users have an email address and own tasks. Tasks are metadata, mainly the frequency (in days) and the time of day when the prompt should be sent. Prompts are a log: each time the system sends a prompt about a task it is logged in the prompts table. And items are entries for tasks: users replies to prompts. Every x minutes a python script (cron) scans the db to see if a prompt needs to be sent about a task: for each task, when should the prompt be sent, and when was the last prompt sent? Emails are handled via Mailgun which is used to send prompts and process replies. When a reply is sent, Mailgun creates a POST request to the system with the body of the email. Each prompt has a unique ID that is present in the respond-to email, so that replies are correctly attached to a prompt (and therefore to a prompt date and a task); it also allows to reply late: each reply is linked to the prompt it replies to, not to the most recent one. It's also possible to send multiple replies to a single prompt. Web interface for receiving posts from Mailgun and seeing the entries is coded in PHP, but it's extremely light. There is no functionality for updating entries, creating users, etc.: this is done via phpliteadministrator (very useful) or sometimes directly via SQL. There are also triggers in the db to do integrity checks when inserting or updating.