1

I'm thinking about creating my own budget app, but would like to share it with other users. My app is using Express+Mongoose(MongoDB) for the server side and Vue.js on the client side.

First, I try making a lot of research on this subject, but all I get is about the authentication process. I got this steps and I think I understand how to deal with it.

Right now, my database is build like this:

Collections:: Transactions | Accounts | Budget | Users

I would like to understand what is the standard, or the best practice about handling multiples users. I'm not thinking about a wide spread application, it is mostly for fun to understand how those concept works. I'm working on a proof of concept more than anything.

With the limit knowledge I have, I'm thinking about 2 ways I could solve that problem.

User collection with objects inside like this
{ User: Fred
  Transactions: [{id, Date, amount, account, etc}]
  ...

This version, in my mind, would be better at handling security where you have to match the user and you get all the information about him. I wonder, performance wise, if that make sense to do it that way, probably not.

The other version him thinking of is using the exact database I already have and adding a ID field inside of each of the transaction/accounts/etc to associate those with the users. When fetching my database, I could always make request with the matching ID of the logged users.

This is why I am here asking you for clarity. I don't know what to look up online. If you don't mind sharing your experience/knowledge on this, it would be amazing. But also, if you know a good website/video that would explain all of this, don't hesitate to share it with me.

Another helpful thing would be to tell me what this concept is called. As of right now, I'm only finding information about user creation, but not managing data.

Thank you!

Spy474
  • 23
  • 3

0 Answers0