In this livestream, I’m continuing work on the Money Manager app for the #notJustHack challenge. Today’s focus is on improving and adding features to the app...
पूरा वीडियो ट्रांसक्रिप्ट
1s: what's up not developers welcome back to
3s: another live stream today we're going to
5s: continue building a money management
7s: application in rack native and this is
11s: part of my journey of building four
13s: applications in four weeks today we are
16s: building the last app for this CH from
18s: this Challenge and we already started it
21s: yesterday so a lot of things uh
24s: interesting coming up and I'm doing this
26s: for not just hack if you don't know this
29s: is our hackathon that we are organizing
31s: for mobile developers happening this
34s: December there is still time to uh build
37s: and participate because all you have to
39s: do is build an app and launch it to the
41s: market during this December
44s: 2024 and then submit your entry by the
47s: 31st December the deadline and you have
50s: a chance to win uh amazing prizes like
52s: this more information about hackathon
54s: you can find at noes hack.com and while
57s: you're V make sure to sign up to receive
59s: important
60s: information quick announcement the
63s: submission form is already open so if
65s: your application is publicly available
67s: on up store or on play playm market you
71s: can go ahead and submit the URL for the
74s: hackathon so that we will review and you
76s: have a chance to
77s: win the deadlines for the hackathon is
81s: 31st December so after that moment no
84s: more development is allowed on the
86s: application however we extended the
88s: deadline for submitting the application
90s: until 14th of January where and that's
93s: when the submission form is going to be
95s: closed during this period from 1st of
97s: January until 14th of January only fixes
101s: related to UPS or rejections are allowed
105s: and this is a way for um to give
108s: everyone the chance to go through that
110s: last process of getting the app uh
113s: approved by Apple and Google or Google
117s: so make sure to remember these days they
120s: are very important uh after December
122s: 31st no more development is uh allowed
125s: on the application to allow everyone the
127s: same amount of time for development and
130s: for submitting you have it until
132s: 14th now my plan during this period is
136s: to build four applications in four weeks
138s: and to stream everything the whole
140s: process daily on our YouTube channel so
143s: if you enjoy this process make sure to
145s: subscribe to our channel that helps us a
148s: lot and now now we are currently
151s: building a forth
153s: application and as I was saying we
156s: decided to build uh where is my planning
158s: we decided to build for the fourth
160s: application a finance application a
163s: personal finance application that will
165s: help you manage your money budget track
167s: uh your netw worth and so on I found
171s: like some interesting keywords that I
172s: would like to uh to compete for and I
177s: break down some of the featur that the
180s: ultimate solution would need and then I
182s: broke down the features that i' would
184s: like to have for the
187s: MVP for
189s: MVP MVP is the first version that I'm
192s: going to release to the store which
194s: should provide value uh based on what
196s: I'm trying to to Pro to to based on the
199s: keywords that I want to rank so if it's
202s: a money manager it should provide some
204s: value in and help you manage your money
208s: so we already started the app
211s: uh we started with tracking your income
213s: sources so you can go ahead and add for
215s: example your normal salary you enter
219s: what is usually your
221s: salary um and then you say passive
224s: active and so on and you create the
226s: income source and you see it here today
228s: we're going to yeah we can also delete
232s: them this also has been done
235s: yesterday uh today we're going to
237s: continue working on this application
239s: adding more Fe features and deciding to
241s: ever like what the direction where this
244s: application is going to go so that's
246s: what plan and before I started uh
249s: building the application I just want to
251s: remind you that recently a couple of
254s: weeks ago we launched the rec native
256s: Mastery course this is the course that
259s: teaches you how to build applications
263s: that with a stack that are used for
265s: applications from the top charts and
267s: here I'm talking about rack native Expo
270s: Expo router typescript and a lot more
273s: tools that goes into building production
275s: ready apps the course is split into into
278s: seven different projects so you're going
280s: to learn by building and we already have
282s: a lot of happy students more than 150
286s: already that uh and if you are
288s: interested make sure to follow it at no.
291s: d/r native Mastery now back to the
295s: hackathon and back to what we're doing
298s: here hello everyone who is joining us
300s: live how are you doing guys hello hello
304s: hello Imad I see the tier from Barcelona
307s: I hope that you're not going to see me
309s: walking uh walking my dog like during
315s: mornings um hello Derek from Congo how
319s: are you
321s: doing hello
322s: DJ from Brazil
330s: hello anub how are
334s: you how very saying I submitted my uh I
337s: submitted my form yesterday night my app
341s: is up and running in app store since I
343s: renamed it is only one with that name in
347s: Canada I wonder if it's the same case in
349s: Spain that's amazing however I'm very
352s: happy for that we already have uh
356s: applications uh submitted so happy to to
359s: see see that cannot wait to to start
362s: testing the applications but that's
364s: going to happen like in
366s: January hello Jamie how are you second
369s: up MVP almost done I think this is the
371s: one I will submit for a heaphone if it
374s: gets approved in time amazing what is
376s: the second application
379s: about hello from Ukraine hello yav I'm
382s: actually from mova so we are neighbors I
386s: don't live in mova right now but I'm
388s: originally from there my family is
395s: there so what's going to be our plan for
398s: today we have the ability to do the
400s: income
402s: sources I think I wanted to do some kind
405s: of
408s: um can I start making up from now onward
412s: uh so the short answer to this question
414s: can you start participating now the
417s: answer is yes because you to today is
420s: 24th of December and the deadline for
422s: development is 31st December so you have
426s: a week of development and I if you think
429s: that you can achieve an MVP in a week uh
433s: that depends on your skills like if you
436s: can do it I highly encourage you to do
439s: it and when you have like two weeks
444s: already in that two weeks you don't you
447s: cannot develop new features but you can
449s: and go ahead and submit the application
451s: to the
454s: store you got to know about it yesterday
456s: so yeah how um how is your confidence
459s: like can you build an app in a
463s: week hello from Morocco hello Salah I've
466s: been to Morocco I've been to
475s: Casablanca let me bring let me bring the
485s: um this
488s: one
490s: here which is my
500s: planning chart for income sources
504s: individual
509s: totals let's do totals at least totals
512s: and then we're going to think about
516s: charts um so I'm thinking about doing
518s: totals two totals maybe the total itself
522s: of all the income sources somewhere at
524s: the top and maybe based on the active P
528s: passive and so
529s: on so let's try to do that um income
535s: sources in the
537s: index what do we have have here here we
540s: have database
542s: select income
547s: sources I'm wondering should I do
549s: another query to the server or I do here
553s: const
555s: total income and do a
564s: reduce and that is expected amount
571s: what is
572s: the expected amount is a string why
575s: expected amount is a
581s: string why is our expected amount a
594s: string
596s: sorry so this in
601s: sources
604s: columns how can I see what is the type
606s: of that column if I look at our
610s: source database schema expected amount
614s: is
620s: numeric why is it a string
649s: if I do here
651s: in
655s: int what is going to be it's going to be
658s: Z
663s: number let me see SQL light data types
668s: on drizzle sqlite data
680s: types n integer real I need real we have
685s: native support for all of them yet if
687s: it's not enough
689s: all examples in this part of
691s: documentation do not use database column
698s: name I don't need integer here floating
701s: I need a real yeah so I think it
706s: shouldn't be numeric it should
709s: be
717s: yeah okay now now this is a
721s: number here is it going to be a
726s: number might not work because I might
728s: need to do
731s: a total income let me see in the new
736s: when we create
741s: something yeah I think it's it's going
743s: to
744s: fail income sources new
749s: test one two3 dot
755s: 5 expected number received
759s: string that was I was
763s: expecting because because we here we
767s: have income sources schema that is
770s: coming from here and I think I will do
773s: expected amount is going to be s dot I
777s: think I will do call ER
781s: can I do
795s: that maybe I'm going to overwrite it
797s: completely as
800s: Z course
802s: number and in this
805s: case it has it worked
809s: income
819s: sources okay I think it
825s: works good so now in our
829s: index we have total income and I
833s: probably can do here at the top as a
839s: list header
842s: component total income something like
853s: that
863s: okay Jamie saying it is some stats
866s: widget for my favorite sport hybrid app
869s: with rective and Swift That's nice i'
872s: would love to see
875s: that do you get the data from
885s: somewhere can you just give a glance for
887s: the development of a language
893s: translator what exactly are you
895s: interested in
901s: are you using a backend for this
902s: application if not how much information
904s: can a local repost store I'm not using a
907s: backend I'm using a local sqli
911s: database and how much information you
913s: can store I don't know is as much as the
917s: phone storage can can
922s: hold but for this kind of data like it's
925s: probably going to be very hard for one
927s: user to produce so much
936s: data uh a is asking about uh Hey I want
941s: to launch the question let me address
944s: it hey I want to launch my application
947s: on the Play store but I recently came
949s: across the two weeks beta rollout stage
951s: for Google Play Store will it be fine if
954s: a submission is on beta unfortunately no
957s: the submission should be the application
959s: should be public on the stores on app
963s: store or Play Store so no beta no test
967s: flights and so
968s: on however for the two weeks we
971s: specifically offered you two additional
974s: weeks for the submission only so no more
978s: development after 31st December but you
981s: have two weeks until 14th of January to
984s: fix and figure out the submission so you
987s: have time even if if you stop coding on
991s: 31st December and you put it in uh in
994s: the beta you have two weeks to finish it
997s: and submit your
999s: entry hopefully that
1015s: helps uh let's um let me ask CH
1028s: the for the total income
1033s: let's render it as a box with a big
1039s: number small label
1052s: let's see how this is going to look
1055s: accept income sources okay yeah that's
1058s: what I was I had something like this in
1062s: mind total income
1082s: I can go ahead and also do by groups
1086s: so
1093s: um let's ask just not to overthink let's
1096s: do this um calculate the income by Group
1103s: by group or how is it called by category
1118s: and then let's do
1122s: here render incomes by
1126s: category also in the header component
1142s: let's see what this is going to look
1145s: like income
1152s: sources okay that's
1160s: good uh let's do here Gap three
1177s: near the income by
1179s: category add a percentage from
1197s: Total let's do that
1198s: [Music]
1206s: that
1220s: mhm
1222s: um what if we put these two boxes in the
1224s: same row Flex row
1242s: and what if I add here Flex
1245s: one and here Flex
1253s: one and let's do
1260s: restructure their incomes by
1265s: category uh BX
1269s: to account for smaller
1279s: wi let's see what that is going to be
1281s: done
1296s: yes maybe we of total and it's going to
1299s: be
1310s: good I don't think we need the text
1313s: itself
1336s: I'm going to restructure some stuff a
1338s: bit
1343s: here we have a text
1345s: category I would put
1349s: I'd restructure it a bit I'd put here in
1352s: a
1353s: view that
1360s: category and
1362s: the and this
1365s: one and I would put this one
1372s: here
1374s: uh Flex row
1380s: and items
1383s: Center or maybe not items
1391s: Center yeah something like that
1419s: should I just do math.
1434s: round yeah kind of like this
1459s: I
1469s: in my heart is a Christmas tree farm
1471s: where the people would come to dance
1473s: under sparking
1481s: lights maybe here text Excel
1499s: not sure if space Y is doing anything
1501s: here border I don't think it's doing
1504s: anything
1505s: here last
1508s: border border Gray
1547s: ashin you're welcome very nice all right
1550s: give me one second guys I'm going to
1552s: take a very short break and then we we
1557s: continue for
1605s: okay do I have water yes I have
1609s: water let me go ahead and do
1612s: um get
1616s: OD get
1636s: commit all right so this would be here
1640s: the totals we have and charts and so on
1645s: we don't have it next step probably is
1647s: going to be around like budgeting like
1649s: having these income
1653s: sources how are we allocating them each
1657s: month like something goes for savings
1660s: something goes for Investments something
1662s: goes for day byday expenses something
1666s: for
1668s: mortgage and so on
1675s: right so let's go ahead and start
1679s: probably working on this one this part
1682s: of allocating money and in same way as
1688s: income
1689s: sources is a prediction of incomes
1693s: budgets are a prediction of
1697s: expenses so in a way income
1701s: sources expected incomes
1709s: budget this is allocation or
1713s: expected um
1719s: expenses so let's do the same we're
1722s: going to do here what uh
1726s: budget
1729s: budget Let's do an index file where
1732s: we're going to display the
1735s: budget and the new
1738s: TSX for the budget
1742s: form I'm going to reuse a lot of the
1745s: stuff that we have in our forms so I'm
1748s: going to move fast because again like
1750s: this are not tutorials this is me
1753s: documenting the Journey of building
1754s: these apps if you want tutorials like we
1757s: have a lot of those on the
1760s: channel but when it comes
1764s: to uh data model let's do budget
1769s: we still going to have a name we're
1771s: still going to have the amount or
1774s: expected
1780s: amount
1792s: um yeah for now probably that's it let
1796s: me also talk with charb to to see what
1798s: he
1800s: thinks now we are uh working on the
1806s: budgeting
1808s: feature this would be
1813s: the
1815s: allocation of
1819s: incomes
1823s: um
1826s: what how do you see this
1832s: feature let's say maybe it's going to
1834s: have like some other ideas that I don't
1839s: have very expected or actual incomes
1842s: effectively while maintaining a clear
1843s: overview of financial goals here is how
1846s: you can Envision the
1848s: features allow users to allocate incomes
1850s: to specific categories or goals
1853s: providing a clear picture of how they
1854s: plan to use their money
1860s: savings Investments R micromanaging
1863s: small expenses
1867s: yeah core
1872s: components predefining custom categories
1876s: Essentials rent groceries utilities
1879s: financial goals savings Investments That
1884s: repayment lifestyle entertainment travel
1887s: emergency
1889s: fund users should also be able to add
1892s: custom
1894s: categories users can allocate a
1896s: percentage or a fixed amount of their
1899s: total income to each
1902s: category okay that's also interesting
1905s: amount
1907s: or like fixed amount or percentage
1910s: amount source of fun link allocation to
1913s: a specific income Source or total income
1918s: display visual breakdown of allocations
1921s: progress bar show how much of each
1922s: allocation has been utilized or saved
1925s: during the budgeting
1927s: period allow users to set a time frame
1929s: for their
1930s: budgets weekly monthly quarterly
1936s: custom category name rent savings
1941s: travel allocated amount amount or
1944s: percentage of income allocated to this
1946s: category time frame
1949s: monthly linked income sources
1965s: notes okay so the name is
1970s: the yeah the category name right for
1974s: example rent savings travel
1982s: uh
1983s: predefined
1990s: categories allocated amount uh this is
1994s: going to be either fixed
1998s: amount or percentage amount
2010s: time frame um probably like for me like
2013s: everything is going to be
2020s: monthly I don't think I will link
2022s: anything
2029s: here calls for these categories
2034s: noes noes but I will also not to
2037s: implement
2058s: them um
2088s: R savings Investments travel and so one
2107s: how should I handle the fixed and uh
2112s: percentage
2114s: amount allocation
2138s: we can toggle D if user allocates a
2140s: percentage of your income the allocate
2142s: amount should automatically update a
2143s: user adjust VI income all percentage
2146s: based category should reallocate
2147s: proportional validation and limits
2149s: prevent over
2152s: allocation warn about underallocation
2155s: implementation
2161s: budget categories for each category
2163s: allow user to allocation type fixed or
2167s: percentage enter the amount or
2175s: percentage percentage alloc of remaining
2179s: income uh not
2186s: sure e
2238s: allocation type amount calculated
2242s: amount percentage or fixed value Dynamic
2245s: calculate for percent
2250s: um on that
2254s: database isn't it better to have two
2259s: Fields
2261s: fixed
2264s: amount and
2267s: percentage
2271s: amount thinking how is going to be
2273s: better on the back end
2291s: calculated amount
2320s: okay so I think I have something fix
2322s: amount percentage amount I don't think
2324s: I'm going to store the calculated amount
2325s: I think that's going to be on demand
2327s: like on the Fly
2337s: I found a couple of apis that provide a
2339s: bit of data and I created their rest
2342s: then I made my own back and API that's
2344s: nice amazing cannot uh wait to to see
2348s: it so let's go ahead and start by
2350s: defining the data structure I'm going to
2352s: go into our source database
2355s: schema and here I'm going to have to
2357s: duplicate this income source for the for
2360s: the new schema but I'm thinking about
2362s: going into drizzle and seeing how I can
2364s: separate everything into
2368s: um
2371s: tutorials schema into multiple files you
2375s: can declare your SQL schema directly in
2378s: typescript either in a single schema. TS
2380s: file or you can spread them around
2382s: whichever you prefer all the
2384s: freedom the most common way to declare
2386s: your schema with treel is to put all
2388s: your tables into the schema. file
2398s: with this configuration dzel will read
2401s: from the schema file and use this
2403s: information during the migration process
2406s: from okay schema in multiple I think
2408s: that's what I want to
2410s: do I will go ahead and I will create
2412s: here a folder called
2415s: schema I'll move this one here and call
2419s: it
2422s: um income
2426s: sources schema should I do schema or no
2429s: income
2438s: sources and in the drizzle config file
2440s: you need to specify the puff to your
2442s: schema folder with this configuration
2444s: drizzle will read from the schema folder
2446s: and find all files recurs and get the
2448s: dzel table from there so schema is going
2452s: to be here so in drizal config schema is
2456s: here but with a.s file is going to be
2459s: the
2461s: folder you can also group them in a way
2464s: you like such as creating groups for
2466s: user related messaging
2483s: okay okay so now I can go ahead and
2486s: duplicate this income sources
2488s: for
2491s: Budget let's
2494s: do budgets table let's call
2498s: it
2502s: budgets uh it's going to have ID it's
2505s: going to have name and it's going to
2510s: have fixed
2513s: amount or it's going to have
2520s: percentage and V can be null so I'm
2523s: going to do just real like this and no
2527s: category maybe for future let's do Tech
2530s: nodes maybe I'm not going to do them now
2532s: but just having with
2534s: the the column there maybe in the income
2537s: sources as
2540s: well name fixed amount
2545s: percentage now for we insert schema
2547s: let's call it budget insert schema
2550s: create schema it's going to be based on
2552s: this
2553s: table the
2555s: name name is
2558s: required expected amount is going to be
2561s: fixed amount of
2563s: type uh the course number expected
2568s: amount is
2569s: required
2571s: percentage it's going to be I think the
2574s: same thing as here
2577s: but look uh fixed amount can actually be
2580s: [Music]
2582s: null
2587s: um think it's optional but the minimum
2590s: like if we provide
2603s: it we're going to see
2608s: fixed fixed
2610s: amount should be greater than
2625s: zero maybe
2635s: positive and percentage
2637s: as well it's optional so but the maximum
2640s: is going to be
2645s: 100
2648s: uh percentage should be less than 100
2651s: maybe minimum zero or
2659s: positive we're going to see
2662s: that and here the budget is going to
2670s: be this
2673s: one okay good now let's go inside our
2677s: application
2679s: budgets in the
2683s: index well we're going to have something
2685s: similar to here
2689s: so maybe I will copy some stuff
2694s: here and I will just come back and and
2696s: up update some some of the
2700s: things uh the income sources is going to
2702s: be income sources in the new as well
2706s: something changed here how we
2717s: import for now it's think I'm sources
2720s: but I'm going to change it in a second I
2722s: want to focus first on the
2731s: budgets on the budgets SL
2735s: new and in the Slash new I'm going to
2738s: have something like
2740s: this let me reload just get on that page
2743s: and then update
2751s: stuff and I think I need to do uh npx
2757s: dzal
2758s: kit generate to generate the we
2762s: migration file adding a
2765s: new
2766s: table now let me do ahead and do npm
2772s: start then
2780s: reload income Source
2784s: item here should be income source
2792s: so I want
2795s: to on the index
2798s: here I'll have another
2801s: button for
2808s: budgets that is going to be another
2812s: link for budgets
2837s: so if I click on budgets I'm going to go
2840s: here it still displays not what I need
2842s: but I'm going to fix it later but if I
2844s: go on the new I have new income source
2847s: okay let's go into the budgets
2849s: index and start with this TCH do screen
2854s: why is it R going maybe it's going in
2857s: the right place but here we need to say
2860s: new
2863s: budget so budgets plus new
2868s: budget and we are going to slowly move
2870s: from creating an income source to
2872s: creating a
2873s: budget for that I'm going to start by
2876s: importing
2877s: from budgets the budgets
2880s: table budgets insert schema and budget
2887s: type now the form is going to have type
2890s: budget and here I'm going to put the
2892s: insert
2894s: schema default
2897s: values probably
2902s: nothing uh create
2908s: budget mutation of data is going to
2911s: receive a budget and we're going to do
2914s: DB insert into the budget table these
2922s: values on success invalidate probably a
2926s: query with budget the key
2930s: budgets fail to
2933s: save
2935s: budget on submit this is going to be
2940s: budget we're going to do create
2945s: budget now in the form provider we need
2948s: to do a custom text input for the name
2950s: of a budget name
2953s: enter
2955s: budget
2960s: name this is already like different
2962s: because we're not working with expected
2964s: amount we are going to work with
2968s: with where is
2970s: it I'm going to open the budget
2974s: schema and
2976s: we budgets
2981s: new here so I'm going to work with fixed
2988s: amount enter amount or with
2994s: the percentage amount
2999s: going to think how to switch between
3014s: them we don't have any
3017s: category maybe we're going to
3020s: have custom text input for the notes
3036s: so let's see what the new field looks
3040s: like name fixed amount percentage amount
3042s: notes I do create income Source we see
3046s: required expected number received not a
3048s: number expected a number re note and
3055s: number uh
3071s: okay how I'm going to do that
3076s: one first of all how I'm going to switch
3079s: between fixed or percentage amount
3101s: how to toggle between a fixed or a
3114s: percentage Yeah Vladimir I use for
3116s: example if I go to here as you can see
3120s: this is the zigo
3137s: menu for the UI of the form how to
3143s: better handle the percentage and fixed
3166s: amounts tole
3177s: fixed amount field with currency symbol
3180s: or percentage input with suix
3217s: oh this is a nice
3220s: wireframe oh my
3234s: God so basically we need here uh some
3238s: kind of a
3246s: toggle create a toggle
3252s: for
3254s: between
3256s: two
3260s: values
3264s: fixed amount
3267s: and
3270s: percentage
3274s: amount it's going to be a custom picker
3277s: I don't want a custom picker I want
3280s: something
3290s: else for the budget type toal
3296s: instead of using a custom Pier let's
3301s: design a switch
3309s: uh maybe
3313s: hor
3315s: aligned and
3337s: let's see what that is going to
3339s: do accept budgets
3343s: new yeah I think something like that
3345s: would be nice
3366s: am I going to handle the budget type on
3367s: the form I don't know to be
3375s: honest but based on this we're going to
3378s: either display one field
3382s: orever
3385s: so and the question is should I handle
3388s: it there or
3393s: not new budget
3399s: screen so maybe that is going to be a
3401s: state
3416s: that we're going to do on
3445s: press for
3481s: so if I go here fixed percentage now
3484s: this is a
3502s: state and I will render this one
3506s: if budget
3510s: type equal to
3514s: fixed I'll render this one and if it's
3517s: percentage I'll render this one so fixed
3520s: amount percentage
3529s: amount okay so if I
3534s: reload bu just
3537s: new I don't know
3541s: savings and I'll do percentage
3544s: 20 create it doesn't work because I
3548s: think the
3549s: custom even if it's not there I'm going
3552s: to look at the
3555s: errors for example I will do console log
3559s: errors and if I do create we're going to
3561s: see fixed amount expected number
3565s: received not a number
3569s: number so here
3572s: we
3584s: fixed Z cursed number
3595s: optional for
3634s: set as value so if it's empty string to
3639s: do undefined or otherwise do paren
3663s: Z number in positive mean or Z none and
3668s: then
3672s: optional so that would mean what that
3676s: would mean the union
3680s: between
3684s: V or a
3688s: zon and it is
3693s: optional will that work so if
3700s: now income
3703s: sources
3706s: budgets if I do ABC here this is not a
3712s: number expected number received none
3716s: but if it's like
3722s: this fix amount should be greater than
3725s: zero
3764s: no it doesn't really work
3792s: number then
3803s: optional so what that is going to do to
3811s: it budgets
3813s: new working with fixed amount if now I
3817s: do create everything is good if I do a
3822s: expected number if I do empty string it
3825s: doesn't have error if I do one two three
3828s: it works
3830s: maybe negative numbers are not working
3838s: but that's not a big problem at least it
3841s: works like
3846s: this
3853s: not so if I do ABC
3866s: expected
3867s: [Music]
3874s: number oh I need uh error
3878s: map inpe
3903s: well I'm going to leave these errors as
3904s: they are not going to override anything
3907s: for
3909s: now but and I'm going to do the same
3912s: here I'm going to do it
3916s: optional do
3919s: optional
3921s: so now if I go here budgets new I can do
3926s: fix amount 100
3930s: a I'm going to create it I'm going to do
3935s: B percentage
3939s: 123
3941s: create and if I look at the
3946s: data in the budgets I have fixed amount
3949s: 100 and this one is 123
3953s: percentage perfect but but what happens
3956s: if
3960s: I uh if I
3962s: say one two three fixed amount then I go
3965s: here and I say one two three here and I
3967s: say
3968s: ABC it's going to have a both both of
3971s: these values both here and here in this
3974s: case it's going to be hard to know which
3975s: one exactly it is so I think what we
3978s: should do is when we switch
3986s: or
3991s: um we have a
3998s: data look what I'm going to
4005s: do I can return
4011s: here I will do if
4018s: or
4022s: null or maybe
4026s: undefined so I'm going
4031s: to if budget type is fixed I'm going to
4035s: take the no if if it's
4039s: fixed I'm going to reset the one for for
4042s: undefined and otherwise I'm going to
4044s: reset the one for
4056s: fixed so when I go here I can say one to
4060s: three fixed I can go here and say 10 if
4063s: I come back it's still
4065s: saved but it's going to only save the
4068s: one on which budget type we are so
4073s: percentage save
4076s: if I reload it should have null
4079s: for yeah here it's 10 here it's null and
4083s: the same things should happen here if I
4084s: do 1 two three 10 but then come back
4088s: here it's only going to save a fixed
4092s: amount it's only going to save this one
4095s: okay good so this is our budget
4099s: creation
4102s: uh form
4114s: and now on the index what I need to do
4117s: is I need to say hey this is a
4122s: query from called budgets we're going to
4126s: take information from
4132s: budgets budget table
4139s: good now I'm going to comment out a
4142s: little bit with totals and so
4145s: on these are going to be called
4148s: budgets
4151s: our flat list is going to work with
4159s: budgets this one is going to be budget
4163s: item which we're going to implement m in
4165s: a second and for the header we are going
4168s: to comment out for a
4177s: bit and let's go ahead form in the
4183s: components as we have an income Source
4185s: item let's duplicate it and call it
4198s: budget
4201s: item it's going to be budget
4205s: item of
4208s: type
4220s: budget now there is a delete budget
4241s: and we're going to invalidate the
4248s: budget here we have a name we have the
4253s: dot fixed amount
4258s: or percentage amount so we're going to
4260s: see which one we
4271s: have or maybe it should be
4276s: here fixed
4279s: amount or it's going to be this one so
4283s: we're going to see which one
4287s: delete
4289s: budget so let's see if I go now to a
4292s: budgets will it work and probably not
4295s: yet because in the index here we need to
4299s: import
4301s: it and now it should be a b c and so one
4305s: with this data and I can go ahead and
4308s: delete one of them ABC yes it
4312s: works and if I come here yeah it works
4315s: all right so in a second we'll come back
4317s: and we were going to improve a little
4319s: bit his budgets and then we
4344s: continue
4374s: for e
4426s: going to be back
4456s: hello um okay what's up with this
4460s: typescript error if I go here
4482s: this one can also be what
4486s: any I don't know why it doesn't
4511s: uh I don't know
4526s: so um in the budget item here we need to
4530s: display either
4532s: the need to display the budget
4544s: name
4547s: improve the budget item
4551s: [Music]
4552s: view to
4560s: based on the data
4564s: structure a budget can have either fixed
4571s: amount or
4573s: percentage amount
4598s: I have this uh it's hard for me to even
4601s: like focus on how to to explain it
4615s: what this is going to
4635s: do if it is percentage
4640s: based we need to show that and also
4645s: calculate
4647s: the
4653s: fix uh
4659s: number based on a
4673s: to for
4719s: I want
4720s: to uh keep the items
4725s: consistent and
4727s: display for all of them both the number
4734s: and the
4736s: percentage in the right part of the
4741s: component
4767s: what that is going to
4770s: do
4789s: budget okay
4805s: let's accept it and then we're going to
4808s: see how we what we can do better
4844s: it's csor Pro Plan worth it for
4847s: developers I'm still not sure I'm I
4851s: don't get like super crazy amount of
4854s: value
4855s: but I feel that I need to customize it
4858s: better so I think it's like Case by case
4862s: like I can I don't have like the the
4864s: right
4866s: answer as you can see like yeah I'm
4868s: using it maybe not always but yeah
4870s: sometimes I
4877s: do 10% of income
4892s: [Music]
4903s: I don't think I even need the the think
4906s: in the right like the where is it the
4909s: end
4913s: design and why render Mount it's like
4924s: that not the best but yeah
4947s: can we
4949s: refactor uh the code to Not Duplicate
4955s: the
4956s: rendering
4959s: parts so
4962s: much calculate and store the data in
4968s: variables then render ones
4985s: why do you need the render amounts
5000s: function let's see if this is still
5003s: going to work except
5007s: hopefully it
5009s: works
5016s: budgets
5022s: okay dummy total income
5046s: okay like this it's quite clean at this
5051s: moment I'm going to go here and say
5055s: text
5058s: LG I don't think we need this and design
5061s: anymore
5082s: okay okay let's go now what I'm going to
5086s: do is I want to calculate some of the
5090s: allocations like if everything is
5091s: allocated or not for example in income
5094s: sources here we have a total
5100s: income should I do
5104s: this in a
5107s: query instead of querying them should I
5111s: do that on a database
5115s: layer can I
5118s: do use Query
5121s: equal I mean use Query query
5125s: key
5127s: total
5130s: income
5139s: sources income sources and
5144s: then income
5147s: sources then total amount
5155s: and the query function can be what
5159s: database
5208s: query the sum of
5223s: select T what's going what's happening
5240s: here where do have to select
5258s: uh
5260s: d uh
5269s: some aggregations
5276s: account group bu
5321s: average sum return the sum of all known
5323s: values in expression so I can do DB
5327s: select value Su userid from
5332s: users um
5336s: okay so it's going to be something
5339s: like DB
5346s: select value it's the sum
5354s: of of income sources
5357s: dot expected
5360s: amount and that's it
5365s: and this sum should be
5375s: imported and let's see if it still
5378s: works if I go to income
5381s: sources doesn't work
5386s: because cuz this is a
5391s: syn so this one is object
5396s: object total income do
5400s: value total income do value
5424s: total income do
5452s: value for
5497s: yeah I think here I'm going to have to
5503s: do
5505s: const uh rows equal to a
5508s: weight and I will do return rows. value
5513s: and this is going to be the total income
5515s: as a
5519s: value or zero we can also
5526s: do or maybe to do one not to divide by
5532s: zero let's do zero
5547s: string zero or undefined why is it
5550s: string
5582s: why is it as a string with
5590s: Su can I do it as
5600s: number and I think like this function I
5603s: could take it into some utilities or
5606s: Services new folders
5610s: services and I will create a folder for
5613s: income
5617s: sources and let's do I'll start with
5620s: index.ts and I'm going to have this
5622s: function here let's call it
5626s: const uh I will actually do a normal
5628s: function constant
5631s: sync function get total
5637s: income
5641s: sources get total income sources
5651s: amount let's do export
5660s: default here we need a database we need
5663s: some
5664s: we need the income sources
5667s: table and that's
5669s: it so I can take this function and send
5673s: it here to query function like
5679s: this because I need it in other places
5681s: as well and where I need it is basically
5685s: in the budgets
5686s: index I'm going to need here the total
5690s: income
5697s: and I'm going to take this total income
5699s: I'm going to send it as a property to
5701s: our budget
5703s: item because in the budget
5709s: item in the budget
5713s: item total income is going to be
5717s: replaced with this one
5727s: so if I go to
5733s: budgets I see that we're created based
5738s: on the value from total income
5744s: here
5749s: um in the budget
5752s: index in this
5757s: header I will do the same like I need
5760s: the total for the budgets
5789s: uh let's do here
5793s: calculate the total dollar amount of all
5799s: the
5802s: budgets if a budget
5806s: is fix is um
5810s: percentage
5812s: base transform it
5816s: to actual value based on
5821s: total
5823s: income let's
5827s: see total budg budget do reduce amount
5832s: by fixed or
5834s: percentage divided by
5837s: 100 total
5841s: income okay let's let's try to see this
5844s: one
5845s: [Music]
5853s: so uh update
5857s: the
5858s: header of the budgets page to
5864s: display that
5866s: total
5868s: allocated amount and maybe the remaining
5875s: budget to be allocated based on the
5881s: total
5885s: incomes is it for both OS uh it is but
5891s: I'm focusing on
5894s: iOS hello what's your keyboard I don't
5897s: know it's a very it's a
5900s: Vortex pocker or something like that I
5903s: have it for more than 3 years and I
5906s: never changed
5908s: it let me do that here let's accept and
5912s: if I go to
5915s: budget I don't think we have any income
5918s: by category
5926s: here let me remove
5930s: them if I go to budget
5943s: allocated and remaining
5955s: okay maybe here
5958s: available
5961s: uh income
5967s: or total income
5970s: allocated and
5979s: remaining hello
5990s: Carlos what's up with this budget total
5993s: income
5994s: number of R defined let's do
6000s: zero okay
6025s: [Music]
6031s: so yeah this one if I delete
6037s: it it updates
6039s: stuff
6043s: good and I have remaining here
6058s: Gap
6064s: two maybe at the top we should also put
6066s: them in a
6081s: row uh
6091s: if remaining is
6094s: negative display it with
6110s: red so if I go ahead and add here
6114s: like something
6118s: crazy the remaining is going to be
6135s: yeah
6140s: uh in the head there let's round up the
6165s: numbers okay
6182s: maybe in the budget item as well to do
6184s: ma ma round
6187s: percentage in
6189s: the here format amount
6213s: hello Mr Frank and thank you very much
6215s: for the donation I appreciate
6218s: that uh played API for importing data I
6222s: haven't thought about importing data
6226s: actually but what's we played
6230s: API open B banking
6237s: well I think I did I check something
6252s: else so let me check
6255s: what's what's play
6257s: API probably integration with open
6260s: banking
6274s: that would be nice simulus user
6277s: experience I don't think I'm going to
6279s: integrate it now but as in
6286s: future transactions
6300s: that would be interesting let me add it
6310s: here okay
6330s: can tell you what you spend on also has
6332s: assets like
6335s: stocks nice nice have you tried it have
6338s: you used it
6372s: total income um let's see if we can um
6377s: here in
6380s: budgets sort
6385s: maybe sort
6389s: budgets
6390s: from
6393s: biggest to
6395s: lowest for
6398s: budgets that
6400s: have
6402s: percentage
6404s: base amount calculate
6408s: the actual value based on total
6416s: incomes before sorting let's see what
6419s: it's going to
6427s: do and maybe I can do sorted budgets
6430s: here let's see okay that works great so
6434s: now we see the top ones at the
6438s: top uh but I don't know why
6442s: I know actually it why why this one is
6445s: at the
6451s: bottom maybe because this one let me
6455s: check the database the perk no the
6465s: ABC
6467s: per n 10
6478s: a fixed amount or a
6481s: percentage total
6483s: income my total income should go here
6486s: because it needs to be
6489s: before okay now it works
6497s: correctly okay I think I think this one
6500s: works
6509s: so I
6513s: have uh create
6517s: delete
6522s: list I need added
6532s: but for now this one is good so I'm
6535s: going to go ahead and do get status get
6537s: add
6540s: get commit minus
6543s: M
6551s: budget Prisma drizzle I'm using
6559s: drizal it's really good for maybe a
6561s: premium version of your application
6563s: yeah I think that would be really
6582s: nice and if I delete this
6586s: one allocated remaining
6591s: okay for
6631s: okay now I think we need to work on
6636s: editing so editing a
6641s: budget probably I'm going to do budgets
6645s: instead of new I'm going to
6647s: do
6649s: ID and here I'm going to do the Ed edit.
6653s: TSX let's do export default edit budget
6657s: like
6661s: this let's do const ID
6665s: use local search
6674s: prrams is why uh
6679s: yeah data budget use Query
6686s: budget ID we're going to do database
6689s: select from budget table where ID is
6692s: equal to
6701s: ID and now we can do console log budget
6706s: now from what
6711s: from uh uh definitely from our
6714s: components budget item I'm going to have
6716s: a edit button in the menu
6722s: here
6724s: edit and the icon is going to be pencil
6728s: maybe and no
6733s: destructive or this one is edit this one
6736s: is
6738s: pencil uh I don't think I need it red
6743s: and when we call it we're going to do
6745s: router. push to the budgets added so if
6750s: I do like this we have
6766s: edit we go to the edit screen and here
6769s: we should see the data about that yes
6773s: we have it and the same I think for now
6778s: I can do it on click as
6780s: well so let's
6783s: do
6788s: pressible on
6793s: press it should do the same so if I
6796s: press on it is going to go to the
6800s: edit now if I go there
6812s: let's move this one in a function in the
6818s: services
6822s: budget index.
6824s: TS export
6829s: default function get
6833s: budget by
6837s: ID and we're going to return this one
6843s: here no actually we need to
6846s: do
6849s: const
6852s: rows row at position
6861s: zero for
6896s: what's wrong
6899s: Rose oh I need to do a wait here
6932s: number or
6934s: undefined should I do here
6946s: undefined number null number
6949s: undefined that's that's one of the
6951s: problems somewhere it's number
6953s: null somewhere is number undefined for
6956s: the budget
6958s: here I can also do here nullable
6961s: nullable will that
6963s: fix yeah that
6967s: fixed
6969s: okay uh so I can get this one inside my
6975s: edit screen
6985s: get budget by
6990s: ID and we're going to see what's the
6992s: budget okay so now it's not an array
6994s: it's a
7000s: simple
7008s: object similar to how we have it in new
7011s: probably we're going to have have a
7036s: form do use tail win CSS I use native
7040s: win which is a way to use tail win in R
7044s: native uh Trail life is saying my app
7047s: got accepted in app store
7048s: congratulations that's a huge
7053s: milestone quickly remind us about the
7055s: hackathon I encourage you to check the
7057s: details at noas hack.com or at the
7060s: beginning of the video where I explain a
7062s: bit
7063s: better the most important things that
7067s: you have to know now about the
7070s: hackathon is that that the submission
7073s: form is open and if your application is
7077s: publicly available on app store or Play
7079s: Store you can go ahead and submit it
7082s: being publicly available on app store
7085s: and play store is a requirement to
7086s: participate in
7088s: hackathon uh that's why we are giving
7091s: two more additional weeks just for
7093s: submissions so the important deadlines
7096s: is the hackathon ends on December 31st
7099s: after that moment please don't do do any
7102s: more development of new
7104s: features and during the period of
7107s: January 1st to January 14th you're
7110s: allowed only to add fixes based on the
7114s: submission process if app store or Play
7117s: Store is saying like you need to do
7118s: something extra like you you can do that
7121s: but only related to those so you have
7124s: two weeks to get the application on the
7126s: market and after that the submission
7129s: form is going to be closed and we're
7131s: going to evaluate and create the
7133s: projects so these are the most important
7136s: parts at this
7144s: moment uh so what are we going to have
7149s: here give let let's think together so
7153s: I'm going to have something like a form
7155s: as well in the edit some similar to how
7158s: I have in the new so let's do here use
7166s: form uh Zod
7169s: resolver insert schema and default
7173s: values is going to be
7177s: budget now we are going to render the
7180s: form like this
7202s: sorry oh come
7208s: on I'm going to have to import all my
7222s: we need the budget type as
7232s: well
7237s: methods and the budget type is going to
7240s: be either fixed or percentage depending
7244s: on which value we have so if uh
7250s: budget do
7253s: fixed
7255s: amount then the
7258s: value is going to be fixed otherwise
7271s: percentage we can change let's import on
7276s: submit on submitting venue we have this
7280s: one we need it here here as well in the
7284s: edit update
7291s: budget and for the new we have here the
7297s: mutation I'm going to have it in the
7300s: update as well so what's going to
7303s: happen update
7307s: buet mutation
7317s: R
7318s: database
7320s: uh dot
7325s: update let's see how I can do the
7328s: update
7330s: dzel
7335s: update set
7338s: where so set
7347s: data do
7352s: where equal
7355s: budget table dot ID to the data.
7360s: ID maybe not data. ID
7364s: but
7366s: simply this or budget. ID
7376s: on success we invalidate we go back on
7380s: error we do fail to update budget
7403s: let's see what's going to
7418s: happen I go to
7420s: budgets and go to this
7424s: one it's not loading the data because
7428s: the I think I know why I think that this
7432s: one takes a bit of time to to happen
7438s: and the default Val is not going to be
7441s: attached here so it's only going to work
7443s: a second time when I go
7449s: here um
7470s: so maybe I'm going to think about
7473s: extracting the form itself in a separate
7486s: part let's do a component and let's call
7489s: it budget
7494s: form.
7496s: TSX let's do export default budget form
7499s: and here let's take from the
7502s: new in the return everything from
7506s: here from from form
7511s: provider let's say here return and add
7516s: everything let's also take things like
7519s: on uh
7523s: use
7539s: form form
7543s: provider maybe I'm going to do all the
7546s: Imports here
7553s: I'll also bring in the
7561s: state this
7571s: state to the budget form
7587s: and in V new let's render here the
7592s: budget
7594s: form import it from
7600s: here budget
7605s: form and what we need to do on the
7607s: budget form probably we need to do on
7609s: submit
7617s: which is going to be on submit data
7630s: Budget on subit data
7635s: budget and let's do also budget type for
7639s: the for the data as
7666s: well okay and when we press that button
7671s: it's going to to be like this and then
7672s: on submit that we take from uh from
7688s: here yeah maybe this one is going to
7691s: [Music]
7698s: be moved
7702s: like this I'm going to
7711s: have handle
7720s: submit not handle submit
7726s: but onsubmit form
7740s: okay so let's see if for new it still
7742s: works but what what what what what what
7745s: fixed
7750s: percentage my God a lot of stuff create
7754s: budget
7781s: I don't know what's happening here but
7783s: let me try to do a new budget ABC one
7788s: two three create
7791s: and it's here I think
7798s: no
7801s: test we have
7804s: it
7806s: test
7814s: 100 test
7819s: to okay and what I'm I'm hoping to
7822s: achieve is reusing the same budget form
7825s: in the edit as
7827s: well so instead of form
7832s: provider maybe I will do budget
7849s: form here I'm going to get the budget
7858s: type not handling the form
7863s: here but getting the default budget and
7866s: I can take the default budget and I can
7869s: send it here so
7872s: if greater null otherwise let's send
7876s: here default values
7878s: budget in the budget form we can expect
7880s: with
7883s: values uh we can do here A type like
7890s: this and we can provide the default
7892s: values to the
7900s: form now if I go to budgets and go to
7904s: test two is going to have a default
7908s: values if I go to a see it
7918s: has fixed amount one two three
7923s: create a one yeah I don't
7931s: remember okay and and and in the
7937s: form V state is also going to depend on
7940s: theold values so if default
7946s: values
7948s: dot percentage if it's that we're going
7952s: to do percentage
7955s: otherwise
7960s: fixed so if I go to budgets and do here
7963s: it's going to be fixed here it's going
7965s: to be
7967s: fixed but if I create a new one percent
7973s: percentage
7977s: 12 I have here Pur or percentage if I go
7981s: here it's display
7984s: properly fixed amount if I come to
7987s: percentage is percentage but why does
7990s: the value not getting
7993s: populated oh where's the question
8003s: because in the edit we have here
8010s: console log
8012s: budget and if I press on one of this we
8015s: see N I deny name
8021s: percentage and percentage 12 but the
8025s: value is not there why
8036s: maybe in the default
8049s: values maybe two string
8070s: yeah here it works like if I do to
8072s: string but I don't know why in the
8073s: default values it says
8084s: uhuh I can change it can do update and
8088s: that's going to it's supposed to update
8091s: dat but it doesn't we're going to figure
8093s: that out in a second as
8096s: well uh percentage should be
8112s: number erct hook form
8121s: default value
8180s: okay
8181s: not sure what how to how to do it
8183s: properly here but at least it works to
8187s: populate the fields now I will do
8190s: another thing on the budget
8193s: form I'll
8196s: do
8197s: hey is editing it's going to be a
8200s: Boolean and it's going to be initial to
8204s: false that's going to change the title
8209s: is editing
8216s: if it's editing let's do
8220s: save budget
8223s: create
8226s: budget maybe I don't even need to do it
8228s: but yeah
8230s: maybe is editing so if I test here I see
8235s: save
8236s: budget what happens here
8243s: console log data and
8246s: budget
8250s: type if I
8252s: do test one two three save the name
8256s: actually is getting
8259s: saved but the fixed
8264s: amount is not
8286s: undefined why is it undefined the budget
8290s: type
8299s: here update Budget on submit budget
8305s: form when we call it budget type is it
8327s: undefined so here it's fixed but it
8330s: doesn't get
8333s: there it calls
8336s: it with data
8339s: unfixed the onsubmit function
8343s: onsubmit calls create
8346s: budget for this function
8379s: should I add it to the data itself
8407s: should I do it like this and then in the
8410s: update when we like
8414s: this new budget form it's going to be
8422s: on
8423s: submit data
8427s: and budget
8436s: type and let's
8439s: do like this so if I come
8444s: here and change one two fixed here it's
8448s: fixed and it is is updated to one two if
8454s: I do one two 3 4 five but when I say h
8457s: actually this one update to percentage
8462s: and I'll do hey actually I want
8464s: 20% if I do save update to percentage is
8468s: going to be
8473s: 20% but the fixed amount is going to
8476s: remain like this
8481s: why is that
8483s: happening because it's undefined but I
8486s: think I need to do it null in this
8491s: case maybe here as well like
8495s: null because if it's undine it's not
8498s: going to touch
8501s: it
8505s: and let me do here and budget type
8522s: so that means that if I go here and say
8525s: hey maybe I will take something fixed
8528s: like this one and I'll say actually I
8532s: want to move to percentage and
8535s: a is supposed to be percentage and does
8538s: not have fixed
8544s: fix this zero okay now if I go back to
8547s: 100 and delete the percentage is going
8549s: to be fixed 100 and percentage still 20
8552s: why is
8561s: that or no no no no it's okay here
8565s: because I do just the data so everything
8568s: is good all good there let me check if I
8571s: still can do new budget fixed amount one
8574s: two three create I have new one two
8576s: three if I do new to 10 I can see it
8582s: it's new to 10
8585s: percentage if I do hey this is actually
8588s: five simply 500 save budget new two is
8591s: going to be
8593s: 500 if I do
8595s: percentage 20 new two is going to move
8599s: up in the list
8601s: and because we have like this nice
8603s: animations it looks really nice when we
8605s: actually update it because for example
8607s: if I update this one to five when I'm
8611s: going to go back I see how everything
8614s: moves oh okay now I can move remove some
8618s: of the stuff from
8621s: here
8623s: and our screens are responsible for
8627s: saving data but responsible of a form we
8631s: did that in a custom component form and
8635s: that way we can uh reuse some of the
8639s: stuff okay that's
8642s: perfect
8644s: and it's going to if we change something
8648s: like button Styles and so one we're not
8649s: going to have to do it in two different
8651s: places we're going to do it in one
8655s: place so still works
8671s: oh let me do get OD get commit minus
8676s: M
8679s: budget get not yet
8684s: push okay so we have editing of budgets
8688s: as well for income sources we don't have
8690s: editing maybe for there we're going to
8694s: fix it later but at the moment we can
8696s: delete and create them again so for now
8699s: I'm going to to keep it like
8703s: this
8707s: um hello D how can I help
8718s: you uh MC n is saying looks like dzel
8721s: and Expo skite is a promising thing
8723s: right now for offline first application
8726s: compared to watermelon DB and other
8727s: available solution yeah I think dzel in
8730s: Xbox kite is quite powerful or also like
8735s: this concept
8738s: this
8740s: uh anyway uh I think I'm going to wrap
8743s: it up for today I feel a bit tired it's
8746s: a lot of numbers that we are working
8749s: with and probably need some some oxygen
8753s: but anyway this is
8757s: um this is the end of a second day for
8760s: our application we have still three days
8763s: uh but it's the Christmas time so I want
8765s: to say happy uh happy Christmas to
8768s: everyone who is celebrating it during
8771s: this time
8773s: um and um I'll catch with you tomorrow
8778s: yeah I feel really really tired my head
8781s: hurts
8783s: already but yeah these things happen and
8785s: tomorrow we continue with additional
8788s: features for everyone who's
8790s: participating in not just hack I wish
8792s: you good luck and remember the
8794s: submission form is already open so if
8796s: your application is already available on
8799s: the market you can go ahead and submit
8801s: your application for the
8804s: hackathon um I'll catch with