Git Product home page Git Product logo

ionic-angular-authuser's Introduction

โšก Ionic Angular Authentication

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

๐Ÿ“„ Table of contents

๐Ÿ“š General info

  • Firebase Firestore Authentication used to create sign in and log in functions
  • Firebase Cloud Firestore stores users and messages in Collections.
  • Angular FormBuilder used to reduce the amount of boilerplate needed to build a form
  • rxjs map and switchmap operators used

๐Ÿ“ท Screenshots

screenshot

๐Ÿ“ถ Technologies

๐Ÿ’พ Setup

  • Create a Firebase project and add email authentication
  • Add Firebase config object to environment variables
  • npm i to install dependencies
  • ionic serve to start the server on _localhost://8100

๐Ÿ’ป Code Examples

  • extract from chat.page.html by Simon Grimm showing ternery expressions to change chat offset and scss class depending on user
	<ion-grid>
    <ion-row *ngFor="let message of messages | async">
      <ion-col size="9" class="message"
        [offset]="message.myMsg ? 3 : 0"
        [ngClass]="{ 'my-message': message.myMsg, 'other-message': !message.myMsg }">
        <b>{{ message.fromName }}</b><br>
        <span>{{ message.msg }}
        </span>
        <div class="time ion-text-right"><br>{{ message.createdAt?.toMillis().toString() | date:'short' }}</div>
      </ion-col>
    </ion-row>
  </ion-grid>

๐Ÿ†’ Features

  • Use of ternery expressions to change chat box color and horizontal offset depending on which user chat item is shown

๐Ÿ“‹ Status & To-do list

  • Status: Complete and working. Problem with dev. console persisting user login id which stops chat from showing user details correctly
  • To-do: Fix errors. Find out how to show more than one user email in chat with email username - problem is likely due to storing of user data even after logging out and logging in as a different user.

๐Ÿ‘ Inspiration

๐Ÿ“ License

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

โœ‰๏ธ Contact

ionic-angular-authuser's People

Contributors

andrewjbateman avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

mylonymus

ionic-angular-authuser's Issues

signup infinte loading

I just signup in frontend and it shows infinet loading, i checked the firebase and my user was successfully created

  • after reloading the window automatically changed to chat window (seem I am logged in)

I am curious where it store the messages

instruction on how to copy firebase configuration object is not clear enought

that must be a simple task, but I cant undertand instruction on how to copy firebase configuration object is not clear enought,
i find something on environment.ts, but I copied the hole google config file without brackets and got:

[ng] Error: src/app/app.module.ts:23:41 - error TS2559: Type '{ project_info: { project_number: string; project_id: string; storage_bucket: string; }; client: { client_info: { mobilesdk_app_id: string; android_client_info: { package_name: string; }; }; oauth_client: { ...; }[]; api_key: { ...; }[]; services: { ...; }; }[]; configuration_version: string; }' has no properties in common with type 'FirebaseOptions'.
[ng]
[ng] 23 AngularFireModule.initializeApp(environment.firebaseConfig),

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.