Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A CMS + E-commerce platform built with Angular and Firebase

License

NotificationsYou must be signed in to change notification settings

alexabbott/firebase-cms

Repository files navigation

FirebasCMS is an e-commerce and blogging platform with a storefront and CMS built with Angular 4 (Angular CLI), Firebase (AngularFire2), Angular Material and Stripe. Create, moderate and manage pages, blog posts, products, orders, customers, carts, navigation, themes, admins and more with this web application.

Demo

Installation

InstallAngular CLI

npm install -g @angular/cli

Install NPM packages

Run `npm install` or `yarn install`cd functions/Run `npm install`

Firebase setup

Create aFirebase account, create a new project, and copy the config code for your project.

Enable Google, Email/Password and Anonymous in the 'Sign-In Method' tab of the Authentication section in your Firebase project Console.

Within the project folder, run:

cd srcmkdir environmentscd environmentstouch environment.tstouch environment.prod.ts

Open 'environment.ts' and add your Firebase config as follows:

exportconstenvironment={production:false,firebase:{apiKey:"xxxx",authDomain:"xxxxx",databaseURL:"xxxxx",projectId:"xxxxx",storageBucket:"xxxx",messagingSenderId:"xxxx"}};

Open 'environment.prod.ts' and add your Firebase config as follows:

exportconstenvironment={production:true,firebase:{apiKey:"xxxx",authDomain:"xxxxx",databaseURL:"xxxxx",projectId:"xxxxx",storageBucket:"xxxx",messagingSenderId:"xxxx"}};

Stripe setup

Create aStripe account.

Add your Stripe API Secret Key to firebase config:

firebase functions:config:set stripe.token=<YOUR STRIPE SECRET KEY>

Open 'environment.ts' and add your Stripe Publishable API Key as follows:

exportconstenvironment={production:false,firebase:{apiKey:"xxxx",authDomain:"xxxxx",databaseURL:"xxxxx",projectId:"xxxxx",storageBucket:"xxxx",messagingSenderId:"xxxx"},stripe:"<YOUR STRIPE PUBLISHABLE KEY>"};

Open 'environment.prod.ts' and add your Stripe Publishable API Key as follows:

exportconstenvironment={production:true,firebase:{apiKey:"xxxx",authDomain:"xxxxx",databaseURL:"xxxxx",projectId:"xxxxx",storageBucket:"xxxx",messagingSenderId:"xxxx"},stripe:"<YOUR STRIPE PUBLISHABLE KEY>"};

Create SuperAdmin Account

You'll need to manually add your first admin account. To generate a hashcode for it...

  1. Runnpm run hashcode and enter your email. Copy hashcode
  2. Create new entry in your firebaseDB under,/admins/<YOUR HASHCODE>/ as follows:
admins:{<YOURHASHCODE>:{{email:'<YOUR EMAIL>',role:'super-admin'}}}
  1. Create user in firebase user management with same email.

Email Confirmation setup

  1. To allow the app to send confirmation emails through a Gmail account: enable access toLess Secure Apps andDisplay Unlock Captcha. For accounts with 2-step verification enabled,Generate an App Password.
  2. Set the gmail.email and gmail.password Google Cloud environment variables to match the email and password of the Gmail account used to send emails (or the app password if your account has 2-step verification enabled). For this use:
firebase functions:config:set gmail.email="<EMAIL ADDRESS>" gmail.password="<PASSWORD>"

Development server

Runng serve for a dev server. The app will automatically reload if you change any of the source files.

Navigate tohttp://localhost:4200/ to access the front end.

Navigate tohttp://localhost:4200/login to access the login page (login is via Google).

Navigate tohttp://localhost:4200/admin to access the CMS (user must be logged in and must be part of '/admins' in the Firebase database to access the CMS).

Code scaffolding

Runng generate component component-name to generate a new component. You can also useng generate directive|pipe|service|class|module.

Build

Runng build to build the project. The build artifacts will be stored in thedist/ directory. Use the-prod flag for a production build.

Deploy

Runnpm run deploy to deploy your project. This command will first build the app for production and then deploy it to Firebase hosting.

Admin Roles

There are 3 Admin Roles:

  • super-admin
  • admin
  • editor
Permissionsuper-adminadmineditor
create new entities
edit entities
submit entities for approval
save entities×
delete entities×
publish/unpublish entities×
edit items awaiting approval×
approve/disapprove changes×
view/add/edit/delete orders×
view/add/edit/delete customers×
view/add/edit/delete menus×
view/add/edit/delete theme settings×
view/add/edit/delete admins××

About

A CMS + E-commerce platform built with Angular and Firebase

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp