DEV Community

Cover image for Reactjs CRUD Firestore example
loizenai
loizenai

Posted on

Reactjs CRUD Firestore example

https://loizenai.com/reactjs-crud-firestore-example/

Reactjs CRUD Firestore example – Firebase Tutorial

Reactjs CRUD Firestore example – Firebase Tutorial

Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. It supports offline mode so our app will work fine (write, read, listen to, and query data) whether device has internet connection or not, it automatically fetches changes from our database to Firebase Server. So In the tutorial, I introduce an example “Reactjs CRUD Firestore example”.

– I draw a fullstack overview diagram architecture from Reactjs frontend to Firestore.
– I illustrate details about react-firestore CRUD operations.
– I implement Reactjs application to do CRUD request (Post/Get/Put/Delete) to Firebase Firestore.

Overvier Architecture Diagram – Reactjs CRUD Firestore

Overvier Architecture Diagram – Reactjs CRUD Firestore

Reactjs CRUD Application is designed with 2 main layers:

– React.js components let you split the UI into independent, reusable pieces, and think about each piece in isolation.
– Firestore Service is used by above React Components to fetch (Post/Put/Get/Delete) data to Firestore.

Reactjs CRUD Application defines 5 components:

  • Home.js is used serve as the landing page for your app.
  • AppNavbar.js is used to establish a common UI feature between components.
  • CustomerList.js is used to show all customers in the web-page
  • CustomerEdit.js is used to modify the existed customer
  • App.js uses React Router to navigate between components.

Integrative Project Goal between Reactjs CRUD Firestore

Reactjs Home page:

Reactjs Home page

Reactjs add data:

Reactjs add data

React Firebase CRUD Example – Adding customers

Reactjs List all data:

Reactjs List all data

Reactjs update data:

Reactjs update data

React Firebase Update customer

Reactjs delete a customer with id=2, check the Customer List after deleting:

Reactjs delete a customer

Check Firestore after do CRUD operations:

Check Firestore after do CRUD operations

Related post

Top comments (0)