Code Monkey home page Code Monkey logo

graph-mail-summarizer's Introduction

Hack Together: Microsoft Graph and .NET

Graph Mail Summarizer

Mail Summarizer is a web application that helps you manage your emails more efficiently by generating brief summaries of their contents. Save yourself time by getting a consise and organized overview of all the mails you might have missed while you were away!

Using the application is easy. Simple connect to your email account you want summarized. Select the start and end date to filter a date range and let the app analyze your mailbox. Within a moment you'll receive a summary that captures the key information and main ideas in your inbox.

Untitled.1.mp4

Key Features

The application features a single page application (SPA) that makes a request to a backend api. The api is setup as durable function app that leverages the jwt token retrieved in the request to retrieve your mails using the Azure on-behalf-of authentication flow.

The mails are individually fed to OpenAi to create detailed summaries and a summary of all summeries combined. The result is then converted into a html template that is send as mail to requesters mail address obtained from the jwt token.

How to setup your own environment:

App Registration

  1. Create a new App Registration
  2. Create a Client Secret (used for backend)
  3. Add the delegated permissions Mail.Read and Mail.Send under Graph
  4. Expose the Api using the default url
  5. Create a new scope access_as_user for users and admins
  6. Add the access tokens email and upn (with permissions)
  7. Under Authentication add the endpoint of your static website (after creating it)

Single Page Application

  1. Create a Storage Account in Azure
  2. Add a static website using the index.html as entrypoint
  3. Substitute the settings of .env-cmdrc with your own
  4. Build the web app in .\spa using npm run build
  5. Upload the contents of .\build to the $web container of the Storage Account

Function App

  1. Create a Function App in Azure (for .NET 7)
  2. Publish the app to the function app (possibly with Visual Studio)
  3. Add CORS rule for the endpoint of your static website
  4. In the App Settings add settings for Graph and OpenAi connections (e.g. Graph:TenantId)

graph-mail-summarizer's People

Contributors

dependabot[bot] avatar marcel-paalvast avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.