PinotageTodo — Basic architecture and tools
Published in
2 min readDec 7, 2017
This is part of a series of articles comparing the experience of developing, deploying and maintaining an ASP.NET Core 2.0 web app on the PaaS offerings from Azure, AWS and Google Cloud Platform. You can find the introduction and contents here .
Articles in this series
- Introduction
- Introducing the PinotageToDo App (this article)
- Building an ASP.NET Core Web App in Visual Studio Team Services
- Hosting an ASP.NET Core Web App in an Azure App Service
Stack overview
We’ve touched on this briefly in the first article, but I am using the following.
- A single page webapp on the client (this is incidental to what we are exploring, but it is built on TodoMVC’s JQuery sample with Director and Handlebars.
- ASP.NET Core 2.0 MVC on the server.
- EF Core In Memory Database (for now…we will add actual persistence on each platform in later posts).
- XUnit and Moq for server side unit testing.
- Although I have made the code available on Github, for development, build and deployment I am using Visual Studio Team Services (VSTS).
- I’m developing on my Mac, using both Visual Studio for Mac and Jetbrains Rider (and preferring the latter to be honest).
The app
The entire app (web, API and repository) is contained in a single ASP.NET Core 2.0 MVC project.
The project structure is fairly vanilla ASP.NET Core 2.0 MVC. The main points to note are that:
- Both “web” and “API” controllers are contained within the Controllers folder of the project;
- The Models folder contains view and API models (i.e. representations of objects that are returned from controller actions;
- The Home/Index.cshtml view is the full HTML page for the app and doesn’t use ViewImports or ViewStart;
- We will add proper authentication and account management at a later date. For now, the AccountController simply provides a method to create an auth cookie for any request that doesn’t have the cookie already. All we are trying to achieve is for each user of the app to only see their own todos.
- The persistence layer is defined within the Data folder. We have a simple ITodoRepository interface. At the moment we only have the 1 implementation of the interface using Entity Framework (and in Startup.cs we setup to only use the in memory database). As we explore each platform we will add new implementations of this interface.