Giter VIP home page Giter VIP logo

luteceo / aspnet-starter-kit-2.0 Goto Github PK

View Code? Open in Web Editor NEW
70.0 10.0 23.0 370 KB

Cross-platform web development with Visual Studio Code, C#, F#, JavaScript, ASP.NET Core, React (ReactJS), Redux, TypeScript. Single-page application boilerplate.

TypeScript 49.26% CSS 3.46% C# 10.17% JavaScript 32.89% HTML 4.22%
visual-studio-code typescript react-redux asp-net-core kestrel nodejs hmr-support csharp fsharp

aspnet-starter-kit-2.0's Introduction

ASP.NET Core Starter Kit 2.0

This project is a mix of ASP.NET Core Starter Kit and Microsoft ASP.NET Core React/Redux template.

Why ?

I like original ASP.NET Core Starter Kit because it embraces Node.js and allows you to run on top of Kestrel web server but unfortunatelly it wasn't updated to support .NET Core SDK 2.1.

I like Microsoft ASP.NET Core React/Redux template but I don't like how it integrates with Node.js using node commands from inside .csproj file:

    ✓ It is less flexible than npm scripts and also is less familiar to front-end developers
    ✓ Node.js commands are embedded inside the .csproj project file which is great if you are just using Visual Studio to compile .NET Core but is quite annoying if you like to work with npm scripts and CLI.

This projects takes the best parts from ASP.NET Core Starter Kit and ASP.NET Core React/Redux template to create a new template levaraging the full power of Node.js and .NET Core 2.1 SDK with Kestrel as a web server. TypeScript was also added to the mix.

Features

    ✓ Component-based front-end development via Webpack and React (see webpack.config.js)
    ✓ Static type checking with TypeScript
    ✓ Application state management via Redux
    ✓ Universal cross-stack routing and navigation history (see client/routes.tsx)
    ✓ Hot Module Replacement (HMR) /w React Hot Loader
    ✓ Lightweight build automation with plain JavaScript (see run.js)
    ✓ Cross-device testing with Browsersync

Styling

The project is framework agnostic so you can easily add your preferred styling framework.

    Bootstrap 4 components
    Ant design components
    Material UI components

Or extend the loaders in webpack.config.js to compile your own SASS or LESS styles.

Another option instead of css could be to use css-in-js. Your can see a list of frameworks at MicheleBertoli's great repo here. Emotion has worked in a few test projects but feedback on a good library that plays well with typescript are appreciated.

Prerequisites

Getting Started

Step 1. Clone the latest version of ASP.NET Core Starter Kit 2.0 on your local machine by running:

$ git clone -o aspnet-starter-kit -b master --single-branch \
      https://github.com/Luteceo/aspnet-starter-kit-2.0 MyApp
$ cd MyApp

Step 2. Install project dependencies listed in project.json and package.json files:

$ npm install                   # Install both Node.js and .NET Core dependencies

or using Yarn:

$ yarn install                   # Install both Node.js and .NET Core dependencies

Step 3. Finally, launch your web app:

$ node run start                      # Compile and lanch the app, same as running: npm start

The app should become available at http://localhost:5000/. See run.js for other available commands such as node run build etc. You can also run your app in a release (production) mode by running node run --release, or without Hot Module Replacement (HMR) by running node run --no-hmr.

How to Deploy

TODO

How to Update

You can always fetch and merge the latest changes from this (upstream) repo back into your project by running:

$ git checkout master
$ git fetch aspnet-starter-kit-2.0
$ git merge aspnet-starter-kit-2.0/master 

How to Contribute

Anyone and everyone is welcome to contribute. The best way to start is by checking our open issues, submit a new issues or feature request, participate in discussions, upvote or downvote the issues you like or dislike, send pull requests.

Get in Touch

License

Copyright © 2018-present Luteceo. This source code is licensed under the MIT


Made by Tomasz Jaskula @tjaskula

