Giter Club home page Giter Club logo

angular-ngrx's Introduction

Angular-ngrx Demo

What is this

Write less code for managing the ngrx redux pattern for multiple entity models in an app.

Why use it

Managing state can be challenging. The Redux pattern that ngrx implements helps manage state in Angular apps by adding reducers, actions, states, effects, dispatchers, and selectors. This library aims to demonstrate a technique that will reduce the boilerplate to implement ngrx.

TODO: Link to FAQ

How

TODO: Explain how to implement this in a new Angular CLI app

Requirements

  1. Install the Angular CLI

    npm install -g @angular/cli
  2. Create a CosmosDB instance

Getting Started

  1. Clone this repository

    git clone https://github.com/johnpapa/angular-ngrx.git
    cd angular-ngrx
  2. Install the npm packages

    npm i

Running the app

  1. Build the Angular app and launch the node server

    npm run build
    npm run dev
  2. Open the browser to http://localhost:3001

Docker

Environment file

Create an empty file named .env in the root of the app. We'll fill this in later.

Docker Compose with Debugging

Create the Docker image and run it locally. This commands uses docker-compose to build the image and run the container.

This opens port 9229 for debugging.

npm run docker-debug
open http://localhost:3001

Open VS Code, launch the Docker: Attach to Node debugging profile

Optional Database

NODE_ENV=development

PORT=3001
PUBLICWEB=./publicweb

COSMOSDB_ACCOUNT=your_cosmos_account
COSMOSDB_DB=your_cosmos_db
COSMOSDB_KEY=your_cosmos_key
COSMOSDB_PORT=10255

Out of the box you can run the demo with an in memory data service instead of a live database. If you wish to use a database, you can set up a local mongo server or a remote CosmosDB/MongoDB server in the cloud.

  1. Configure Cosmos DB server settings

    Copy the contents from .env.example into .env. Replace the values with your specific configuration. Don't worry, this file is in the .gitignore so it won't get pushed to github.

    NODE_ENV=development
    
    PORT=3001
    PUBLICWEB=./publicweb
    
    COSMOSDB_ACCOUNT=your_cosmos_account
    COSMOSDB_DB=your_cosmos_db
    COSMOSDB_KEY=your_cosmos_key
    COSMOSDB_PORT=10255

Problems or Suggestions

Open an issue here

angular-ngrx's People

Contributors

johnpapa avatar wardbell 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.