Skip to content

Commit 0a6b0cf

Browse files
committed
Added README and completed project instructions
1 parent 9787311 commit 0a6b0cf

File tree

2 files changed

+90
-2
lines changed

2 files changed

+90
-2
lines changed

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
1-
# msgraph-training-reactspa
2-
Microsoft Graph Training Module - Build React single-page apps with Microsoft Graph
1+
# Microsoft Graph Training Module - Build React single-page apps with Microsoft Graph
2+
3+
This module will introduce you to working with the Microsoft Graph in creating a React single-page application to access data in Office 365.
4+
5+
## Lab - React single-page apps with the Microsoft Graph
6+
7+
In this lab you will create a React single-page application, configured with Azure Active Directory (Azure AD) for authentication & authorization, that accesses data in Office 365 using the Microsoft Graph.
8+
9+
- [React Microsoft Graph tutorial](https://docs.microsoft.com/graph/training/react-tutorial)
10+
11+
## Demos
12+
13+
The [Demos](./Demos) directory in this repository contains copies of the project that correspond to completing individual sections of the tutorial. If you just want to demo a particular section of the tutorial, you can start with the version from the previous section.
14+
15+
- [01-create-app](Demos/01-create-app): Completed [Create a React single-page app](https://docs.microsoft.com/graph/training/react-tutorial?tutorial-step=1)
16+
- [02-add-aad-auth](Demos/02-add-aad-auth): Completed [Add Azure AD authentication](https://docs.microsoft.com/graph/training/react-tutorial?tutorial-step=3)
17+
- [03-add-msgraph](Demos/03-add-msgraph): Completed [Get calendar data](https://docs.microsoft.com/graph/training/react-tutorial?tutorial-step=4)
18+
19+
## Completed sample
20+
21+
If you just want the completed sample generated by following this lab, you can find it here.
22+
23+
- [Completed project](Demos/03-add-msgraph)
24+
25+
## Disclaimer
26+
27+
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

demos/03-add-msgraph/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# How to run the completed project
2+
3+
## Prerequisites
4+
5+
To run the completed project in this folder, you need the following:
6+
7+
- [Visual Studio](https://visualstudio.microsoft.com/vs/) installed on your development machine. If you do not have Visual Studio, visit the previous link for download options. (**Note:** This tutorial was written with Visual Studio 2017 version 15.81. The steps in this guide may work with other versions, but that has not been tested.)
8+
- Either a personal Microsoft account with a mailbox on Outlook.com, or a Microsoft work or school account.
9+
10+
If you don't have a Microsoft account, there are a couple of options to get a free account:
11+
12+
- You can [sign up for a new personal Microsoft account](https://signup.live.com/signup?wa=wsignin1.0&rpsnv=12&ct=1454618383&rver=6.4.6456.0&wp=MBI_SSL_SHARED&wreply=https://mail.live.com/default.aspx&id=64855&cbcxt=mai&bk=1454618383&uiflavor=web&uaid=b213a65b4fdc484382b6622b3ecaa547&mkt=E-US&lc=1033&lic=1).
13+
- You can [sign up for the Office 365 Developer Program](https://developer.microsoft.com/office/dev-program) to get a free Office 365 subscription.
14+
15+
## Register a web application with the Application Registration Portal
16+
17+
1. Open a browser and navigate to the [Application Registration Portal](https://apps.dev.microsoft.com). Login using a **personal account** (aka: Microsoft Account) or **Work or School Account**.
18+
19+
1. Select **Add an app** at the top of the page.
20+
21+
> **Note:** If you see more than one **Add an app** button on the page, select the one that corresponds to the **Converged apps** list.
22+
23+
1. On the **Register your application** page, set the **Application Name** to **React Graph Tutorial** and select **Create**.
24+
25+
![Screenshot of creating a new app in the App Registration Portal website](/tutorial/images/arp-create-app-01.png)
26+
27+
1. On the **React Graph Tutorial Registration** page, under the **Properties** section, copy the **Application Id** as you will need it later.
28+
29+
![Screenshot of newly created application's ID](/tutorial/images/arp-create-app-02.png)
30+
31+
1. Scroll down to the **Platforms** section.
32+
33+
1. Select **Add Platform**.
34+
1. In the **Add Platform** dialog, select **Web**.
35+
36+
![Screenshot creating a platform for the app](/tutorial/images/arp-create-app-03.png)
37+
38+
1. In the **Web** platform box, enter `http://localhost:3000` for the **Redirect URLs**.
39+
40+
![Screenshot of the newly added Web platform for the application](/tutorial/images/arp-create-app-04.png)
41+
42+
1. Scroll to the bottom of the page and select **Save**.
43+
44+
## Configure the sample
45+
46+
1. Rename the `./graph-tutorial/src/Config.js.example` file to `./graph-tutorial/src/Config.js`.
47+
1. Edit the `./graph-tutorial/src/Config.js` file and make the following changes.
48+
1. Replace `YOUR_APP_ID_HERE` with the **Application Id** you got from the App Registration Portal.
49+
1. In your command-line interface (CLI), navigate to the `graph-tutorial` directory and run the following command to install requirements.
50+
51+
```Shell
52+
npm install
53+
```
54+
55+
## Run the sample
56+
57+
1. Run the following command in your CLI to start the application.
58+
59+
```Shell
60+
npm start
61+
```
62+
63+
1. Open a browser and browse to `http://localhost:3000`.

0 commit comments

Comments
 (0)