I was recently working on a TypeScript project with React that uses WebPack 2 and Gulp for it’s build process.
I thought it would be worth creating a GitHub repository that stores this boilerplate code so that anyone can download the code and get started creating web apps with this particular technology stack.
The source comes with TypeScript, Less, Bootstrap all wired up with React and some base example components to get your started. It also sets up webpack-dev-server so you can easily spin up a local dev server to host your web app while in development.
To get started just run the following to get the code from the repository.
git clone https://github.com/leedale1981/typescript2-react15-webpack2-boilerplate.git
You should then run an NPM install to download all dependencies.
Finally you can compile the TypeScript code and run the dev server like so:
And thats it you should be up and running with your web app.
Inevitably you will want to secure your web service layer at some point and if your are building on the Azure platform, then Azure AD is a great OAuth solution.
It is especially a good solution if you are building SharePoint Add-Ins in Office 365. When you are logged into your Office 365 SharePoint site you have already authenticated against your Azure AD and as long as you deploy your applications to the same Azure AD instance then you get automatically authenticated when accessing your Web API layer.
The general architecture looks like this.
The first video is up and it shows how to create a SQL Azure database, create a Web API layer and how to model and scaffold the data using Entity Framework.