Coder Social home page Coder Social logo

zhouzx9999 / erp-apps-crm-cloud-angular_firebase Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amitxshukla/erp-apps-crm-cloud-angular_firebase

0.0 0.0 0.0 411 KB

ERP Apps - CRM Cloud Angular 9 and Google FireStore database, Role based security

TypeScript 35.74% HTML 63.11% CSS 1.14%

erp-apps-crm-cloud-angular_firebase's Introduction

Please give a Star * to this repository if you like this project.

ERP-Apps

Objective

Build ERP apps for Small, Medium and Large Organizations
Re-Write / Build new CRM GUI for existing ERP
Convert Old Software to new App/UI (Desktop & Mobile) without changing database
Migrate existing ERP to new platform
Make an App for existing Oracle, PeopleSoft, SAP, or Siebel CRM or old custom software based ERP

Community Version - All apps are Free download with complete source code for iOS, Android and web.
Click here for Video Tutorials !

Installation Instructions
Step 1: Install your favorite Code editor
Anroid Studio, IntelliJ community edition, Visual Studio Code

Step 2: download node js
make sure, your windows, linux or mac environment path is setup to the directory where your node.exe file is
for example

Path  = c:\amit.la\Program\node
now run following commands in terminal window
$ node -v
$ npm -v
make sure both the these commands return a valid node and npm version.
now install angular cli
$ npm install -g @angular/cli
// after installation
$ ng version
make sure ng version returns a valid Angular cli version.

Step 3: download this GitHub repository - Fork/Download Zip 
extract all files to your c drive and browse to the directory where you can see package.json
$ npm install --save
make sure installation finished without any error
$ ng serve --open
at this point, your app will serve on localhost:4200 but it show some errors because your firebase in not setup yet

Step 4: Setup Firebase project 
go to -> console.firebase.com
set up a new project
inside your project, click on authentication and enable
email/password, Google and Facebook authentication methods
now setup Firebase rules
please copy paste these rules as-is and make sure, there are no errors anywhere.
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
  allow read, write: if false;
}

match /USER_ROLES/{document} {
allow read: if isSignedIn();
}
match /USER_SETTINGS/{document} {
allow read: if (isSignedIn() && isDocOwner()) || isAdmin();
allow create: if isSignedIn() && onlyContentChanged();
allow update: if (isSignedIn() && isDocOwner() && onlyContentChanged()) || isAdmin();
allow delete: if isAdmin();
}
match /USER_ADDRESSBOOK/{document=**} {
allow read: if (isSignedIn() && isEmployee()) || isAdmin();
allow create: if isSignedIn();
allow update: if (isSignedIn() && isDocOwner()) || isAdmin();
allow delete: if isAdmin();
}
match /USER_CAMPAIGN/{document=**} {
allow read: if (isSignedIn() && isEmployee()) || isAdmin();
allow create: if isSignedIn();
allow update: if (isSignedIn() && isDocOwner()) || isAdmin();
allow delete: if isAdmin();
}
match /USER_LEADS/{document=**} {
allow read: if (isSignedIn() && isEmployee()) || isAdmin();
allow create: if isSignedIn();
allow update: if (isSignedIn() && isDocOwner()) || isAdmin();
allow delete: if isAdmin();
}
match /USER_OPPURTUNITY/{document=**} {
allow read: if (isSignedIn() && isEmployee()) || isAdmin();
allow create: if isSignedIn();
allow update: if (isSignedIn() && isDocOwner()) || isAdmin();
allow delete: if isAdmin();
}
match /USER_APPOINTMENTS/{document=**} {
allow read: if (isSignedIn() && isEmployee()) || isAdmin();
allow create: if isSignedIn();
allow update: if (isSignedIn() && isDocOwner()) || isAdmin();
allow delete: if isAdmin();
}
match /USER_CALLS/{document=**} {
allow read: if (isSignedIn() && isEmployee()) || isAdmin();
allow create: if isSignedIn();
allow update: if (isSignedIn() && isDocOwner()) || isAdmin();
allow delete: if isAdmin();
}
match /USER_TICKETS/{document=**} {
allow read: if (isSignedIn() && isEmployee()) || isAdmin();
allow create: if isSignedIn();
allow update: if (isSignedIn() && isDocOwner()) || isAdmin();
allow delete: if isAdmin();
}
match /USER_WORKORDERS/{document=**} {
allow read: if (isSignedIn() && isEmployee()) || isAdmin();
allow create: if isSignedIn();
allow update: if (isSignedIn() && isDocOwner()) || isAdmin();
allow delete: if isAdmin();
}
match /USER_ORDERS/{document=**} {
allow read: if (isSignedIn() && isEmployee()) || isAdmin();
allow create: if isSignedIn();
allow update: if (isSignedIn() && isDocOwner()) || isAdmin();
allow delete: if isAdmin();
}
// helper functions
function isSignedIn() {
return request.auth.uid != null;
}
function onlyContentChanged() {
return request.resource.data.role == "" || request.resource.data.role == resource.data.role;
// make sure user is not signing in with any role or changin his role during update
}
function isDocOwner() {
return request.auth.uid == resource.data.author;
}
function isDocCreater() {
return request.auth.uid == request.resource.data.author;
}
function isAdmin() {
return get(/databases/$(database)/documents/USER_SETTINGS/$(request.auth.uid)).data.role == "admin";
}
function isEmployee() {
return get(/databases/$(database)/documents/USER_SETTINGS/$(request.auth.uid)).data.role == "employee";
}
}
}
Step 5: Create new data collection
as shown in this screen and make sure all documents/fields look exactly the same.

YouTube video Part -1 @ 13:08

USER_ROLES is a collection
admin is a document inside it
admin, addressbook etc each has a “map” inside
Which has four fields each
visible Boolean true
read Boolean true
write Boolean true
delete Boolean true

Step 6: find Firebase Project settings
copy and replace Firebase settings in your app->environments/environment.ts and environment.prod.ts


Step 7: Browse App 
to check if your app is up and running now if not, please open browser console and look for errors

if firebase is not setup properly or settings are not copies correctly, you will see error like invalid API Key.

For any other error please open a new issue and include a screen shot of your terminal and browser console window.

Pro Version Enquiries [email protected] - ERP

Other Apps -> CRM Cloud
Marketting
Helpdesk
BPO/Call Register
Customer Order Fullfillment

Supply Chain
Buy To Pay
Customer Order Fullfillment
Sales
Live Inventory

Finance
Book Keeping
Accounts Payable
Accounts Receivable
Expense Management
Assets management

HCM Employee Management App
Supply Chain App
Inventory Management App
Book Keeping App
Buy to Pay B2P App
Accounts Payables App
Accounts Receivables App
Vendor Management App
Help Desk App
Call Center App
Order Fullfillment App
Product Catalogue
Order Fullfillment App
Expense Management
Assets management
Warehouse Management App

Requisition -> Generate Req and auto PO
PO -> Request Inventory
Receipt -> Receive Inventory
Payables -> Setup Vendor
-> Voucher for Vendor
-> Pay Vendor
Receivables-> Setup Customer
-> Invoice for Customer
-> Receive
Sales Register

Reports

Inventory Cycle Count
Inventory Snapshot
report - On Hand Inventory
Payables -> Setup Vendor
-> Voucher for Vendor
-> Pay Vendor

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.