Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
aa0d88b
Merge pull request #1 from calebcianc/mapComponent
calebcianc Jun 10, 2023
8b963ea
Installed GoogleMaps JS API Loader
calebcianc Jun 10, 2023
26a35aa
Added map
calebcianc Jun 10, 2023
2fb4ef3
Merge pull request #2 from calebcianc/mapComponent
calebcianc Jun 10, 2023
1c97f77
Updated gitignore file
calebcianc Jun 10, 2023
0eccde6
Installed react router dom
calebcianc Jun 11, 2023
f9a297d
Added component files to set up React Routing
calebcianc Jun 11, 2023
3a86615
Merge pull request #3 from calebcianc/AppRouting
Khloeli Jun 12, 2023
6d30821
add component to pages folder
Khloeli Jun 12, 2023
335f260
.gitignore is now working
Khloeli Jun 12, 2023
b34bdbc
Merge pull request #4 from calebcianc/add-folder-pages
Khloeli Jun 12, 2023
fca0793
updated the address for the imports
Khloeli Jun 12, 2023
8e34dd7
Merge pull request #5 from calebcianc/add-folder-pages
Khloeli Jun 12, 2023
1b52c22
add auth and modal
Khloeli Jun 13, 2023
8c823e2
Merge pull request #6 from calebcianc/add-input-expenses
Khloeli Jun 13, 2023
b935fa1
fix folder name change
Khloeli Jun 13, 2023
a858e72
Merge pull request #7 from calebcianc/bugfix
Khloeli Jun 13, 2023
a20fa6a
new changes
Khloeli Jun 13, 2023
182946b
Merge pull request #8 from calebcianc/bugfix
Khloeli Jun 13, 2023
39d72f5
Attempted to add marker to google map
calebcianc Jun 13, 2023
ca949c1
Successfully added icons which will be mapped to transactions based o…
calebcianc Jun 13, 2023
0f4f00d
Preparing to add the InfoWindow
calebcianc Jun 13, 2023
eb30ad0
Some code to dynamically set the default view of the map
calebcianc Jun 14, 2023
e123d6e
add routing and signout button
Khloeli Jun 14, 2023
e394bb4
remove unnecessary imports
Khloeli Jun 14, 2023
a398d06
remove navbar imports
Khloeli Jun 14, 2023
eab2c3c
Merge pull request #9 from calebcianc/edit-router
Khloeli Jun 14, 2023
e456b21
Successfully incorporated dynamically setting the map based on the ma…
calebcianc Jun 15, 2023
e61b1ad
Updated icons used for markers
calebcianc Jun 15, 2023
1a81c3e
Added code to recenter map based on clicked marker
calebcianc Jun 15, 2023
d540c45
Added code to render an info window when a marker is clicked
calebcianc Jun 15, 2023
dc60621
Merge pull request #10 from calebcianc/mapComponent
calebcianc Jun 17, 2023
7ee9ab8
edit welcome page to show mapexpense if loggedin
Khloeli Jun 16, 2023
ade3513
edit db structure
Khloeli Jun 17, 2023
f86be7d
Merge pull request #11 from calebcianc/edit-db-structure
Khloeli Jun 17, 2023
e310fd1
fix authform. able to show error message accurately
Khloeli Jun 18, 2023
bb24d3d
fix sign up page with validation
Khloeli Jun 18, 2023
9493b4b
Merge pull request #12 from calebcianc/fix-authform
Khloeli Jun 18, 2023
8d2d7ac
edit background width of temp box
Khloeli Jun 18, 2023
acdd986
remove additional UID reference from user db
Khloeli Jun 18, 2023
9bb6d5a
Merge pull request #13 from calebcianc/add-input-expenses
Khloeli Jun 18, 2023
22817a6
edited validated for sign up
Khloeli Jun 18, 2023
e045ad4
Merge pull request #14 from calebcianc/update-signup
Khloeli Jun 18, 2023
a648db9
Fixed map loading issue
calebcianc Jun 19, 2023
1b4393c
Integrated pan to user location
calebcianc Jun 19, 2023
2f582ae
Saving working app
calebcianc Jun 19, 2023
582950d
Added working map input
calebcianc Jun 19, 2023
2235c40
Merge pull request #15 from calebcianc/mapComponent3
calebcianc Jun 19, 2023
03ede9d
Set default currency to SGD
calebcianc Jun 19, 2023
fbde2ed
Attempting to add in api to fetch list of currencies
calebcianc Jun 19, 2023
6910669
Separated array of currencies into its own .js file
calebcianc Jun 19, 2023
28d01c5
Added code to set address to users location
calebcianc Jun 19, 2023
1a17df4
Replaced location state with lat and lng states
calebcianc Jun 19, 2023
2068157
Added code which fetches expenses from realtime database and renders …
calebcianc Jun 19, 2023
d2f0ce1
Added code to remove markers once user is signed out
calebcianc Jun 19, 2023
b868431
Made add-button disabled unless user changes category and amount
calebcianc Jun 19, 2023
bc501d7
Revised CSS for navbar
calebcianc Jun 19, 2023
6d2f45d
add list expenses component
Khloeli Jun 19, 2023
2ef17c7
remove unnecessary code
Khloeli Jun 19, 2023
3aea69b
Merge pull request #16 from calebcianc/list-expenses
Khloeli Jun 19, 2023
05f855b
Added draft list of expenses to ListExpenses component
calebcianc Jun 19, 2023
a98c106
Attempted to revise the CSS such that the map and list components app…
calebcianc Jun 19, 2023
f103441
Merge branch 'main' into mapComponent3
calebcianc Jun 19, 2023
679d358
Merge pull request #17 from calebcianc/mapComponent3
calebcianc Jun 19, 2023
8b9ed83
Revised some CSS after merging
calebcianc Jun 19, 2023
73ba08e
Removed fetching of expenses in ListExpenses since that is already do…
calebcianc Jun 20, 2023
f856cde
Merge pull request #18 from calebcianc/fix-get-expenses
calebcianc Jun 20, 2023
1886b3f
Fixed the narrow viewport css error
calebcianc Jun 20, 2023
9447ce6
Fixed addExpense button to the top and increased the rightMargin
calebcianc Jun 20, 2023
023e05b
Merge pull request #19 from calebcianc/fix-narrow-viewport-css
calebcianc Jun 20, 2023
a1b41e2
Added number formatting
calebcianc Jun 20, 2023
26afd27
Merge pull request #20 from calebcianc/fix-narrow-viewport-css
calebcianc Jun 20, 2023
764331a
Removed profile page wording and made profile picture a circle
calebcianc Jun 20, 2023
8985578
Merge pull request #21 from calebcianc/resize-profile-image
calebcianc Jun 20, 2023
e6efab1
Created highlighted state in parent component and passed it to children
calebcianc Jun 20, 2023
575d195
Edited fetching of data from realtime database such that the id of ea…
calebcianc Jun 20, 2023
92284b3
Added code to open infoWindow when an expense in the list is clicked on
calebcianc Jun 20, 2023
93093d4
Merge pull request #22 from calebcianc/highlight-feature
calebcianc Jun 20, 2023
aebdd19
Styled cursor to become pointer when hovering over list of expenses
calebcianc Jun 20, 2023
39dd773
Merge pull request #23 from calebcianc/style-cursor
calebcianc Jun 20, 2023
fefc346
Initial styling for highlighted expense
calebcianc Jun 20, 2023
7438152
Added click and highlight feature. Just need to cause expense to surf…
calebcianc Jun 20, 2023
09f4079
Added function to cause highlighted expense to scroll into view
calebcianc Jun 20, 2023
48197cd
Merge pull request #24 from calebcianc/style-highlighted-expense
calebcianc Jun 20, 2023
5ff695c
Added border radius to blue border
calebcianc Jun 20, 2023
19fcfeb
Merge pull request #25 from calebcianc/style-highlighted-expense
calebcianc Jun 20, 2023
9444251
Changed rendered text for when location has not be entered
calebcianc Jun 20, 2023
0e16075
Moved lat and lng states to mapExpenses, revised placeholder message …
calebcianc Jun 20, 2023
88995a5
Merge pull request #26 from calebcianc/currency-conversion
calebcianc Jun 20, 2023
12d3887
Styled welcome page
calebcianc Jun 20, 2023
6d8a47b
Merge pull request #27 from calebcianc/currency-conversion
calebcianc Jun 20, 2023
044216a
Added gradient to the bottom of the overflow list expenses
calebcianc Jun 20, 2023
b676e1b
Merge pull request #28 from calebcianc/currency-conversion
calebcianc Jun 20, 2023
292fbac
Attempted to add code that makes map pan to most recently added expense
calebcianc Jun 20, 2023
1fd60b4
Merge pull request #29 from calebcianc/currency-conversion
calebcianc Jun 20, 2023
50bf141
Removed a line of code (setState) that was causing app to crash.
calebcianc Jun 20, 2023
606039d
Merge pull request #30 from calebcianc/fix-invariant-bug
calebcianc Jun 20, 2023
b3b263d
Removed justify-content css
calebcianc Jun 20, 2023
b0fd084
Merge pull request #31 from calebcianc/currency-conversion
calebcianc Jun 20, 2023
53553b5
Created DisplayCurrency component to allow users to change display cu…
calebcianc Jun 20, 2023
bd92499
add total for the expenses
Khloeli Jun 20, 2023
3a117ad
Merge pull request #32 from calebcianc/add-total
Khloeli Jun 20, 2023
85ed729
Added modal to allow user to update currency. Also installed react bo…
calebcianc Jun 20, 2023
7f620d5
Added change-currency functionaility to button with search field-drop…
calebcianc Jun 20, 2023
86aadb8
Fixed NaN expenses which are rendered before expenses data could be f…
calebcianc Jun 20, 2023
1a72493
Added a conditional whereby if there are no expenses, allExp will not…
calebcianc Jun 20, 2023
ff56b22
Merge branch 'main' into currency-conversion
calebcianc Jun 20, 2023
748865c
Merge pull request #33 from calebcianc/currency-conversion
calebcianc Jun 20, 2023
6b606b5
Combined total amount to display currency. Also added filter icon.
calebcianc Jun 20, 2023
847a84a
Merge pull request #34 from calebcianc/mini-navbar
calebcianc Jun 20, 2023
5050b5a
Added Typeahead in place of Form Select
calebcianc Jun 20, 2023
d37c32e
Changed the placeholder for the currency field in inputExpenses
calebcianc Jun 20, 2023
1bc2bc1
Merge pull request #35 from calebcianc/mini-navbar
calebcianc Jun 20, 2023
2c25ce1
add new functionality for list expenses
Khloeli Jun 22, 2023
6ebc201
update input expenses to remove receipt link if there's no receipt up…
Khloeli Jun 22, 2023
8a7ddc2
Merge pull request #36 from calebcianc/edit-listexpenses
Khloeli Jun 22, 2023
c8b4982
Added code relating to displayCurrency
calebcianc Jun 23, 2023
e3a32d0
Changed amounts extracted to displayAmount instead of amount
calebcianc Jun 23, 2023
f8369a8
Changed placeholder text from loading to your expenses appear here if…
calebcianc Jun 23, 2023
f5a53b3
Changed fetch data function from get to onValue to account for Fireba…
calebcianc Jun 23, 2023
2bca84a
Merge pull request #37 from calebcianc/currency-conversion
calebcianc Jun 23, 2023
61dca23
Added input currency info in expense card if applicable
calebcianc Jun 23, 2023
7ab0b17
Merge pull request #38 from calebcianc/currency-conversion
calebcianc Jun 23, 2023
5e31847
Updated how data is arranged in the infoWindow
calebcianc Jun 23, 2023
6e3e6f6
Added a conditional to only render the marker once the displayAmount …
calebcianc Jun 23, 2023
2dcf7ea
Merge pull request #39 from calebcianc/currency-conversion
calebcianc Jun 23, 2023
31317f4
Successfully added cloud function that converts displayAmounts based …
calebcianc Jun 23, 2023
f634e8b
Merge pull request #40 from calebcianc/currency-conversion
calebcianc Jun 23, 2023
73e476f
Attempting to copy over code to allow for updating of profile picture
calebcianc Jun 23, 2023
eb0359c
add bar graph and pie chart
Khloeli Jun 23, 2023
dd32516
fix bar graph
Khloeli Jun 23, 2023
00329d1
add css for dashboard
Khloeli Jun 23, 2023
0fbcd1c
Merge pull request #41 from calebcianc/add-bargraph-piechart
Khloeli Jun 23, 2023
290cc98
change event to state to reflect bar selection
Khloeli Jun 24, 2023
d3b9a84
Merge pull request #42 from calebcianc/add-bargraph-piechart
Khloeli Jun 24, 2023
09db3c7
add colours for each category
Khloeli Jun 24, 2023
e841346
Merge pull request #43 from calebcianc/add-bargraph-piechart
Khloeli Jun 24, 2023
e49b37a
add email error notification
Khloeli Jun 24, 2023
c16cb1b
remove unnecessary console log
Khloeli Jun 24, 2023
64f5c6e
Merge pull request #44 from calebcianc/fix-signup-email
Khloeli Jun 24, 2023
69615ba
Prepped Profile.js for merge
calebcianc Jun 24, 2023
6207d0a
Merge branch 'main' into profileUpdate
calebcianc Jun 24, 2023
4f45b99
Merge pull request #45 from calebcianc/profileUpdate
calebcianc Jun 24, 2023
aca273f
Changed getLatestExpLocation to pick up most recent exp
calebcianc Jun 24, 2023
e39497b
Added code to allow user to update profile picture and update profile…
calebcianc Jun 24, 2023
dcfd3df
Merge pull request #46 from calebcianc/profileUpdate
calebcianc Jun 24, 2023
a261756
Added ResetPassword component to allow user to reset password.
calebcianc Jun 25, 2023
df88c50
Added SignIn SignUp ResetPassword h2 headings to relevant pages
calebcianc Jun 25, 2023
31ca1c3
Updated ResetPassword component with newer code syntax for sendResetP…
calebcianc Jun 25, 2023
84bd2af
Merge pull request #47 from calebcianc/reset-pw
calebcianc Jun 25, 2023
87f9213
Added back SignIn heading and aligned SignIn to be center
calebcianc Jun 25, 2023
410eb44
Merge pull request #48 from calebcianc/reset-pw
calebcianc Jun 25, 2023
2cf2e21
Added handleEditExpenses and handleDeleteExpenses placeholders
calebcianc Jun 25, 2023
dc6b3b1
Added delete button to allow user to delete expense
calebcianc Jun 26, 2023
e6624c3
Merge pull request #49 from calebcianc/edit-delete-expenses
calebcianc Jun 26, 2023
72a413d
Added edit button but yet to update the code within the EditExpenses …
calebcianc Jun 26, 2023
3567516
Allow users to delete expenses
calebcianc Jun 27, 2023
ae41bf7
Merge pull request #50 from calebcianc/edit-delete-expenses
calebcianc Jun 27, 2023
232b8ab
add categories and add categories under userphoto in nav bar
Khloeli Jun 27, 2023
dc1e9bc
edit default category color
Khloeli Jun 27, 2023
65f2c44
Merge pull request #51 from calebcianc/add-category
Khloeli Jun 27, 2023
845e6c0
Fixed undefined list expenses bug
calebcianc Jun 27, 2023
4968546
Replaced chunky buttons with SVGs
calebcianc Jun 27, 2023
47af8e1
Merge pull request #52 from calebcianc/edit-delete-expenses
calebcianc Jun 27, 2023
ecda3a3
Replaced Filter image with SVG icon
calebcianc Jun 27, 2023
c03a479
Merge pull request #53 from calebcianc/Filter
calebcianc Jun 27, 2023
b53af91
add update to cat
Khloeli Jun 27, 2023
4cd3318
add user categories to add expenses
Khloeli Jun 27, 2023
63dac9c
add user cat colors to dashboard
Khloeli Jun 27, 2023
6197a63
Merge pull request #54 from calebcianc/edit-categories
Khloeli Jun 27, 2023
2b9bb60
add comments and remove hard coded color
Khloeli Jun 27, 2023
f17c5e2
Merge pull request #55 from calebcianc/add-comments
Khloeli Jun 27, 2023
247553f
trying to fix bug
calebcianc Jun 27, 2023
d165ef3
Changed bootstrap icons to emojis
calebcianc Jun 27, 2023
e3870cf
Merge pull request #56 from calebcianc/undefined-bug
calebcianc Jun 27, 2023
e673a00
comment out unnecessary console log
Khloeli Jun 29, 2023
3988f22
add icon in bubble for list expenses
Khloeli Jun 29, 2023
1cbb3e8
pass categories from app component to input expenses form
Khloeli Jun 29, 2023
a032d98
fix first element bug. It can show food emoji now
Khloeli Jun 29, 2023
4c0981d
change to parse float instead of parse int to calculate total
Khloeli Jun 29, 2023
3c56d47
Merge pull request #57 from calebcianc/refactor-fetch-db
Khloeli Jun 29, 2023
3a890f4
update edit expenses modal
Khloeli Jun 30, 2023
2d204a6
fix 2 child issue and total issue. Edit expenses to read user categor…
Khloeli Jun 30, 2023
7074450
Merge pull request #58 from calebcianc/refactor-fetch-db
Khloeli Jun 30, 2023
b20a14d
fix rendering issue but it's currently in mapexpenses
Khloeli Jun 30, 2023
eabcb54
attempt to put in app
Khloeli Jun 30, 2023
a7a8bb9
fix rendering timing issue
Khloeli Jun 30, 2023
1b2f3fe
remove prev version of exp fetch
Khloeli Jun 30, 2023
373db1e
Merge pull request #59 from calebcianc/move-fetch-exp-app
Khloeli Jun 30, 2023
0bd6d5f
fix total nan issue
Khloeli Jun 30, 2023
1756495
Merge pull request #60 from calebcianc/fix-total-nan
Khloeli Jun 30, 2023
18a09b0
use categories and expensescategory from apps in dashboard and piechart.
Khloeli Jun 30, 2023
1db5315
Merge pull request #61 from calebcianc/add-filter-dashboard
Khloeli Jul 1, 2023
56e85d8
Changed conditional in order to display the question mark SVG
calebcianc Jul 1, 2023
3386333
Merge pull request #62 from calebcianc/svg-bug
calebcianc Jul 1, 2023
816ba4a
Added conditional to not look up profileUrl if there is no profileUrl…
calebcianc Jul 1, 2023
9ddc94d
Added back profilePhotoUrl ?
calebcianc Jul 1, 2023
6a421ba
Changed the way user profile data is mapped out. Also commented out t…
calebcianc Jul 1, 2023
45869d1
Merge pull request #63 from calebcianc/svg-bug
calebcianc Jul 1, 2023
3d1c187
attempting to fix bug
calebcianc Jul 1, 2023
2dd2804
Detached setLoggedIn(false) from the logOut button in order for the f…
calebcianc Jul 1, 2023
efa1853
Merge pull request #64 from calebcianc/logout-bug
calebcianc Jul 1, 2023
68b634e
Removed instances of readyToShow
calebcianc Jul 1, 2023
b31b88e
Merge pull request #65 from calebcianc/clean-readytoshow
calebcianc Jul 1, 2023
3c81c26
Moved displayCurrency state initialisation to App.js
calebcianc Jul 1, 2023
32699e4
Added displayCurrency and displayAmount to key in order to renrender …
calebcianc Jul 1, 2023
f87189e
Merge pull request #66 from calebcianc/displaycurrency-bug
calebcianc Jul 1, 2023
0c1ba69
generate display amount according to requirements
Khloeli Jul 1, 2023
5be21ea
add dynamic changes to pie chart upon clicking
Khloeli Jul 1, 2023
3acd200
remove unnecessary usestate
Khloeli Jul 1, 2023
d2511ff
Merge pull request #67 from calebcianc/add-filter-dashboard
Khloeli Jul 1, 2023
bf7de5b
Replaced filter button with cabinet emoji. Changed margin/padding.
calebcianc Jun 29, 2023
9d5fceb
removed duplicate setDisplayCurrency in MapExpenses as this is alread…
calebcianc Jul 3, 2023
f0a3210
Merge pull request #68 from calebcianc/filter
calebcianc Jul 3, 2023
3d4372f
Added code to fix displayCurrency bug
calebcianc Jul 3, 2023
5a7f742
Set up filter modal. To incorporate conditionals to only render expen…
calebcianc Jul 3, 2023
214d1ac
add delete feature to categories
Khloeli Jul 3, 2023
28869b6
change category component to use props pass from apps instead of call…
Khloeli Jul 3, 2023
7ac6d4d
remove comments and unnecessary imports
Khloeli Jul 3, 2023
e17f57a
Merge pull request #69 from calebcianc/feat-delete-cat
Khloeli Jul 3, 2023
94c6a52
Added some styling to all expenses
calebcianc Jul 3, 2023
779ef1d
Merge branch 'main' into add-filter-list
calebcianc Jul 3, 2023
f2ed204
Merge pull request #70 from calebcianc/add-filter-list
calebcianc Jul 3, 2023
e69f40b
Modified filter code to ensure date does not appear if there are no e…
calebcianc Jul 3, 2023
558ab12
add expenses for dashboard by viewtype and category
Khloeli Jul 4, 2023
dcebebd
add text for each expenses in the card
Khloeli Jul 4, 2023
368a958
Merge pull request #71 from calebcianc/add-dashboard-exp
Khloeli Jul 4, 2023
47e064d
add card for each expense within the collapse
Khloeli Jul 4, 2023
b6e4581
Merge pull request #72 from calebcianc/add-dashboard-exp
Khloeli Jul 4, 2023
73d379a
add latest design for dashboard list exp
Khloeli Jul 4, 2023
5df04eb
Merge pull request #73 from calebcianc/add-dashboard-exp
Khloeli Jul 4, 2023
16a2814
fix signup profile page bug
Khloeli Jul 4, 2023
b7ebc97
Merge pull request #74 from calebcianc/bug-signup
Khloeli Jul 4, 2023
7d2867c
export data to excel works
calebcianc Jul 4, 2023
bddf581
Merge pull request #75 from calebcianc/export-expenses
calebcianc Jul 4, 2023
d09b4ec
added some titles to filter and export button-emojis
calebcianc Jul 4, 2023
f8e97d3
added sign in with google button
calebcianc Jul 4, 2023
6d473dd
Users can use google account to sign up / sign in
calebcianc Jul 6, 2023
7aff8fe
Merge pull request #76 from calebcianc/additional-auth-options
calebcianc Jul 6, 2023
fb165a5
Added code to fetch exchange rates
calebcianc Jul 6, 2023
a6a9d70
client side function works but api key not hidden
calebcianc Jul 6, 2023
0fd4a70
Completed bringing server side function to client side
calebcianc Jul 7, 2023
487c84f
Merge pull request #77 from calebcianc/convert-currency
calebcianc Jul 7, 2023
e683f1a
added some code to only trigger the display currency change function …
calebcianc Jul 7, 2023
e982f52
Merge pull request #78 from calebcianc/convert-currency
calebcianc Jul 7, 2023
04130a2
add profile styling
Khloeli Jul 7, 2023
c0422c7
add css
Khloeli Jul 8, 2023
2ba3ab5
add styling to dashboard tab
Khloeli Jul 8, 2023
f32e715
change button classname to either add or close button to reflect the …
Khloeli Jul 8, 2023
a23ce29
change links and bar graph color to be able to change with main color…
Khloeli Jul 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .firebase/hosting.YnVpbGQ.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
asset-manifest.json,1686409621257,fd92b1310e6c7f0f1787dbf8ced2ef351e1590792580a900ffcc9e79cf068898
index.html,1686409621257,850d18b3017235cd2d97641071b8f7fbdab3dcce566a5591f1c56ca0b4ee2769
manifest.json,1686409617393,b549bfd2043cac546ce336254ac1fdd996d55802e2674aa18168ec2751647ab8
favicon.ico,1686409617393,006c175f406841b3f2a1d58f203c9f83755b62b227a899f46adabc2bfabc420f
static/js/main.a7669b8d.js.LICENSE.txt,1686409621261,9d3e7ca3f0154b9ef7b84e5b0ed4c482785ca412e287f74ddd3d0cbcbbc624a2
logo192.png,1686409617393,2894b3e01dd7ca7fcfc7482415e6929105f2f57f5ae2547b9a70f2c003476dc6
static/css/main.f968d225.css,1686409621261,2c1e7eb7c8dbe9d7a3e91b03031dbfbe57042009e0c7a039944f972fa30a3c3b
logo512.png,1686409617393,0d30eb7f676b0f7bceb2121a29437c2c620c74fcbb7919528c73a396089521fe
static/js/main.a7669b8d.js,1686409621261,a69cee099c8cabddee7b7b5773af15cc30848fb87cc2d9427965adafcca8917e
static/css/main.f968d225.css.map,1686409621261,edd49da3418f5d890db257523b451e89a93b088c72efd04c30bcd31a9ba260fc
static/js/main.a7669b8d.js.map,1686409621261,f4a1fb7e783a6d1bf409ef9d5dcf8a459c1f227aa444896891301c8961ff30a2
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "project2-b6874"
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand All @@ -21,3 +22,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

