Simple ecommerce react js app with firebase.
npm installLogin into your google account and create a new firebase project here
Create a .env.prod file for production and .env.devfor development in the root of your project folder
and add the following configuration details. It can be found on your firebase project.
After setting up necessary configuration, create a Database and choose Cloud Firestore and start in test mode
npm run dev-servernpm run build- Inside
src/routers/AppRouter.jsuncomment all code related to admin. - Inside
src/reducers/authReducer.js, uncomment initState and change the initState type value from 'client' to 'admin'. DeleteinitStatevariable if you want to authenticate client. - Inside
src/sagas/authSaga.js, oncase ON_AUTHSTATE_FAIL, comment outyield put(signOutSuccess()). - Create a Storage in your Firebase Console.
- Set Storage and Database Rule to public, change
allow read, write: if request.auth != null;to onlyallow read, write; - Delete persisting auth state in localStorage if one exists. Revert on doing all these if you want to switch back to default user and when you are deploying the app
- Admin CRUD operations
- Firebase authentication
- Firebase auth provider authentication
- Account creation and edit