• Stars
    star
    837
  • Rank 54,466 (Top 2 %)
  • Language
    JavaScript
  • Created almost 10 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Yo generator that creates an Angular app via HotTowel

generator-hottowel

NPM version Build Status

Create an Angular application using the HotTowel style (via a Yeoman generator)

Opinionated Angular style guide for teams by @john_papa

More details about the styles and patterns used in this app can be found in my Angular Style Guide and my Angular Patterns: Clean Code course at Pluralsight and working in teams.

Prerequisites

  1. Install Node.js

  2. Install these npm packages globally

    npm install -g yo bower gulp nodemon

    Refer to these instructions on how to not require sudo

QuickStart

  1. Install generator-hottowel

    npm install -g generator-hottowel
  2. Create a new folder and change directory to it

    mkdir myapp
    cd myapp
  3. Run the generator

    yo hottowel helloWorld

HotTowel Options

Application Name

  • Pass in the app's name to avoid being prompted for it

    yo hottowel [appName]

Running HotTowel

Linting

  • Run code analysis using gulp vet. This runs jshint, jscs, and plato.

Tests

  • Run the unit tests using gulp test (via karma, mocha, sinon).

Running in dev mode

  • Run the project with gulp serve-dev

  • opens it in a browser and updates the browser with any files changes.

Building the project

  • Build the optimized project using gulp build
  • This create the optimized code for the project and puts it in the build folder

Running the optimized code

  • Run the optimize project from the build folder with gulp serve-build

Exploring HotTowel

HotTowel Angular starter project

Structure

The structure also contains a gulpfile.js and a server folder. The server is there just so we can serve the app using node. Feel free to use any server you wish.

/src
  /client
    /app
    /content

Installing Packages

When you generate the project it should run these commands, but if you notice missing packages, run these again:

  • npm install
  • bower install

The Modules

The app has 4 feature modules and depends on a series of external modules and custom but cross-app modules

app --> [
        app.admin --> [
            app.core,
            app.widgets
        ],
        app.dashboard --> [
            app.core,
            app.widgets
        ],
        app.layout --> [
            app.core
        ],
        app.widgets,
		app.core --> [
			ngAnimate,
			ngSanitize,
			ui.router,
			blocks.exception,
			blocks.logger,
			blocks.router
		]
    ]

core Module

Core modules are ones that are shared throughout the entire application and may be customized for the specific application. Example might be common data services.

This is an aggregator of modules that the application will need. The core module takes the blocks, common, and Angular sub-modules as dependencies.

blocks Modules

Block modules are reusable blocks of code that can be used across projects simply by including them as dependencies.

blocks.logger Module

The blocks.logger module handles logging across the Angular app.

blocks.exception Module

The blocks.exception module handles exceptions across the Angular app.

It depends on the blocks.logger module, because the implementation logs the exceptions.

blocks.router Module

The blocks.router module contains a routing helper module that assists in adding routes to the $routeProvider.

Gulp Tasks

Task Listing

  • gulp help

    Displays all of the available gulp tasks.

Code Analysis

  • gulp vet

    Performs static code analysis on all javascript files. Runs jshint and jscs.

  • gulp vet --verbose

    Displays all files affected and extended information about the code analysis.

  • gulp plato

    Performs code analysis using plato on all javascript files. Plato generates a report in the reports folder.

Testing

  • gulp serve-specs

    Serves and browses to the spec runner html page and runs the unit tests in it. Injects any changes on the fly and re runs the tests. Quick and easy view of tests as an alternative to terminal via gulp test.

  • gulp test

    Runs all unit tests using karma runner, mocha, chai and sinon with phantomjs. Depends on vet task, for code analysis.

  • gulp test --startServers

    Runs all unit tests and midway tests. Cranks up a second node process to run a server for the midway tests to hit a web api.

  • gulp autotest

    Runs a watch to run all unit tests.

  • gulp autotest --startServers

    Runs a watch to run all unit tests and midway tests. Cranks up a second node process to run a server for the midway tests to hit a web api.

Cleaning Up

  • gulp clean

    Remove all files from the build and temp folders

  • gulp clean-images

    Remove all images from the build folder

  • gulp clean-code

    Remove all javascript and html from the build folder

  • gulp clean-fonts

    Remove all fonts from the build folder

  • gulp clean-styles

    Remove all styles from the build folder

Fonts and Images

  • gulp fonts

    Copy all fonts from source to the build folder

  • gulp images

    Copy all images from source to the build folder

Styles

  • gulp styles

    Compile less files to CSS, add vendor prefixes, and copy to the build folder

Bower Files

  • gulp wiredep

    Looks up all bower components' main files and JavaScript source code, then adds them to the index.html.

    The .bowerrc file also runs this as a postinstall task whenever bower install is run.

Angular HTML Templates

  • gulp templatecache

    Create an Angular module that adds all HTML templates to Angular's $templateCache. This pre-fetches all HTML templates saving XHR calls for the HTML.

  • gulp templatecache --verbose

    Displays all files affected by the task.