6 changes: 6 additions & 0 deletions database.rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rules": {
".read": "now < 1688918400000", // 2023-7-10
".write": "now < 1688918400000", // 2023-7-10
}
}
37 changes: 37 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"storage": {
"rules": "storage.rules"
},
"functions": [
{
"source": "functions",
"codebase": "default",
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log"
],
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]
}
]
}
28 changes: 28 additions & 0 deletions functions/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
env: {
es6: true,
node: true,
},
parserOptions: {
"ecmaVersion": 2018,
},
extends: [
"eslint:recommended",
"google",
],
rules: {
"no-restricted-globals": ["error", "name", "length"],
"prefer-arrow-callback": "error",
"quotes": ["error", "double", {"allowTemplateLiterals": true}],
},
overrides: [
{
files: ["**/*.spec.*"],
env: {
mocha: true,
},
rules: {},
},
],
globals: {},
};
1 change: 1 addition & 0 deletions functions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
92 changes: 92 additions & 0 deletions functions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/**
* Import function triggers from their respective submodules:
*
* const {onCall} = require("firebase-functions/v2/https");
* const {onDocumentWritten} = require("firebase-functions/v2/firestore");
*
* See a full list of supported triggers at https://firebase.google.com/docs/functions
*/

// const { onRequest } = require("firebase-functions/v2/https");
// const logger = require("firebase-functions/logger");

