Giter Club home page Giter Club logo

angular-firestore's Introduction

Angular Firestore

This project is the result of my code-along at the end of the video series Angular & FireStore Application by Brad Traversy. His original code repo may be found here. My code is similar, but has several minor design changes. Instructions on how to deploy this code to Firebase are included.


Versions Used

This project was generated with Angular CLI version 1.6.2.

  • Angular CLI v1.6.3
  • Angular v5.1.2
  • Angular Fire 2 v5.0.0-rc.4
  • Firebase CLI v3.16.0
  • Firebase v4.8.0

Installing the Project

To begin working with this project, perform the following tasks:

  1. Clone this repo: git clone https://github.com/Stanza987/angular-firestore.git

  2. cd into the folder of the cloned repo

  3. Run yarn install to install dependencies

  4. Add your Firebase configuration to environment.ts and environment.prod.ts

    export const environment = {
        production: false, //change to true for environment.prod.ts
        firebase: {
            apiKey: '<your-key>',
            authDomain: '<your-project-authdomain>',
            databaseURL: '<your-database-URL>',
            projectId: '<your-project-id>',
            storageBucket: '<your-storage-bucket>',
            messagingSenderId: '<your-messaging-sender-id>'
        }
    };
  5. Uncomment Firestore API endpoints in item.service.ts to enable CRUD functionality.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Production Build

Run ng build --prod to build the project. The static assets will be stored in the dist/ directory.

Deploying to Firebase

  1. Run ng build --prod
  2. Run firebase init and choose Hosting, follow the on-screen prompts.
  3. Delete the public directory automatically generated by the Firebase CLI
  4. Change firebase.json to
    {
        "hosting": {
            "public": "dist",
            "ignore": [
                "firebase.json",
                "**/.*",
                "**/node_modules/**"
            ],
            "rewrites": [
                {
                    "source": "**",
                    "destination": "/index.html"
                }
            ]
        }
    }
    
  5. Run firebase deploy

Further help

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.