npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-firebase-cms

v0.3.0

Published

Angular Content Management System using Google Firebase (Authentication, Storage & Firestore)

Downloads

146

Readme

GitHub Release Date npm package NPM downloads GitHub license

Description

ngx-firebase-cms is a set of tool that combines the admin panel using ng-zorro-antd and backend linkage to Google Firebase with what developers need for their Angular project. It provides user authentication, file storage and firestore database using Google Firebase.

Features

  • User Authentication using Firebase Authentication
  • Media upload using Firebase Storage
  • Post CRUD using Firebase Firestore
  • Admin Panel using ng-zorro-antd

Environment Support

  • Angular ^7.0.0
  • Modern browsers and Internet Explorer 11+ (with polyfills)

Installation

1. Create a new project

ng new <project-name> --routing
cd <project-name>

2. Install NGX-FIREBASE-CMS

npm i -S ngx-firebase-cms
npm i -S @angular/fire firebase 
ng add ng-zorro-antd

3. Add Firebase config to environments variable

Open /src/environments/environment.ts and add your Firebase configuration. You can find your project configuration in the Firebase Console. From the project overview page, click Add Firebase to your web app.

export const environment = {
  production: false,
  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>'
  },
  ngxFirebaseCms: {
    
  }
};

4. Setup @NgModule for the NgxFirebaseCMSModule and edit app.component.html

Open /src/app/app.module.ts, inject the NgxFirebaseCms and BrowserAnimationsModule providers, and specify your NgxFirebaseCms configuration.


import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularFireModule } from '@angular/fire';
import { NgxFirebaseCMSModule } from 'ngx-firebase-cms';
import { environment } from '../environments/environment';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
...

@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    AngularFireModule.initializeApp(environment.firebase),
    NgxFirebaseCMSModule.forRoot(environment.ngxFirebaseCms)
    ...
  ],
  declarations: [ AppComponent ],
  bootstrap: [ AppComponent ]
})
export class AppModule {}

Open /src/app/app.component.html, replace with <router-outlet></router-outlet>

5. Enable Email/Password Authenication Provider

Open console.firebase.google.com and go to Develop > Authentication > Sign-in method

6. Amend the Rules for firestore

Open console.firebase.google.com and go to Develop > Database > Cloud Firestore > Rules Temporarily, allow read/write access on all documents to any user signed in to the application

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth.uid != null
    }
  }
}

This is temporary settings, it is not safe as everyone could register to be a user using any email.

7. Add ngx-firebase-cms Admin Panel to route module

Open app-routing.module.ts and add the NgxFirebaseCMSModule

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { NgxFirebaseCMSModule } from 'ngx-firebase-cms';

const routes: Routes = [
  { path: 'admin', loadChildren: () => NgxFirebaseCMSModule },
  /***
    Your other routes
  ***/
];

@NgModule({
  imports: [RouterModule.forRoot(routes, {scrollPositionRestoration: 'enabled'})],
  exports: [RouterModule]
})
export class AppRoutingModule { }

The Admin Panel is now at localhost:4200/admin or you could change the admin to any other url You should consider to add https cert for production use.

8. Run your app

ng serve

Run the serve command and navigate to http://localhost:4200 in your browser. The default route for Admin Panel is at http://localhost:4200/admin

9. Next step

Next Step: Documents

Usage

  • coming soon

Development

  • coming soon

Road Map

  • coming soon

Contributing

  • coming soon

Users

  • coming soon

License

  • GNU GPLv3