Creating a Firebase cluster structure

I want to create a structure like this in Firebase DB. The information from my registration system will come here. How do I do this in code? Example below.

Hi,
You mean block or this JSON structure inside Firebase?

If firebase, then copy this JSON and import inside your project bucket.

{
  "add": {
    "jack": {
      "device ide": "asdsad ad",
      "mail": "dasdasdadax",
      "password": "asdsadasa"
    },
    "username": {
      "device ide": "some_device_id",
      "mail": "user@example.com",
      "password": "hashed_password"
    },
    "another_user": {
      "device ide": "yet_another_device",
      "mail": "another@mail.com",
      "password": "another_hashed_password"
    }
    // ... more users with their unique usernames as keys
  }
}

Why?

He need real user details, I think you should explain how to generate this JSON with Kodular blocks not already made JSON, from sign up and store the user details in realtime database

I’m asking about the blocks

Hey @ozer_yesilyurt have you already implemented sign up method in your project. If not

Try it like this

When sign up success

Set firebase database project bucket to “add”

Call firebase database store value

               Tag "username"

Value to store, make a dictionary

            Key and value (eg key= email, value=example@gmail.com etc...

Add any details you want to store

About the device id you need to add device utilities component,

Am away with my laptop so am not able to show you the real blocks

His question was not clear that’s why, ask him question again and provide JSON structure.

Perhaps if he already implemented signup feature and If he can show his block, so i can help him more :grin:

1 Like

To insert the data in a single step, you’ll need to use the web component (the native component has some limitations, and I’d have to send each value individually).

This guide by Tim explains perfectly how to do it.

Hey RaYzZz

Can you demonstrate it to our dear Ozer? I mean with actual blocks :sweat_smile:

What I actually want is this: to take these data and both verify the username and remember the user so they don’t have to log in every time. For this, I want something like this: when a person clicks the login button, the data they entered in the text box will be taken and stored under the username—all the data will be saved under the username instead of saving them separately for each field.

I’m so sorry, I was leaving work and there was a bit of traffic.
Here’s how it should be done.


But I’ll tell you right away that saving passwords this way isn’t ideal, you should use FirebaseAuthentication to hide this data and make everything more secure.

It would be better to at least save them encrypted, like SecureBugs did here.

I gave an example where I wouldn’t save the passwords anyway. I already encrypt them with AES-256 encryption and save them to TinyDB, so I don’t take them.