Skip to content

Commit cce5bdb

Browse files
authored
Merge branch 'master' into feature/react-hook-form
2 parents fe103aa + f3cdc2c commit cce5bdb

20 files changed

+641
-108
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![ci](https://github.com/CreateThrive/react-firebase-admin/workflows/ci/badge.svg?branch=master)
44
[![license: MIT](https://badgen.net/github/license/micromatch/micromatch)](https://github.com/CreateThrive/react-firebase-admin/blob/feature/badges-rename-workflows/LICENSE.md)
55

6-
Boilerplate with React ⚛️ and Firebase 🔥designed to quickly spin up a fully functional admin dashboard with authentication, authorization, realtime database, built-in CI/CD, file upload and more. We're using up to date industry standards and next-gen technologies like React (with hooks), redux, bulma, sass, webpack, routing and a serverless architecture.
6+
Boilerplate with React ⚛️ and Firebase 🔥designed to quickly spin up a fully functional admin dashboard with authentication, authorization, Realtime Database / Firestore, built-in CI/CD, file upload and more. We're using up to date industry standards and next-gen technologies like React (with hooks), redux, bulma, sass, webpack, routing and a serverless architecture.
77

88
![Boilerplate - Users page](https://imgur.com/7jIt6jh.png)
99

@@ -54,6 +54,7 @@ React Firebase Admin is our in-house admin dashboard boilerplate, used in many o
5454
- Redux implementation
5555
- Firebase/Redux implementation
5656
- Authentication & authorization
57+
- Pick between Realtime Database and Firestore
5758
- Create/modify/delete users
5859
- Automatic email invitation to new users
5960
- Image uploading
@@ -64,6 +65,7 @@ React Firebase Admin is our in-house admin dashboard boilerplate, used in many o
6465
- PWA ready thanks to CRA and Firebase
6566
- Multi-tenancy
6667
- Internationalization (English/Spanish)
68+
- Ability to choose between Firebase Realtime Database or Firestore
6769

6870
## Tech Stack
6971

@@ -90,6 +92,7 @@ React Firebase Admin is our in-house admin dashboard boilerplate, used in many o
9092
- [cross-env](https://github.com/kentcdodds/cross-env) (★ 4.9k) run scripts that set and use environment variables across platforms (see [docs](https://www.npmjs.com/package/cross-env)).
9193
- [React Hook Form](https://github.com/react-hook-form/react-hook-form) (★ 14.6k) Performant, flexible and extensible forms with easy to use validation.
9294
- [yup](https://github.com/jquense/yup) (★ 11k) schema builder for value parsing and validation.
95+
- [Inquirer](https://github.com/SBoudrias/Inquirer.js/) (★ 12.2k) A collection of common interactive command line user interfaces (see [docs](https://github.com/SBoudrias/Inquirer.js/#documentation)).
9396

9497
### Unit Testing
9598

@@ -138,6 +141,7 @@ You also need to be familiar with [HTML](https://developer.mozilla.org/en-US/doc
138141
<li><a href="https://docs.react-firebase.com/getting-started#react-frontend">React Frontend</a></li>
139142
<li><a href="https://docs.react-firebase.com/getting-started/cloud-functions">Cloud Functions</a></li>
140143
<li><a href="https://docs.react-firebase.com/getting-started/continuous-integration-deployment">CI/CD</a></li>
144+
<li><a href="https://docs.react-firebase.com/features/database-interface">Database Selection</a></li>
141145
<li><a href="https://docs.react-firebase.com/features/internationalization">Internationalization</a></li>
142146
<li><a href="https://docs.react-firebase.com/features/file-upload">File Upload</a></li>
143147
<li><a href="https://docs.react-firebase.com/features/social-media-authentication">Social Media Authentication</a></li>

firebase.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
"predeploy": [
2424
"npm --prefix \"$RESOURCE_DIR\" run lint",
2525
"npm --prefix \"$RESOURCE_DIR\" run build"
26-
]
26+
],
27+
"source": "functions"
28+
},
29+
"firestore": {
30+
"rules": "firestore.rules",
31+
"indexes": "firestore.indexes.json"
2732
}
2833
}

firestore.indexes.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"indexes": [],
3+
"fieldOverrides": []
4+
}

firestore.rules

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
rules_version = '2';
2+
service cloud.firestore {
3+
match /databases/{database}/documents {
4+
5+
function isAuthenticated() {
6+
return request.auth != null && request.auth.token.email_verified == true;
7+
}
8+
9+
function isAdmin() {
10+
return request.auth.token.isAdmin == true;
11+
}
12+
13+
14+
match /users/{userId} {
15+
16+
function isIdentified() {
17+
return request.auth.uid == userId;
18+
}
19+
20+
allow read: if isAuthenticated() && (isAdmin() || isIdentified());
21+
22+
allow write: if isAuthenticated() && isAdmin();
23+
24+
allow update: if isAuthenticated() && (isAdmin() || isIdentified());
25+
26+
allow delete: if isAuthenticated() && isAdmin();
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)