A React TS project with Firebase Realtime Database
View Demo
·
Report Bug
·
Request Feature
Table of Contents
The app allows you to organize and save gift ideas, all neatly categorized by the recipients and the special occasions they're meant for. Never forget a birthday, anniversary, or holiday again, and always find the right gift at the right time.
I experimented with Firebase using React TS and Tailwindcss, I also was curious to try Vite.
The project is deployed on a Netlify server.
This is an example of how to set up your project locally. To get a local copy up and running follow these steps.
- Node.js installed
- Code editor — I prefer Visual Studio Code
- Google account — we need this to use Firebase
- Basic knowledge of React
-
Create a new realtime database in firebase admin
-
Using import JSON from the admin, add data.json file from this repo as a starting point
-
Publish your firebase project and get the config variables, it should look something like:
const firebaseConfig = { apiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", authDomain: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", projectId: "XXXXXXXXXXXXXXXXX", storageBucket: "XXXXXXXXXXXXXXXXXXXXXXXX", messagingSenderId: "XXXXXXXXXXXXXXX", appId: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", };
-
Clone the repo
git clone https://github.com/your_username_/Project-Name.git
-
Install NPM packages
npm install
-
Create a .env file and paste your firebase config variables into it
VITE_FIREBASE_API_KEY=******* VITE_FIREBASE_AUTH_DOMAIN=******* VITE_FIREBASE_DATABASE_URL=******* VITE_FIREBASE_PROJECT_ID=******* VITE_FIREBASE_STORAGE_BUCKET=******* VITE_FIREBASE_MESSAGING_SENDER_ID=******* VITE_FIREBASE_APP_ID=*******
-
Run locally your project
npm run dev
-
Check out the
http://127.0.0.1:5173/
on your browser
- Fetch data using onValue method
- Implement Edit & Remove & Add features for persons / gifts lists / gift items
- Deploy on Netlify
- Add authentication using firebase auth
- Enhance features
- Add photos to people list using firebase file uploads
- Add a datepicker to use dates on giftlists
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Project Link: https://github.com/davidschinteie/giftlist
Useful resources that I find helpful and would like to give credit to. I've included a few of my favorites to kick things off!
- How to Use Cloud Firestore in a React App
- How to Connect Firebase Realtime Database to a React app
- Firebase as simple database to React app
- Firebase documentation for Realtime Database
- Read, Write, and Delete Data from the Realtime Database
- Best Practices: Arrays in Firebase
- Fireship tutorial: Firebase - Ultimate Beginner's Guide
- Official Firebase tutorial: Getting started with Firebase for the web – Firebase Fundamentals
- Github Readme template