npm install firebase
REACT_APP_APIKEY= '...'
REACT_APP_AUTHDOMAIN= '...'
REACT_APP_DATABASEURL= '...'
REACT_APP_PROJECTID= '...'
REACT_APP_STORAGEBUCKET= '...'
REACT_APP_MESSAGINGSENDERID= '...'
REACT_APP_APPID= '...'
REACT_APP_MESUREMENTID= '...'
If you don't know where to find the values you can go to Project settings > General > Your apps.
localhost
and all the other domains.// Allow read/write access on all documents to any user signed in to the application
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId}{
allow get, create, update: if request.auth != null && request.auth.uid == userId;
}
match /Collections/{collection}{
allow read;
} }
}
users
.Collections
, every collection has two fields:title: string;
items: {
id: number;
name: string;
description: string;
firstImageUrl: string;
secondImageUrl :string;
thirdImageUrl: string
fourthImageUrl: string;
colors: string[];
size: number[];
newPrice: number;
oldPrice: number;
orders: number;
rate: number;
}[];