Giter VIP home page Giter VIP logo

angular-architecture-patterns's Introduction

Angular architecture patterns

This application represents a demo project for Angular architecture patterns blog series at http://netmedia.io. Frontend app is generated with Angular CLI. It uses it's own local dev server on http://localhost:4200/.

Installation

git clone https://github.com/anteburazer/angular-architecture-patterns.git
cd angular-architecture-patterns
npm install
npm run start

Run Development

Run npm run start for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files. The command will run custom hooks which will set environment to development and merge all i18n files needed for multi language support. The application uses proxy file to connect with the API. Proxy settings are defined in proxy.conf.json

Build for production

Run npm run sy-build to build the application for production which includes tree shaking, AOT and other cool stuff for minification. This command is defined in package.json file under the scripts section and includes regular Angular CLI build command, custom made hooks and generation of service worker file.

When application is built for production it's copied in /dist folder which is the public folder for Angular CLI.

Hooks

Hooks are located in /hooks folder and they are responsible for merging and copying configuration and localization files for development and production.

Note

Copying files is not necessary on angular-cli v1.0.4 and above because it has built in login for this action. You just need to specify which files/folders need to be copied into your destination folder (default dist) and you can do that in .angular-cli.json file by specifing the assets array:

"assets": [
  "assets",
  "favicon.ico",
  "service-worker.js",
  { "glob": "**/*", "input": "../config", "output": "./config/" },
  { "glob": "en.json", "input": "../i18n", "output": "./i18n/" },
  { "glob": "hr.json", "input": "../i18n", "output": "./i18n/" }
]

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.