Coder Social home page Coder Social logo

andrewjbateman / angular-firebase-access Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 4.87 MB

:clipboard: Angular with Firebase backend for CRUD operations on blog posts

License: MIT License

JavaScript 6.68% TypeScript 65.04% HTML 22.02% SCSS 6.26%
angular firebase-database firebase firebase-auth firebase-functions scss html5 rxjs rxjs7 firebase9

angular-firebase-access's Introduction

โšก Angular Firebase Access

  • Angular app using Firebase tools to access a Google Cloud Firestore
  • With a Google login or other auth setup it is possible to Create, Read, Update and Delete blog posts.
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

๐Ÿ“„ Table of contents

๐Ÿ“š General info

  • Allows access to create, read, update & delete Firebase posts

๐Ÿ“ท Screenshots

  • Example screenshot

๐Ÿ“ถ Technologies

๐Ÿ’พ Setup

  • Install dependencies using npm i
  • 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.
  • Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.
  • Run ng update to update Angular

๐Ÿ’ป Code Examples

  • functions from post.service.ts to get all posts and a selected post.
getPosts = async (): Promise<any> => {
    let postsArray = [];
    const postCollectionRef = collection(db, "posts");
    const querySnapshot = await getDocs(query(postCollectionRef));
    querySnapshot.forEach(doc => {
      alert;
      postsArray.push({ id: doc.id, ...doc.data() });
      postsArray.sort((a, b) => b.published - a.published);
    });
    return postsArray;
  };

  showFullPost = (post: Post): void => {
    this.currentPost = post;
    this.router.navigate(["/post-detail"]);
  };
  

๐Ÿ†’ Features

  • HTML template uses the Angular async pipe to subscribe to the posts Observable and to unsubscribe automatically in the onDestroy lifecycle, avoiding memory leaks.

๐Ÿ“‹ Status & To-Do List

  • Status: Working
  • To-Do: Add tabs for posts categories

๐Ÿ‘ Inspiration

๐Ÿ“ License

  • This project is licensed under the terms of the MIT license.

โœ‰๏ธ Contact

angular-firebase-access's People

Contributors

andrewjbateman avatar

Stargazers

 avatar  avatar

Watchers

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