Skip to content

Commit 1640268

Browse files
firebase init
1 parent abebf71 commit 1640268

File tree

8 files changed

+824
-7
lines changed

8 files changed

+824
-7
lines changed

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "the-dojosite-1017f"
4+
}
5+
}

firebase.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"firestore": {
3+
"database": "(default)",
4+
"location": "nam5",
5+
"rules": "firestore.rules",
6+
"indexes": "firestore.indexes.json"
7+
},
8+
"hosting": {
9+
"public": "build",
10+
"ignore": [
11+
"firebase.json",
12+
"**/.*",
13+
"**/node_modules/**"
14+
],
15+
"rewrites": [
16+
{
17+
"source": "**",
18+
"destination": "/index.html"
19+
}
20+
]
21+
},
22+
"storage": {
23+
"rules": "storage.rules"
24+
}
25+
}

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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
rules_version = '2';
2+
3+
service cloud.firestore {
4+
match /databases/{database}/documents {
5+
match /{document=**} {
6+
allow read, write: if request.time < timestamp.date(2025, 7, 16);
7+
}
8+
}
9+
}

package-lock.json

Lines changed: 738 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"@testing-library/jest-dom": "^5.14.1",
77
"@testing-library/react": "^11.2.7",
88
"@testing-library/user-event": "^12.8.3",
9+
"firebase": "8.5",
910
"react": "^17.0.2",
1011
"react-dom": "^17.0.2",
1112
"react-scripts": "4.0.3",

src/firebase/config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import firebase from "firebase/app";
2+
import "firebase/firestore";
3+
import "firebase/auth";
4+
5+
// Import the functions you need from the SDKs you need
6+
import { initializeApp } from "firebase/app";
7+
// TODO: Add SDKs for Firebase products that you want to use
8+
// https://firebase.google.com/docs/web/setup#available-libraries
9+
10+
// Your web app's Firebase configuration
11+
const firebaseConfig = {
12+
apiKey: "AIzaSyBxkbNgbW2wkWm2JgpXhHxePtkLBLyrgnE",
13+
authDomain: "the-dojosite-1017f.firebaseapp.com",
14+
projectId: "the-dojosite-1017f",
15+
storageBucket: "the-dojosite-1017f.firebasestorage.app",
16+
messagingSenderId: "419461092233",
17+
appId: "1:419461092233:web:6ffa8b1e334e282f428758",
18+
};
19+
20+
// Initialize Firebase
21+
firebase.initializeApp(firebaseConfig);
22+
23+
// init services
24+
const projectFirestore = firebase.firestore;
25+
const projectAuth = firebase.auth();
26+
27+
//timestamp
28+
const timestamp = firebase.firestore.Timestamp;
29+
30+
export { projectFirestore, projectAuth, timestamp };

storage.rules

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
rules_version = '2';
2+
3+
// Craft rules based on data in your Firestore database
4+
// allow write: if firestore.get(
5+
// /databases/(default)/documents/users/$(request.auth.uid)).data.isAdmin;
6+
service firebase.storage {
7+
match /b/{bucket}/o {
8+
match /{allPaths=**} {
9+
allow read, write: if false;
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)