Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['react', 'prettier'],
plugins: ['react', 'react-hooks', 'prettier'],
rules: {
'prettier/prettier': 'error',
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
Expand All @@ -32,6 +32,13 @@ module.exports = {
'react/no-array-index-key': 0,
'jsx-a11y/no-static-element-interactions': 0,
'jsx-a11y/click-events-have-key-events': 0,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': [
'warn',
{
additionalHooks: 'useRecoilCallback',
},
],
},
settings: {
'import/resolver': {
Expand Down
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ EmailAPI enables powerful actions on top of your Gmail account with features lik
- Receive a copy of unlocked PDFs
- Aggregate similar data (e.g. several credit card bills) from several senders into an endpoint.


## Apps
---
EmaiAPI is written with a plugin based architecture that comes with bare bones readonly connectivity to Gmail APIs. It comes with the following apps out of the box:

**1. Email to JSON**

This app allows easy scraping of content inside email messages. Data points get extracted into a JSON endpoint and can then pushed to any database service via webhooks. It supports automatic sync to a [jsonbox](jsonbox) endpoint out of the box.

[Watch an interactive video of how this works.](Record_an_interactive_mmhmm_video)

**2. Attachment Unlocker**

This app unlocks PDF attachments from your past emails as well as from emails that are yet to come. Enter the PDF password once and forget about ever having to unlock PDF attachments again.


## How to run locally

Fork this repo and then clone it:
Expand All @@ -20,14 +36,45 @@ git clone https://github.com/<your_name>/emailapi.git
yarn
```

### Environment Variables

Create a file named `.env.local` and supply the following environment variables
```
FIREBASE_AUTH_DOMAIN=
FIREBASE_DATABASE_URL=
FIREBASE_CLIENT_EMAIL=
FIREBASE_PROJECT_ID=
FIREBASE_PUBLIC_API_KEY=
SESSION_SECRET_CURRENT=
SESSION_SECRET_PREVIOUS=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_OAUTH_REDIRECT_URI=http://localhost:3000
EMAILAPI_DOMAIN=https://jsonbox.io
EMAILAPI_BASE_URL=https://jsonbox.io/<boxid>
MAILGUN_API_KEY=
MAILGUN_DOMAIN=m.emailapi.io
MAILGUN_SENDING_EMAIL_ID=notifications@m.emailapi.io
REDISCLOUD_URL=rediss://username:password@hostname:port
```

Then just run

```
yarn dev
```

to start the development server on port `3000`. Your jsonbox instance will be running on `http://localhost:3000`. Alternatively you can run the application using docker with `docker-compose up`.
to start the development server on port `3000`. Your emailapi instance will be running on `http://localhost:3000`.

### LICENSE

MIT

Yet todo to complete the README:
- dockerize jsonbox
- enable IP whitelisting to hosted instance of jsonbox (open a PR)
- See if you can simplify the process of installing "emailapi" on a VM like DO
- nginx with certbot
- 2 docker images - `emailapi_app` and `jsonbox`
- Put up funding info and setup service to accept payments
- See if you'd like to offer hosted service in exchange for monthly committment??! (Too big an undertaking though)
6 changes: 6 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@
- Remove `done` based callbacks from queue and move to Promise.resolve()s
- Enable job success/failure notification system
- Include all queues from filesystem instead of `require`ing them individually


### UI Plugin system
- Allow for email preview and config output bar to be an "app"
- the app receives the json props of email clicked in left sidebar
- it also receives some callbacks that allow for setting props (like selection state of email cards) or causing fetch/refresh in left sidebar
Loading