Real-world grocery list application with SSO and persistent database via Firebase.
Testing React + Firebase as an alternative to the MERN stack, and improve application as I learn more. Demo deployed to AWS S3 + CloudFront via Github Actions.
- Vite v4.3.9
- React v18.2
- Tanstack Query v5.24
- Sass v1.71
- Firebase v10.8
- Development Server:
yarn run dev
- Build for Production:
yarn run build
- Production Preview:
yarn run preview
- Run Tests:
yarn run test
- Run Tests with Auto Fix:
yarn run test:auto
- Run Linting:
yarn run lint
- Run Linting with Auto Fix:
yarn run lint: fix
- Initial Setup for Husky:
yarn run prepare
- Sign up for Firebase and create Web App.
- Enable Firebase Auth (using both Email and Password & Google Auth)
- Under Firestore Database rules, copy/paste the following:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Grocery Items
match /items/{item} {
allow read;
allow create: if request.auth != null;
allow delete: if request.auth != null;
allow update: if request.auth != null;
}
// Users
match /users/{user} {
allow read;
allow create;
allow update: if request.auth.uid == user
}
}
}
-
Clone or fork repository and copy example.env to .env and add your Firebase application credentials
-
To start the development server, run
yarn run dev