I am building a personal finance mobile app that supposed to generate monthly reports, now I have a problem, confused about how to design the database to be monthly, I need the wallet to get archived after a month from the day it's created and transfer the remains/loss to the new wallet ( next month ) if exist.

enter image description here

Now my idea is to generate one wallet with xx money and let the user change the start date and make the mobile app automatically generate a new wallet every month on that day with the necessary transactions like there a loss/remain from the old wallet, and archive or prevent the user to make any transaction to the old wallets.

does my logic make sense or ...? ( Note I'm still learning and this my first app using SQL/Database so please be patient with me )

1 Answer 1


From what I'm understanding you need to design a database which will be record transactions of a user and draw some conclusion like a profit/loss at the end of a month. To achieve this you don't necessarily need to create a wallet every month this is just basic accounting. You will need Transaction table and Transaction_History_Log and Charts_Of_Accounts for more detail check this. Your Transaction table will have a one-to-many relationship to your Transaction_History_Log and Transaction_History_Log will have many-to-one with your Charts_Of_Accounts. So just basically you will need to record journal entries this will help you get a more understanding about what journal entries are in accounting. You can set a createDate attribute in your Transaction_History_Log to just get the a snapshot of month or a whole year or whatever the user likes.

  • Thanks for your reply, can you show me a diagram for this on drow.io, also I need the user to put his budget for the month so I guess it's necessary, and mostly you got it right I want to make a finance app that collects user expenses/income for the month and sum/subtract with his entered budget. my problem is I need to reset this budget every month and move the loss/profit from old to new after resetting if there any. Commented Apr 4, 2021 at 16:25
  • Sorry I have been really busy these previous days so was unable to reply. This is the diagram of what I was talking about [1]: i.sstatic.net/l5faK.png . Basically I'm just creating a User table which will hold a budget attribute that will determine the User budget and isActive attribute will determine if the user is actively using their current budget of the month. The CreateDate attribute will help me determine from and to date of the spendings he did and my transaction_details will do double entries such as debit and credit for any kind of transaction... Commented Apr 6, 2021 at 17:19
  • ... to fully understand this design you first need to study accounting and Chart of accounts hold which account is being debited and which is being credited that's all. This is just a rough idea you can make this design much more efficient and better just play around with it hopefully this helps. Commented Apr 6, 2021 at 17:21
  • @heshamshawky just tagging Commented Apr 6, 2021 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.