Coder Social home page Coder Social logo

andrewjbateman / angular-akita-firebase Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 3.72 MB

:clipboard: CRUD app using Akita state management to access Firebase data

License: MIT License

JavaScript 6.79% TypeScript 70.94% HTML 11.76% CSS 10.51%
angular akita firebase-realtime-database firebase rxjs firebase-database firebase9 datorama rxjs7 angular15

angular-akita-firebase's Introduction

โšก Angular Akita Firebase

  • Angular app using Akita state management and Create, Read, Update & Delete (CRUD) functions to interface with a Firebase database. Tutorial code from Aldo Caamal with some updates - see ๐Ÿ‘ Inspiration below
  • 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

*** Note: to open web links in a new window use: ctrl+click on link**

๐Ÿ“„ Table of contents

๐Ÿ“š General info

  • Akita used to create the posts.store.ts - an Akita Entity Store of single objects that is the single source of truth
  • Akita is not being maintained and they themselves recommend using an equivalent reactive store 'https://ngneat.github.io/elf/'

๐Ÿ“ท Screenshots

Example screenshot

๐Ÿ“ถ Technologies

๐Ÿ’พ Setup

  • Run npm i to install dependencies.
  • Add to environments/environment.ts: Firebase realtime database access credentials
  • 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 npm run build for a production build with css purging.
  • Run http-server to view build on an apple/android phone or simulator (pick 2nd http address supplied)
  • The build artifacts will be stored in the dist/angular-akita-firebase directory.

๐Ÿ”ง Testing

  • Run ng test to run Jasmine unit tests via Karma.
  • Run ng e2e to execute the end-to-end tests via Protractor.

๐Ÿ’ป Code Examples

  • posts.service.ts function to load post to Firebase database while showing percentage progress
  async add(post: Post, files: any) {
    await this.uploadImage(files);

    let newpost = {
      title: post['title'],
      content: post['content'],
      cover: this.downloadURL,
      fileref: this.filepath,
    };

    let p = await this.firestore.collection('posts').add(newpost);
    this.setPercentage(null);
  }

๐Ÿ†’ Features

  • Uses Akita state management, built on top of RxJS data streams to create an Observable Data Store model.

๐Ÿ“‹ Status & To-Do List

  • Status: Working. Add Firebase authentication to access database - bypassed by setting access to 'true' in Firebase rules
  • To-Do: Nothing

๐Ÿ‘ Inspiration

๐Ÿ“ License

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

โœ‰๏ธ Contact

angular-akita-firebase's People

Contributors

andrewjbateman avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

royrakesh

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.