Skip to content

an email robot for tracking receipts and tax documents

License

Notifications You must be signed in to change notification settings

amit-bansil/expensa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expensa

An email robot for tracking receipts and tax documents.

How it works

Once you set this up you'll have a collection of email addresses of the form <category>@<your.domain> that you can send receipts and tax documents to. The subject line of your emails should be of the form <amount>: <description> for receipts and just <description> for tax documents that don't have an amount. <category> can be any arbitrary name that is recognized as an email.

The bot will append rows of the form:

<date>, <sender email>, <category>, (<amount>), <description>, (<link to body>), (link to first attachement...)

to a google spreadsheet.

Setup

Because this is basically just a bunch of glue around external services setup is a bit involved. Here's what you need to do.

  1. Fork the project and check it out on your own machine.

  2. Get Heroku setup on your computer as per the first two steps of: https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction

  3. Create a Heroku app by running the following command in the project dir:

    > heroku apps:create <your.app.name>
    
  4. Set the endpoint secret:

    > heroku config:set ENDPOINT_SECRET=<long random string of lowercase letters>
    
  5. Open a Mailgun account and configure a domain. Don't forget to add DNS records for receiving mail.

  6. Create a catch_all() route that forwards messages to your app: http://<your.app.name>.heroku.com/<ENDPOINT_SECRET>

  7. Give Heroku access to Mailgun by setting the following keys:

    heroku config:set MAILGUN_DOMAIN=<money.your.domain>
    heroku config:set MAILGUN_API_KEY=<YourMailgunAPIKey>
    
  8. Setup google drive api access as per the link below: https://www.npmjs.com/package/google-spreadsheet-append

    Store the following keys that you got while setting up api access in Heroku's environment as follows:

    heroku config:set GDRIVE_EMAIL=<service account email>
    heroku config:set GRDIVE_KEY="`cat </path/to/key/file.pem>`"
    heroku config:set GDRIVE_FILEID=<spreadsheet file id>
    
  9. Create an Amazon S3 bucket in the US Standard region and a user with full access to that bucket. Store the following keys that you got while setting up api access in Heroku's environment as follows:

    heroku config:set S3_ACCESS_KEY=<aws iam user access key>
    heroku config:set S3_SECRET_KEY=<aws iam user secret api key>
    heroku config:set S3_BUCKET=<bucket.name>
    

About

an email robot for tracking receipts and tax documents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published