Serving Development Code

  • gulp serve-dev

    Serves the development code and launches it in a browser. The goal of building for development is to do it as fast as possible, to keep development moving efficiently. This task serves all code from the source folders and compiles less to css in a temp folder.

  • gulp serve-dev --nosync

    Serves the development code without launching the browser.

  • gulp serve-dev --debug

    Launch debugger with node-inspector.

  • gulp serve-dev --debug-brk

    Launch debugger and break on 1st line with node-inspector.

Building Production Code

  • gulp html

    Optimize all javascript and styles, move to a build folder, and inject them into the new index.html

  • gulp build

    Copies all fonts, copies images and runs gulp html to build the production code to the build folder.

Serving Production Code

  • gulp serve-build

    Serve the optimized code from the build folder and launch it in a browser.

  • gulp serve-build --nosync

    Serve the optimized code from the build folder and manually launch the browser.

  • gulp serve-build --debug

    Launch debugger with node-inspector.

  • gulp serve-build --debug-brk

    Launch debugger and break on 1st line with node-inspector.

Bumping Versions

  • gulp bump

    Bump the minor version using semver. --type=patch // default --type=minor --type=major --type=pre --ver=1.2.3 // specific version

License

MIT

More Repositories

1

angular-styleguide

Angular Style Guide: A starting point for Angular development teams to provide consistency through good practices.
23,968
star
2

lite-server

Lightweight node server
JavaScript
2,308
star
3

ng-demos

variety of angular demos
JavaScript
1,704
star
4

vscode-peacock

Subtly change the color of your Visual Studio Code workspace. Ideal when you have multiple VS Code instances, use VS Live Share, or use VS Code's Remote features, and you want to quickly identify your editor.
TypeScript
1,040
star
5

angular-ngrx-data

Angular with ngRx and experimental ngrx-data helper
TypeScript
971
star
6

angular-tour-of-heroes

Angular - Tour of Heroes - The Next Step after Getting Started
TypeScript
822
star
7

vscode-angular-snippets

Angular Snippets for VS Code
TypeScript
567
star
8

gulp-patterns

Playground for Gulp Recipes
JavaScript
501
star
9

HotTowel-Angular

HotTowel with Angular (for NuGet)
JavaScript
238
star
10

ngrx-data-lab

Sample app that can be expanded to use ngrx-data
TypeScript
216
star
11

pwa-angular

PWA Example
TypeScript
207
star
12

vue-getting-started

This project is seen in demos including the Pluralsight course "Vue: Getting Started" to help represent a fundamental app written with Vue. The heroes and villains theme is used throughout the app.
Vue
191
star
13

heroes-angular

Tour of Heroes app written with Angular
TypeScript
163
star
14

vscode-winteriscoming

Dark theme with fun and bright foreground colors
CSS
162
star
15

pluralsight-gulp

Starter Code for Pluralsight Course "JavaScript Build Automation with Gulp.js"
JavaScript
161
star
16

angular-event-view-cli

Angular Demo with a Little bit of a lot of features
TypeScript
154
star
17

vue-typescript

Vue.js with TypeScript (OLD - in process of updating)
Vue
145
star
18

hottowel-angular-typescript

As seen at //Build 2015 presented by Erich Gamma, Chris Dias and John Papa.
JavaScript
145
star
19

heroes-vue

Tour of Heroes app written with Vue
Vue
144
star
20

HotTowel

John Papa's ASP.NET MVC SPA Template (Durandal)
CSS
142
star
21

heroes-react

Tour of Heroes app written with React
JavaScript
134
star
22

vscode-angular-essentials

Dockerfile
133
star
23

shopathome

Choose from Angular, React, Svelte, and Vue applications with an Azure Functions API, that deploys to Azure Static Web Apps
TypeScript
132
star
24

PluralsightSpaJumpStartFinal

Source code for the SPA JumpStart Pluralsight course at http://jpapa.me/spajsps
JavaScript
132
star
25

hello-worlds

Hello world apps for angular, react, svelte, and vue
TypeScript
128
star
26

heroes-angular-serverless

TypeScript Node/Express 👉TypeScript Serverless ➕Angular
TypeScript
125
star
27

angular2-force

ngConf 2016 live coding demo
JavaScript
115
star
28

vscode-cloak

Cloak allows you to hide/show environment keys, to avoid accidentally sharing them with everyone who sees your screen.
TypeScript
106
star
29

angular-preload-and-interceptors

TypeScript
104
star
30

angular-first-look-examples

angular first look for pluralsight
HTML
89
star
31

angular-first-look-hosted

Hosted Code from Pluralsight Course "Angular First Look"
HTML
86
star
32

angular-cosmosdb

Cosmos DB, Express.js, Angular, and Node.js app
TypeScript
81
star
33

CodeCamper

JavaScript
73
star
34

pluralsight-vscode-samples

VS Code samples for Pluralsight course on Code
JavaScript
70
star
35

docker-angular-cli