aspnet-starter-kit-2.0's People

Contributors

pizycki avatar psvensso avatar tjaskula avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aspnet-starter-kit-2.0's Issues

Convert to a style framework agnostic approach

As discussed in #24 the template could be more agnostic around the use of styling.
This issue is creted as a proposal for how to approach this.

Background:
Styling can be made with inline styles, css-to-js, classic css frameworks and classes or a whole combination of them all. To be more futureproof the template could be build without opinions but be easily extended instead.

Suggestion:

  • Remove all usage of Bootstrap in the example code and dependency tree.
  • Provide readme for how to add a CSS framework or/or options for styling.

Syntax errors when browsing with some versions of IE11

For some reason I'm getting (two) syntax errors when browsing with some versions of IE11. Browsing with version 11.285.17134.0 crashes whereas with 11.2430.14393.0 is OK. (Chrome is OK all the time). At work I have the same problem (they don't have the most recent IE).

Is there any npm module that needs update, workaround or something to make the starter work with IE?

ie_crash

	// getDefaultExport function for compatibility with non-harmony modules
 	__webpack_require__.n = function(module) {
 		var getter = module && module.__esModule ?
 			function getDefault() { return module['default']; } :
 			function getModuleExports() { return module; };
 		__webpack_require__.d(getter, 'a', getter);
 		return getter;
 	};

NodeInvocationException: Prerendering failed because of error: Error: Cannot find module

I've tried to run it on Windows 10 and got this issue. I'm still investigating more, but maybe someone can give me a clue.
NodeInvocationException: Prerendering failed because of error: Error: Cannot find module '(...) wwwroot\dist\server\main-server'

the main-server.js file is there and seems to be ok.

Microsoft Windows [Version 10.0.17134.523]
Node v11.4.0

Guidance on hosting for production

I recognize that the How to Deploy section is still a todo, so I tried hooking up the build output to a non-managed site in IIS. I always get a 404.13. Can anyone point to guidance on how to hookup this site or any .NET Core site with NodeServices to IIS?

Showing Error when i have Run ..

here is the error

ERROR in [at-loader] ./node_modules/@types/react-dom/node_modules/@types/react/index.d.ts:3040:13
    TS2717: Subsequent property declarations must have the same type.  Property 'view' must be of type 'SVGProps<SVGViewElement>', but here has type 'SVGProps<SVGViewElement>'.

image

Yeoman generator

Reporting an idea I got by email from one of the users:

Yeoman generatorIt would give you a few benefits over the current version:

  • It would be an npm package that could be downloaded and run via the 'yo' command for anyone who uses Yeoman, instead of being cloned directly from Github.

  • Changes and versioning could be handled in a more standard way.

  • Project names would be generated by the user rather than changed manually after cloning the repository.

  • Any guids for the server side will be randomly generated, eliminating potential issues that arise if someone uses multiple versions of your project with the same guid within a Visual Studio solution (for instance, if they copied the server project to act as an API in their DMZ to act as a pass through to an internal API).

Enhance error reporting in CI pipline

In CI pipeline, a failing tasks (ex: build) doesn't make the node.js process exit with non zero code. This is seen as sucessful task in CI pipline which is not.

Debugging server and client with F5?

The tasks.json is pointing to a not existing server.csproj. Wonder if you could update the starter with a launch.json and tasks.json so developer can debug client and server code with VS Code... is this possible as is it right now ? (or alternative instructions)

{
    "version": "2.0.0",
    "tasks": [
        {
            "taskName": "build", 
            "command": "dotnet",
            "type": "process",
            "args": [
                "build",
                "${workspaceFolder}/server.csproj"
            ],
            "problemMatcher": "$msCompile"
        }
    ]
}

styed-components

I've added the styled-components package and get the element (a div for Styled.div) but without the associated style properties. Does this mean I need to add more webpack.config.js jiggering? Any help would be greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.