Giter Club home page Giter Club logo

aspnetcorespa's Introduction

Build status Join the chat at https://gitter.im/asadsahi-AspNetCoreSpa/Lobby MIT license

Features

NOTE: (This is the new Angular cli based branch where ClientApp is completely managed by Angular cli. If you are interested in previous cli branch where integration of Angular cli was minimal (only for code generation), then switch to angular-non-cli branch)

Pre-requisites

  1. .Net core sdk
  2. Either VSCode with C# extension OR Visual studio 2017
  3. Nodejs

**Make sure you have Node version >= latest LTS and NPM >= latest LTS

Installation

1. Clone the repo
    git clone https://github.com/asadsahi/AspNetCoreSpa
2. Change directory
    cd AspNetCoreSpa
3. dotnet restore
4. Install global dependencies
    npm install protractor rimraf http-server @angular/cli -g
5. cd ClientApp
6. npm install OR yarn
7. Run 
    i) Open terminal and run `npm start`
    ii) F5 from either [VScode] (https://code.visualstudio.com/) or [Visual Studio IDE](https://www.visualstudio.com/):

8. Point to Sqllite or SqlServer
    
This project supports both sql server and sql lite databases

* Run with Sqlite:
    * Project is configured to run with sqlite by default and there is an 'Initial' migration already added (see Migrations folder)
    * After changing you models, you can add additional migrations 
    [see docs](https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet)

* Run with SqlServer:
    * To run under sql server:
        * npm run clean
        * Delete `Migrations` folder
        * Flip the switch in appsettings.json called `useSqLite` to `false`, this should point to use local sql server setup as default instance. (See appsettings.json file for connection string)
        * Run `dotnet ef migrations add "InitialMigrationName"`

Other commands

Scaffold Angular components using Angular CLI

Scaffold Usage
Component ng g component my-new-component
Directive ng g directive my-new-directive
Pipe ng g pipe my-new-pipe
Service ng g service my-new-service
Class ng g class my-new-class
Guard ng g guard my-new-guard
Interface ng g interface my-new-interface
Enum ng g enum my-new-enum
Module ng g module my-module

run Angular tests

cd ClientApp

npm test

Compodoc Angular documentation

  • Steps to generate:
    • npm i compodoc -g
    • npm run compodoc
    • cd documentation
    • http-server

Compodoc documentation: alt text

### run end-to-end tests
```bash
# make sure you have your server running in another terminal (i.e run "dotnet run" command)
npm run e2e

run Protractor's elementExplorer (for end-to-end)

npm run webdriver:start
# in another terminal
npm run e2e:live

Compatability

  • This project is supported in everygreen browsers and IE10+
  • IE8 & IE9 aren't supported since Bootstrap 4 is supported in IE10+ explained here.

Azure Deploy

  • You can set an environment variable for azure app deployment password Set-Item -path env:AzureAppPass -value passwordhere
From powershell:
./deploy-azure.ps1

Deploy to heroku using its container service

Replace your app name where it is aspnetcorespa

  • dotnet publish -c release
  • docker build -t aspnetcorespa ./bin/release/netcoreapp2.0/publish
  • heroku login
  • heroku container:login
  • docker tag aspnetcorespa registry.heroku.com/aspnetcorespa/web
  • docker push registry.heroku.com/aspnetcorespa/web Note: There is a deploy.heroku.ps1 script included with this project which automates above steps.

Deploy to Azure as App Service

Set-Item -path env:AzureAppPass -value passwordhere

From powershell:
./deploy-azure.ps1

paypal

aspnetcorespa's People

Contributors

asadsahi avatar chris-house avatar fullstack-pro avatar hampzter avatar heightpi avatar lecksc avatar martinoss avatar razzeee avatar trojaner avatar

Watchers

 avatar  avatar

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.