Dockerfile and image for node plus angular CLI
Dockerfile
69
star
36

awesome-angular-workshop

Angular: The Awesome Parts - Workshop
TypeScript
68
star
37

angular.breeze.storagewip

Save Work in Progress to Local Storage for Angular and Breeze apps
JavaScript
66
star
38

Pluralsight-CC-Angular-Breeze-Extra

Supporting files for the Pluralsight "SPA with Angular and Breeze" course by John Papa.
JavaScript
64
star
39

node-hello

Hello World for Node.js
JavaScript
63
star
40

one-with-angular

TypeScript
61
star
41

node-ts

Simple Node app Written with TypeScript
TypeScript
59
star
42

http-interceptors

The Web apps in this monorepo make HTTP requests and require uniform consistency in how they are executed and handled. This monorepo demonstrates the same app written with Angular and with Svelte. Each app uses HTTP interceptors. The Angular app uses HttpClient and its interceptors while the Svelte app uses Axios and its interceptors.
TypeScript
58
star
43

angular-what-if

TypeScript
57
star
44

vikings

TypeScript
53
star
45

express-to-functions

TypeScript Node/Express 👉TypeScript Serverless ➕ Angular
TypeScript
53
star
46

vue-guide

Super Simple Vue Samples
HTML
51
star
47

ngrx-demo

NgRx demo
TypeScript
50
star
48

ng-patterns-testing

JavaScript
48
star
49

typescript-async

Creating Asynchronous Code with TypeScript
TypeScript
47
star
50

vscode-angular1-snippets

vscode-angular1-snippets
41
star
51

vscode-pwa

VS Code Extension for PWA Tools
TypeScript
39
star
52

angular-lazy-load-demo

Lazy loading Angular components
TypeScript
32
star
53

github-templates

31
star
54

angular-2-first-look-launcher

deprecated
JavaScript
30
star
55

heroes-svelte

Tour of Heroes app written with Svelte
Svelte
30
star
56

kis-requirejs-demo

Keep It Simple RequireJS Demo. Shows simple demo of require.js before and after
JavaScript
30
star
57

heroes-node-api

node api for the heroes apps
JavaScript
29
star
58

heroes-vue-node-api

As seen in Vue Conf 2019
Vue
28
star
59

toastr-bower

toastr's bower repo
CSS
24
star
60

star-wars-api

Star Wars API
JavaScript
23
star
61

vue-workshop

Vue Fundamentals Workshops
Vue
23
star
62

vue-simple

This project was created to help represent a fundamental app written with Vue. The heroes and villains theme is used throughout the app.
Vue
22
star
63

typescript-fundamentals

HTML
21
star
64

vscode-read-time

TypeScript
19
star
65

vue-intro

Vue.js app using Vue's CLI
Vue
19
star
66

angular-rxjs-shared-examples

rxjs examples
TypeScript
17
star
67

serverless-thank-you

Say thank you to everyone who takes the time to create and discus or a pull request in your Github repository, using Azure Functions
TypeScript
17
star
68

swa-workshop

TypeScript
16
star
69

cloud-coding-with-codespaces

Live demo using Angular, github.dev, codespaces, copilot, azure static web apps, and devcontainers
TypeScript
13
star
70

vscode-azure-functions-tools

Azure Functions Tools for VS Code - DEPRECATED
12
star
71

vue-cli-preset-all-javascript

Vue CLI Preset for All JavaScript Prompts
12
star
72

vscode-presenter-pro

11
star
73

vue-ts

simple repro of master details with vue 3, composition api, and typescript
Vue
10
star
74

ios-play

iOS Playground
Swift
8
star
75

security-strategy-essentials

JavaScript
8
star
76

telekinesis

"Think" code
JavaScript
7
star
77

johnpapa

7
star
78

house-bot

Home automation with AI, LUIS, Serverless
JavaScript
7
star
79

first-serverless-api

Create your first serverless API endpoints with Azure Functions
JavaScript
7
star
80

innersource

6
star
81

Angular-NuGet

NuGet Repo for Angular Packages
JavaScript
6
star
82

angular-expiring-http-cache

TypeScript
5
star
83

ng-ai-hackathon

TypeScript
5
star
84

starwars-ios

Swift
5
star
85

one-with-angular-api

JavaScript
5
star
86

shopping-for-codespaces

CSS
4
star
87

typescript-hello-world

Simple hello world project for running TypeScript with Node.js
TypeScript
4
star
88

svelte-intro

JavaScript
3
star
89

glimpse.toastr

JavaScript
3
star
90

react-book-repo

3
star
91

pluralsight-ng-testing

pluralsight-ng-testing
CSS
2
star
92

skills-copilot-codespaces-vscode

My clone repository
1
star
93

dotfiles

1
star
94

aggregator-app

serverless function with api aggregator with azure
JavaScript
1
star
95

.github

1
star
96

vscode-import-bug

referencing https://github.com/microsoft/TypeScript/issues/35591
TypeScript
1
star