Giter Site home page Giter Site logo

amitassaraf / the-first-real-angular2-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 1.0 1.77 MB

A simple, complete, Angular 2 & Flask boilerplate featuring Sass, Pug, MaterializeCSS, TypeScript, Webpack 2, Gunicorn

TypeScript 0.66% HTML 0.21% CSS 39.56% JavaScript 58.97% Shell 0.11% Python 0.49%
pug webpack typescript angular2 sass flask boilerplate boilerplate-template boilerplates webpack2 angular angularjs gunicorn tornado livereload simple

the-first-real-angular2-boilerplate's Introduction

The First Real Angular 2 Boilerplate

A simple, complete, Angular 2 & Flask boilerplate featuring Sass, Pug, MaterializeCSS, JQuery, BassCSS, TypeScript, Webpack 2, Gunicorn/Tornado with LiveReload

Node version contributions welcome Join the chat at https://gitter.im/amitassaraf/The-First-Real-Angular-2-Boilerplate

๐Ÿ”ฅ The first real and simple boilerplate that will make you finally understand Angular 2 ๐Ÿ”ฅ


Features

  • Packed with the latest version of Angular 2
  • Webpack 2 with great plugins such as LiveReload and HtmlWebpackIncludeAssetsPlugin
  • Easy inclusion of external JS/CSS libraries
  • Sass, Pug, TS
  • Ready to be run using Gunicorn or Tornado
  • A simple Flask backend
  • Simple and elegant naming & placing conversions
  • Packed with MaterializeCSS, BassCSS, JQuery

Tested with NodeJS version 7.4.0 (NPM version 4.0.5)

Quick Start

Clone/Download the repo

// clone our repo
$ git clone https://github.com/amitassaraf/the-first-real-angular2-boilerplate.git my-app

// change directory to your app
$ cd my-app
$ cd src/frontend

// install the dependencies with npm
$ npm install

// start the server
$ npm start

// Enter the backend folder
$ cd ../tfra2bpflask

// start the flask server
$ sudo sh Profile
// or (on Windows)
$ python server.py

go to http://localhost:8000 in your browser.

When running npm start

# For production you should run:
$ npm run build

FAQ

When you want to add an external library all you need to do is drop it inside frontend/externals/libs then add the following line to libs.ts:

declare var [LibraryExportName]: any;

Examples are available in the boilerplate.


When you want to add a library that uses scss you should put the scss file inside frontend/externals then import it inside index.scss

@import "../../../externals/libs/materialize/sass/materialize";


File structure tree:

src
---> frontend
     ---> externals
          ---> libs # Here you place all external JS/CSS libs
               ...
          ...
     ---> src
          ---> app
               ---> components # Folder for all components
                    ---> home
                         home.pug # No more .component convention!
                         home.scss
                         home.ts
                    ---> about # Each component gets a folder with a pug, sass, ts files
                         about.pug
                         about.scss
                         about.ts
                    app.pug
                    app.scss
                    app.ts
               ---> services # Here you can place angular services
                    api_service.ts # No more .service.ts convension
                    ...
               ...
          package.json
          ....

TypeScript

To take full advantage of TypeScript with autocomplete you would have to use an editor with the correct TypeScript plugins.


License

MIT

Proudly created by Amit Assaraf & Ran Amos

The boilerplate main page

Offline node modules -> https://tinyurl.com/z25xfa5

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.