Solution overview - OfficeDev/microsoft-teams-apps-sustain GitHub Wiki

Solution architecture

The Sustain application has the following main components:

  • WebUI An Azure App Service that hosts the React front-end
  • WebAPI: An Azure App Service that hosts the .NET Web API
  • Database: An Azure SQL DB that stores the challenges, points earned, and carousel cards
  • SharePoint site: (optional) A SharePoint site for hosting news and events that are surfaced on the dashboard of this app

Roles

The app supports the following roles:

  • Admin
    • Has access to all the pages with a privileged access to admin page
    • Can do all the actions that a user can do
    • Can perform add, edit, and delete functionality in admin page
  • User
    • Has access to all the pages aside for the admin page
    • Can only update own record for challenges

API Permissions

The Azure AD App Registration requires the following delegated permissions:

  • Microsoft Graph
    • GroupMember.ReadWrite.All (delegated) - Fetch and update group membership for Azure AD groups.
    • User.Read.All (delegated) - Fetch all user’s profile information
    • People.Read (delegated) - Fetch user’s relevant people lists with profile information.
  • SharePoint
    • Sites.Search.All (delegated) - Running search queries in SharePoint for news and events with audience targeting

API Endpoints

The app uses the following external integration endpoints:

API Endpoint Description Usage in app
Graph /groups/{group-id} Update group membership for specified group Add new user in Yammer group automatically
/me/people Get current user’s relevant/related to people Leaderboard and Challenges to show the names of the people relevant to the current user
/users/{user-id} Get specific user Leaderboard and Dashboard
/users/{user-id}/photo/$value Get specific user’s profile photo Leaderboard and Challenges to show the profile photo of individuals relevant to a user’s account
SharePoint {site-url}/_api/search Perform a search query Query the specified SharePoint site for News and Events