DEV Community

John Dave Manuel
John Dave Manuel

Posted on • Edited on

Firebase CRUD

This is my first time to post here in dev.to since I joined to this awesome community, I spend most of my free time here instead of browsing in Facebook and it help me learn many things.

I created a dead simple CRUD operation using Bootstrap and Firebase, which you can find here

LINK
https://github.com/johndavemanuel/firebase-firestore-crud

DEMO
https://johndavemanuel.github.io/firebase-firestore-crud/

Alt Text

It is working fine as usual like

  1. Creating new data
  2. Reading data from server and update it whenever an action happens
  3. Editing existing data
  4. Deleting data
  5. Multiple delete of data

I an new to firebase and I am planning to add

  1. keyword search
  2. pagination (next and previous)

Any pull request or help will be appreciated.

Top comments (17)

Collapse
 
micahlt profile image
Micah Lindley

Perhaps we can use something like this in Checkmark... just need it to read and write to an HTML list instead of a table. 🤷🏻‍♂️

Collapse
 
johndavemanuel profile image
John Dave Manuel

How do you paginate your data in Checkmark?

Collapse
 
micahlt profile image
Micah Lindley

Hmmm... I’m not using pagination right now. All that’s being used is a lot of li elements. Every time you create a new task, the Javascript creates a new list item.

Thread Thread
 
johndavemanuel profile image
John Dave Manuel

I see. I am planning to create something like this

datatables.net/

take a look on the pagination with hint of items that is currently display

Thread Thread
 
micahlt profile image
Micah Lindley

Okay... the issue is that doing that kind of defeats the purpose of Checkmark. It’s meant to be a sleek and extremely simple checklist that is effortless to use and sync. If I use the table, I can’t use the same CSS (Materialize) that I’m using. It would be practical, but the main point of Checkmark is simplicity and elegance. Is there any way to accomplish Firebase dB communications without using a table?

Thread Thread
 
johndavemanuel profile image
John Dave Manuel

Yes, it is possible, the return of the firebase DB is like a JSON, so it is up to you what element you will use to display it.

Thread Thread
 
micahlt profile image
Micah Lindley

Cool! So really what I need to figure out is how to parse and create JSON to and from Firebase. Could you help me figure out how to do that?

Thread Thread
 
johndavemanuel profile image
John Dave Manuel

Basically, you need to sign up first, setup an account.

console.firebase.google.com

I just watch a Youtube video tutorial from The Net Ninja to easily figure out things, rather than reading.

Thread Thread
 
micahlt profile image
Micah Lindley

I’ve signed up to Firebase already (that’s how the sign-in is on the Checkmark page). What I need to know is how to let each user read, edit, and delete their own to-do’s in my Realtime Database. 🙃

Thread Thread
 
johndavemanuel profile image
John Dave Manuel

Ahh I see, my bad haha, currenlty I am still checking that feature because on my CRUD, I am also planning to add such feature

Thread Thread
 
micahlt profile image
Micah Lindley • Edited

Ah, okay! Well, if you find out how to do it, let me know or submit a pull request! I started your CRUD repository, so I’ll keep an eye on it! 😄👍 Also, try setting up Firebase auth: firebase.google.com/docs/auth/andr...

Thread Thread
 
johndavemanuel profile image
John Dave Manuel

I have never try it, seems it is an easy integration of 3rd party accounts

Thread Thread
 
micahlt profile image
Micah Lindley

Yeah! My Google auth seems to be having some trouble though- it’s probably just the fact that I’m making my Javascript up as I go and building most of my code from existing GitHub repos and Stack Overflow answers. 😂

Collapse
 
agilan96 profile image
agilan96 • Edited

did u find out the code where pagination and search works for this app...?
Please reply ASAP!

Collapse
 
sinhayzone profile image
sinhayzone

github.com/johndavemanuel/firebase...

the above link is no more available.....please provide the valid link

Collapse
 
johndavemanuel profile image
John Dave Manuel

ahh sorry about that, will change the repo ASAP

Collapse
 
agilan96 profile image
agilan96

Did u find out the code where pagination and search works for this app...?
Please reply ASAP!