// Create and deploy your first functions
// https://firebase.google.com/docs/functions/get-started

// exports.helloWorld = onRequest((request, response) => {
// logger.info("Hello logs!", {structuredData: true});
// response.send("Hello from Firebase!");
// });

// const functions = require("firebase-functions");
// const admin = require("firebase-admin");
// const fetch = require("isomorphic-fetch");
// admin.initializeApp();
// const db = admin.database();

// const apiKey = functions.config().exchangerate.key;

// exports.convertCurrency = functions.database
// .ref("/expenses/{userId}/{expenseId}")
// .onWrite(async (change, context) => {
// // Exit when the data is deleted.
// if (!change.after.exists()) {
// return null;
// }

// const expense = change.after.val();

// // Check if relevant fields have changed b4 fetching the fx
// if (change.before.exists()) {
// const beforeExpense = change.before.val();
// if (
// expense.amount === beforeExpense.amount &&
// expense.currency === beforeExpense.currency &&
// expense.displayCurrency === beforeExpense.displayCurrency
// ) {
// console.log("Expense data unchanged, no need to convert currency");
// return null;
// }
// }

// const response = await fetch(
// `https://v6.exchangerate-api.com/v6/${apiKey}/latest/USD`,
// );
// const data = await response.json();
// const exchangeRates = data.conversion_rates;
// const rateFrom = exchangeRates[expense.currency];
// const rateTo = exchangeRates[expense.displayCurrency];
// const displayAmount = (expense.amount / rateFrom) * rateTo;
// return change.after.ref.child("displayAmount").set(displayAmount);
// });

// exports.onDisplayCurrencyChange = functions.database
// .ref("/user/{userId}/displayCurrency")
// .onUpdate(async (change, context) => {
// const displayCurrency = change.after.val();

// const response = await fetch(
// `https://v6.exchangerate-api.com/v6/${apiKey}/latest/USD`,
// );
// const data = await response.json();
// const exchangeRates = data.conversion_rates;

// const expensesRef = db.ref(`expenses/${context.params.userId}`);
// const expensesSnapshot = await expensesRef.once("value");
// const expenses = expensesSnapshot.val();

// for (const expenseId in expenses) {
// if (Object.prototype.hasOwnProperty.call(expenses, expenseId)) {
// const expense = expenses[expenseId];
// const rateFrom = exchangeRates[expense.currency];
// const rateTo = exchangeRates[displayCurrency];
// const displayAmount = (expense.amount / rateFrom) * rateTo;
// await expensesRef
// .child(`${expenseId}/displayAmount`)
// .set(displayAmount);
// await expensesRef
// .child(`${expenseId}/displayCurrency`)
// .set(displayCurrency);
// }
// }
// });
Loading