/adieu

Primary LanguageJavaScript

Adieu

Running locally

You will need a Google API app registered first

  1. Head over to https://console.cloud.google.com/apis/credentials
  2. Create a New Project called 'Adieu'
  3. Enable the Gmail API inside the "Library".
  4. Create new Credentials. Create credentials > OAuth client ID. Choose Web application application type.
  5. Set the callback URLs to be http://localhost:3000
  6. On the Consent screen, add your email address to the "Trusted Users" section
  7. Once you have the Client id and secret, make sure they work at https://developers.google.com/oauthplayground/

You have to run three things locally:

  • React
  • Lambda
  • DynamoDB

I usually run these in three different terminals.

To run React:

cd front && npm install && npm start

To run DynamoDB (this stores the Gmail OAuth tokens):

docker run -p 8000:8000 amazon/dynamodb-local  -jar DynamoDBLocal.jar -sharedDb

Then create the Sessions tables in Dynamo using:

 aws dynamodb create-table \
        --table-name sessions \
        --attribute-definitions AttributeName=sessionId,AttributeType=S \
        --key-schema AttributeName=sessionId,KeyType=HASH \
        --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \
        --endpoint-url http://localhost:8000

Finally, edit the run.sh script to include your Google CLIENT_ID and CLIENT_SECRET.

Now you can run the Lambda (via Express) with:

./run.sh

Use the app by going to http://localhost:3000

Top things

Nice things

  • Add icons for common services (github, linkedin, google etc)
  • Block spy trackers using ublock origin lists
  • Search functionality (messages)
  • Search functionality (contacts)
  • Handle ics - which is a mime part, see email from Dan Webb
  • Add pastebin
  • Create fancy cards for trips
  • spruce up emails, if style is missing add it (like Kent Dodds pre section)

Probably never

  • use WebSockets to look for new mail
  • Tell google to ping when there is a new message
  • send emails
  • Snoozing emails
  • Mark things as 'done'

Docs

Inbox:

Secrets for SSM

Create an API account at https://console.cloud.google.com/apis/credentials. Store the creds in AWS Systems Manager.

aws ssm put-parameter --cli-input-json '{
  "Name": "/adieu/client-id",
  "Value": "SOME ID",
  "Type": "String"
}'

aws ssm put-parameter --cli-input-json '{
  "Name": "/adieu/client-secret",
  "Value": "SOME SECRET",
  "Type": "String"
}'

aws ssm put-parameter --cli-input-json '{
  "Name": "/adieu/client-redirect-url",
  "Value": "https://adieu.joejag.com/api/callback",
  "Type": "String"
}'

aws ssm put-parameter --cli-input-json '{
  "Name": "/adieu/url",
  "Value": "https://adieu.joejag.com",
  "Type": "String"
}'

Interesting emails

  • 17926f1e1459b897 (multipart/mixed) with PDF
  • 17947ef1f5f89b69 body missing
  • 1793b9c747dac319 body missing
  • 1793d9aa4d62a079 not being shown properly
  • 1795bc65ceba377a body being truncated