diff --git a/templates/WebApplicationBasic/.bowerrc b/templates/WebApplicationBasic/.bowerrc new file mode 100755 index 0000000..78d4e9d --- /dev/null +++ b/templates/WebApplicationBasic/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "wwwroot/lib" +} diff --git a/templates/WebApplicationBasic/.gitignore b/templates/WebApplicationBasic/.gitignore new file mode 100644 index 0000000..0ca27f0 --- /dev/null +++ b/templates/WebApplicationBasic/.gitignore @@ -0,0 +1,234 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ diff --git a/templates/WebApplicationBasic/Controllers/HomeController.cs b/templates/WebApplicationBasic/Controllers/HomeController.cs new file mode 100755 index 0000000..0d94c65 --- /dev/null +++ b/templates/WebApplicationBasic/Controllers/HomeController.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNet.Mvc; + +namespace WebApplicationBasic.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(); + } + + public IActionResult About() + { + ViewData["Message"] = "Your application description page."; + + return View(); + } + + public IActionResult Contact() + { + ViewData["Message"] = "Your contact page."; + + return View(); + } + + public IActionResult Error() + { + return View(); + } + } +} diff --git a/templates/WebApplicationBasic/Dockerfile b/templates/WebApplicationBasic/Dockerfile new file mode 100644 index 0000000..63d7c45 --- /dev/null +++ b/templates/WebApplicationBasic/Dockerfile @@ -0,0 +1,11 @@ +FROM microsoft/aspnet:1.0.0-rc1-update1 + +RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list +RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/* + +COPY . /app +WORKDIR /app +RUN ["dnu", "restore"] + +EXPOSE 5000/tcp +ENTRYPOINT ["dnx", "-p", "project.json", "web"] diff --git a/templates/WebApplicationBasic/README.md b/templates/WebApplicationBasic/README.md new file mode 100644 index 0000000..4e494c9 --- /dev/null +++ b/templates/WebApplicationBasic/README.md @@ -0,0 +1,40 @@ +# Welcome to ASP.NET 5 + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +## This application consists of: + +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side libraries +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +## How to + +* [Add a Controller and View](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add an appsetting in config and access it in app.](http://go.microsoft.com/fwlink/?LinkID=699562) +* [Manage User Secrets using Secret Manager.](http://go.microsoft.com/fwlink/?LinkId=699315) +* [Use logging to log a message.](http://go.microsoft.com/fwlink/?LinkId=699316) +* [Add packages using NuGet.](http://go.microsoft.com/fwlink/?LinkId=699317) +* [Add client packages using Bower.](http://go.microsoft.com/fwlink/?LinkId=699318) +* [Target development, staging or production environment.](http://go.microsoft.com/fwlink/?LinkId=699319) + +## Overview + +* [Conceptual overview of what is ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Fundamentals of ASP.NET 5 such as Startup and middleware.](http://go.microsoft.com/fwlink/?LinkId=699320) +* [Working with Data](http://go.microsoft.com/fwlink/?LinkId=398602) +* [Security](http://go.microsoft.com/fwlink/?LinkId=398603) +* [Client side development](http://go.microsoft.com/fwlink/?LinkID=699321) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=699322) +* [Read more on the documentation site](http://go.microsoft.com/fwlink/?LinkID=699323) + +## Run & Deploy + +* [Run your app](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on .NET Core](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your project.json](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Apps](http://go.microsoft.com/fwlink/?LinkID=398609) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/templates/WebApplicationBasic/Startup.cs b/templates/WebApplicationBasic/Startup.cs new file mode 100755 index 0000000..fcdadf5 --- /dev/null +++ b/templates/WebApplicationBasic/Startup.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace WebApplicationBasic +{ + public class Startup + { + public Startup(IHostingEnvironment env) + { + // Set up configuration sources. + var builder = new ConfigurationBuilder() + .AddJsonFile("appsettings.json") + .AddEnvironmentVariables(); + Configuration = builder.Build(); + } + + public IConfigurationRoot Configuration { get; set; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services.AddMvc(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + loggerFactory.AddConsole(Configuration.GetSection("Logging")); + loggerFactory.AddDebug(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseExceptionHandler("/Home/Error"); + } + + app.UseIISPlatformHandler(); + + app.UseStaticFiles(); + + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller=Home}/{action=Index}/{id?}"); + }); + } + + // Entry point for the application. + public static void Main(string[] args) => Microsoft.AspNet.Hosting.WebApplication.Run(args); + } +} diff --git a/templates/WebApplicationBasic/Views/Home/About.cshtml b/templates/WebApplicationBasic/Views/Home/About.cshtml new file mode 100755 index 0000000..74e97d9 --- /dev/null +++ b/templates/WebApplicationBasic/Views/Home/About.cshtml @@ -0,0 +1,7 @@ +@{ + ViewData["Title"] = "About"; +} +

@ViewData["Title"].

+

@ViewData["Message"]

+ +

Use this area to provide additional information.

diff --git a/templates/WebApplicationBasic/Views/Home/Contact.cshtml b/templates/WebApplicationBasic/Views/Home/Contact.cshtml new file mode 100755 index 0000000..cddb37e --- /dev/null +++ b/templates/WebApplicationBasic/Views/Home/Contact.cshtml @@ -0,0 +1,17 @@ +@{ + ViewData["Title"] = "Contact"; +} +

@ViewData["Title"].

+

@ViewData["Message"]

+ +
+ One Microsoft Way
+ Redmond, WA 98052-6399
+ P: + 425.555.0100 +
+ +
+ Support: Support@example.com
+ Marketing: Marketing@example.com +
diff --git a/templates/WebApplicationBasic/Views/Home/Index.cshtml b/templates/WebApplicationBasic/Views/Home/Index.cshtml new file mode 100755 index 0000000..7528409 --- /dev/null +++ b/templates/WebApplicationBasic/Views/Home/Index.cshtml @@ -0,0 +1,110 @@ +@{ + ViewData["Title"] = "Home Page"; +} + + + +
+
+

Application uses

+
    +
  • Sample pages using ASP.NET MVC 6
  • +
  • Gulp and Bower for managing client-side libraries
  • +
  • Theming using Bootstrap
  • +
+
+ + + +
diff --git a/templates/WebApplicationBasic/Views/Shared/Error.cshtml b/templates/WebApplicationBasic/Views/Shared/Error.cshtml new file mode 100755 index 0000000..a288cb0 --- /dev/null +++ b/templates/WebApplicationBasic/Views/Shared/Error.cshtml @@ -0,0 +1,6 @@ +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

diff --git a/templates/WebApplicationBasic/Views/Shared/_Layout.cshtml b/templates/WebApplicationBasic/Views/Shared/_Layout.cshtml new file mode 100755 index 0000000..7b51d44 --- /dev/null +++ b/templates/WebApplicationBasic/Views/Shared/_Layout.cshtml @@ -0,0 +1,67 @@ + + + + + + @ViewData["Title"] - WebApplicationBasic + + + + + + + + + + + + +
+ @RenderBody() +
+
+

© 2016 - WebApplicationBasic

+
+
+ + + + + + + + + + + + + @RenderSection("scripts", required: false) + + diff --git a/templates/WebApplicationBasic/Views/_ViewImports.cshtml b/templates/WebApplicationBasic/Views/_ViewImports.cshtml new file mode 100755 index 0000000..7252adc --- /dev/null +++ b/templates/WebApplicationBasic/Views/_ViewImports.cshtml @@ -0,0 +1,2 @@ +@using WebApplicationBasic +@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers" diff --git a/templates/WebApplicationBasic/Views/_ViewStart.cshtml b/templates/WebApplicationBasic/Views/_ViewStart.cshtml new file mode 100755 index 0000000..66b5da2 --- /dev/null +++ b/templates/WebApplicationBasic/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/templates/WebApplicationBasic/appsettings.json b/templates/WebApplicationBasic/appsettings.json new file mode 100755 index 0000000..e5472e5 --- /dev/null +++ b/templates/WebApplicationBasic/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Verbose", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/templates/WebApplicationBasic/bower.json b/templates/WebApplicationBasic/bower.json new file mode 100755 index 0000000..329a18e --- /dev/null +++ b/templates/WebApplicationBasic/bower.json @@ -0,0 +1,10 @@ +{ + "name": "WebApplicationBasic", + "private": true, + "dependencies": { + "bootstrap": "3.3.5", + "jquery": "2.1.4", + "jquery-validation": "1.14.0", + "jquery-validation-unobtrusive": "3.2.4" + } +} diff --git a/templates/WebApplicationBasic/gulpfile.js b/templates/WebApplicationBasic/gulpfile.js new file mode 100755 index 0000000..a62a0d5 --- /dev/null +++ b/templates/WebApplicationBasic/gulpfile.js @@ -0,0 +1,47 @@ +/// +"use strict"; + +var gulp = require("gulp"), + rimraf = require("rimraf"), + concat = require("gulp-concat"), + cssmin = require("gulp-cssmin"), + uglify = require("gulp-uglify"); + +var webroot = "./wwwroot/"; + +var paths = { + js: webroot + "js/**/*.js", + minJs: webroot + "js/**/*.min.js", + css: webroot + "css/**/*.css", + minCss: webroot + "css/**/*.min.css", + concatJsDest: webroot + "js/site.min.js", + concatCssDest: webroot + "css/site.min.css" +}; + +gulp.task("clean:js", function (cb) { + rimraf(paths.concatJsDest, cb); +}); + +gulp.task("clean:css", function (cb) { + rimraf(paths.concatCssDest, cb); +}); + +gulp.task("clean", ["clean:js", "clean:css"]); + +gulp.task("min:js", function () { + return gulp.src([paths.js, "!" + paths.minJs], { + base: "." + }) + .pipe(concat(paths.concatJsDest)) + .pipe(uglify()) + .pipe(gulp.dest(".")); +}); + +gulp.task("min:css", function () { + return gulp.src([paths.css, "!" + paths.minCss]) + .pipe(concat(paths.concatCssDest)) + .pipe(cssmin()) + .pipe(gulp.dest(".")); +}); + +gulp.task("min", ["min:js", "min:css"]); diff --git a/templates/WebApplicationBasic/package.json b/templates/WebApplicationBasic/package.json new file mode 100755 index 0000000..a2ebd7c --- /dev/null +++ b/templates/WebApplicationBasic/package.json @@ -0,0 +1,11 @@ +{ + "name": "WebApplicationBasic", + "version": "0.0.0", + "devDependencies": { + "gulp": "^3.9.0", + "gulp-concat": "2.5.2", + "gulp-cssmin": "0.1.7", + "gulp-uglify": "1.2.0", + "rimraf": "2.2.8" + } +} diff --git a/templates/WebApplicationBasic/project.json b/templates/WebApplicationBasic/project.json new file mode 100755 index 0000000..d08af99 --- /dev/null +++ b/templates/WebApplicationBasic/project.json @@ -0,0 +1,54 @@ +{ + "version": "1.0.0-*", + "compilationOptions": { + "emitEntryPoint": true + }, + "tooling": { + "defaultNamespace": "WebApplicationBasic" + }, + + "dependencies": { + "Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final", + "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", + "Microsoft.AspNet.Mvc": "6.0.0-rc1-final", + "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final", + "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", + "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final", + "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final", + "Microsoft.Extensions.Configuration.FileProviderExtensions" : "1.0.0-rc1-final", + "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final", + "Microsoft.Extensions.Logging": "1.0.0-rc1-final", + "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final", + "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final" + }, + + "commands": { + "web": "Microsoft.AspNet.Server.Kestrel" + }, + + "frameworks": { + "dnx451": {}, + "dnxcore50": {} + }, + + "exclude": [ + "wwwroot", + "node_modules", + "bower_components" + ], + "publishExclude": [ + "node_modules", + "bower_components", + "**.xproj", + "**.user", + "**.vspscc" + ], + "scripts": { + "prepublish": [ + "npm install", + "bower install", + "gulp clean", + "gulp min" + ] + } +} diff --git a/templates/WebApplicationBasic/wwwroot/css/site.css b/templates/WebApplicationBasic/wwwroot/css/site.css new file mode 100755 index 0000000..af0456d --- /dev/null +++ b/templates/WebApplicationBasic/wwwroot/css/site.css @@ -0,0 +1,24 @@ +body { + padding-top: 50px; + padding-bottom: 20px; +} + +/* Wrapping element */ +/* Set some basic padding to keep content from hitting the edges */ +.body-content { + padding-left: 15px; + padding-right: 15px; +} + +/* Set widths on the form inputs since otherwise they're 100% wide */ +input, +select, +textarea { + max-width: 280px; +} + +/* Carousel */ +.carousel-caption p { + font-size: 20px; + line-height: 1.4; +} diff --git a/templates/WebApplicationBasic/wwwroot/css/site.min.css b/templates/WebApplicationBasic/wwwroot/css/site.min.css new file mode 100644 index 0000000..1547cbc --- /dev/null +++ b/templates/WebApplicationBasic/wwwroot/css/site.min.css @@ -0,0 +1 @@ +body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4} diff --git a/templates/WebApplicationBasic/wwwroot/favicon.ico b/templates/WebApplicationBasic/wwwroot/favicon.ico new file mode 100755 index 0000000..a3a7999 Binary files /dev/null and b/templates/WebApplicationBasic/wwwroot/favicon.ico differ diff --git a/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-01.png b/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-01.png new file mode 100755 index 0000000..ad3c267 Binary files /dev/null and b/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-01.png differ diff --git a/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-02.png b/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-02.png new file mode 100755 index 0000000..16c37fc Binary files /dev/null and b/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-02.png differ diff --git a/templates/WebApplicationBasic/wwwroot/images/Banner-01-Azure.png b/templates/WebApplicationBasic/wwwroot/images/Banner-01-Azure.png new file mode 100755 index 0000000..59fb923 Binary files /dev/null and b/templates/WebApplicationBasic/wwwroot/images/Banner-01-Azure.png differ diff --git a/templates/WebApplicationBasic/wwwroot/images/Banner-02-VS.png b/templates/WebApplicationBasic/wwwroot/images/Banner-02-VS.png new file mode 100755 index 0000000..c9f4611 Binary files /dev/null and b/templates/WebApplicationBasic/wwwroot/images/Banner-02-VS.png differ diff --git a/templates/WebApplicationBasic/wwwroot/js/site.js b/templates/WebApplicationBasic/wwwroot/js/site.js new file mode 100755 index 0000000..e069226 --- /dev/null +++ b/templates/WebApplicationBasic/wwwroot/js/site.js @@ -0,0 +1 @@ +// Write your Javascript code. diff --git a/templates/WebApplicationBasic/wwwroot/js/site.min.js b/templates/WebApplicationBasic/wwwroot/js/site.min.js new file mode 100644 index 0000000..e69de29 diff --git a/templates/WebApplicationBasic/wwwroot/web.config b/templates/WebApplicationBasic/wwwroot/web.config new file mode 100644 index 0000000..db6e6f4 --- /dev/null +++ b/templates/WebApplicationBasic/wwwroot/web.config @@ -0,0 +1,9 @@ + + + + + + + + +