Skip to content

Bookkeeper Dashboard #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
88816af
Fetch and Process Balance Sheet data
evansmj Apr 23, 2024
8edede2
skip balance sheet tests for now
evansmj Jun 2, 2024
f214dc1
Hide 'external' accounts
evansmj Jun 2, 2024
3645ebc
Format table sats with 3 decimal places.
evansmj Jun 3, 2024
5cebcc1
Remove comma from y-axis
evansmj Jun 10, 2024
28c7186
Add sats label to y-axis
evansmj Jun 10, 2024
2bb1f5f
add 5 percent top margin so max y-axis value displays
evansmj Jun 10, 2024
d6b01c8
Add tooltip on hover of bars
evansmj Jun 11, 2024
f23b40b
Highlight entire row when a cell is hovered
evansmj Jun 11, 2024
50c1b15
Highlight bar color on hover
evansmj Jun 11, 2024
ad1ef03
Support zooming and panning
evansmj Jun 22, 2024
2312006
Add clip so elements dont render behind y axis after zooming or panning
evansmj Jun 22, 2024
c508208
Add minutely and yearly time granularity
evansmj Jun 24, 2024
53652e5
Fix zooming
evansmj Jun 24, 2024
f5c68e3
Center x-axis ticks under each bar when zooming
evansmj Jun 24, 2024
6ff3a72
Memoize fetchBalanceSheetData and suppress exhaustive deps since we d…
evansmj Jun 25, 2024
a42463a
Pass BalanceSheetRoot container width to graph
evansmj Jun 29, 2024
a575eeb
constraint table to container width and make scrollable
evansmj Jul 1, 2024
bf6ccbe
Make table scrollable vertically
evansmj Jul 2, 2024
f61d815
Refactor balance sheet types to convert raw sql to workable object.
evansmj Jul 13, 2024
4956216
Clarify balance sheet data processing
evansmj Jul 17, 2024
2bd6533
Add sats-flow chart
evansmj Aug 6, 2024
c187e40
Add checkbox to hide zero activity
evansmj Aug 7, 2024
58be4e7
Refactor bar drawing
evansmj Aug 8, 2024
35863b0
Update zoom behavior
evansmj Aug 20, 2024
270cf96
Display Invoice Rune (#56)
evansmj Jun 6, 2024
5bc5da0
Move @types/d3 to devDependencies
evansmj Aug 21, 2024
b76d366
Set default TimeGranularity to Monthly
evansmj Aug 22, 2024
8f6f4b0
Add VolumeGraph
evansmj Sep 12, 2024
eb368d8
Add sql terminal
evansmj Oct 1, 2024
bca4362
Fix header not rendering in bookkeeper routes
evansmj Oct 1, 2024
dd5dc02
Add date range to balance sheet
evansmj Oct 3, 2024
da18f36
Update TimeGranularity button style and support dark mode
evansmj Oct 21, 2024
63cb297
Style balance sheet according to figma
evansmj Oct 31, 2024
3e669e7
Update styles
evansmj Nov 11, 2024
df9bd5b
format volume sats
evansmj Nov 11, 2024
5bfeddd
format net inflow
evansmj Nov 11, 2024
a15cf71
Fix lint issues on VolumeGraph
evansmj Nov 22, 2024
7287412
Hide dropdown icon when value is selected in DatepickerInput
evansmj Nov 22, 2024
d953a72
Hide zero activity periods on balance sheet.
evansmj Nov 22, 2024
0ed3308
Add total period balance to balance sheet graph tool tip
evansmj Nov 23, 2024
5109273
Move balance format to constants.ts
evansmj Nov 23, 2024
17beb47
Refactor timestamp range calculation out of sql into transform function
evansmj Nov 23, 2024
ad151a0
Add date range options to sats flow
evansmj Nov 28, 2024
4e6cc77
Bookkeeper landing layout
evansmj Dec 20, 2024
716c126
Fix dark/light mode colors
evansmj Dec 20, 2024
f673632
Fetch data for bookkeeper landing
evansmj Dec 23, 2024
33c8473
Fix volume summation
evansmj Dec 26, 2024
038fe7f
Display routes for volume chart instead of channels
evansmj Dec 26, 2024
04e8293
Add terminal button
evansmj Dec 26, 2024
74e1467
fix lints
evansmj Dec 26, 2024
11c7a65
Update bar color scheme
evansmj Dec 26, 2024
8fefbab
Fix inbound display
evansmj Dec 26, 2024
40b5fa3
Add tests for bookkeeper components
evansmj Dec 28, 2024
c13aeb7
Compiled code after all bookkeeper updatescommits
ShahanaFarooqui Feb 25, 2025
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
24 changes: 6 additions & 18 deletions apps/frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
{
"files": {
"main.css": "/static/css/main.11b562ff.css",
"main.js": "/static/js/main.8ff0239a.js",
"static/css/948.46c85475.chunk.css": "/static/css/948.46c85475.chunk.css",
"static/js/948.256093c8.chunk.js": "/static/js/948.256093c8.chunk.js",
"static/css/642.31d6cfe0.chunk.css": "/static/css/642.31d6cfe0.chunk.css",
"static/js/642.b93ff6b0.chunk.js": "/static/js/642.b93ff6b0.chunk.js",
"static/css/622.31d6cfe0.chunk.css": "/static/css/622.31d6cfe0.chunk.css",
"static/js/622.86bd9b9e.chunk.js": "/static/js/622.86bd9b9e.chunk.js",
"static/js/420.1c2ec4dd.chunk.js": "/static/js/420.1c2ec4dd.chunk.js",
"main.css": "/static/css/main.79f288c9.css",
"main.js": "/static/js/main.69a32e2c.js",
"static/media/Inter-Bold.ttf": "/static/media/Inter-Bold.88fa7ae373b07b41ecce.ttf",
"static/media/Inter-SemiBold.ttf": "/static/media/Inter-SemiBold.4d56bb21f2399db8ad48.ttf",
"static/media/Inter-Medium.ttf": "/static/media/Inter-Medium.6dcbc9bed1ec438907ee.ttf",
"static/media/Inter-Thin.ttf": "/static/media/Inter-Thin.f341ca512063c66296d1.ttf",
"index.html": "/index.html",
"main.11b562ff.css.map": "/static/css/main.11b562ff.css.map",
"main.8ff0239a.js.map": "/static/js/main.8ff0239a.js.map",
"948.46c85475.chunk.css.map": "/static/css/948.46c85475.chunk.css.map",
"948.256093c8.chunk.js.map": "/static/js/948.256093c8.chunk.js.map",
"642.b93ff6b0.chunk.js.map": "/static/js/642.b93ff6b0.chunk.js.map",
"622.86bd9b9e.chunk.js.map": "/static/js/622.86bd9b9e.chunk.js.map",
"420.1c2ec4dd.chunk.js.map": "/static/js/420.1c2ec4dd.chunk.js.map"
"main.79f288c9.css.map": "/static/css/main.79f288c9.css.map",
"main.69a32e2c.js.map": "/static/js/main.69a32e2c.js.map"
},
"entrypoints": [
"static/css/main.11b562ff.css",
"static/js/main.8ff0239a.js"
"static/css/main.79f288c9.css",
"static/js/main.69a32e2c.js"
]
}
2 changes: 1 addition & 1 deletion apps/frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/images/cln-favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="color-scheme" content="light dark"><meta name="description" content="Core lightning application"/><link rel="apple-touch-icon" href="/images/cln-logo-dark.png"/><title>Core Lightning</title><script defer="defer" src="/static/js/main.8ff0239a.js"></script><link href="/static/css/main.11b562ff.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./images/cln-favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="color-scheme" content="light dark"><meta name="description" content="Core lightning application"/><link rel="apple-touch-icon" href="./images/cln-logo-dark.png"/><title>Core Lightning</title><script defer="defer" src="/static/js/main.69a32e2c.js"></script><link href="/static/css/main.79f288c9.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
10 changes: 10 additions & 0 deletions apps/frontend/build/static/css/main.79f288c9.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apps/frontend/build/static/css/main.79f288c9.css.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions apps/frontend/build/static/js/main.69a32e2c.js

Large diffs are not rendered by default.

119 changes: 119 additions & 0 deletions apps/frontend/build/static/js/main.69a32e2c.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/

/*!
<<<<<<<< HEAD:apps/frontend/build/static/js/main.8ff0239a.js.LICENSE.txt
========
react-datepicker v7.6.0
https://github.com/Hacker0x01/react-datepicker
Released under the MIT License.
*/

/*!
>>>>>>>> 2c975d4 (Compiled code after all bookkeeper updatescommits):apps/frontend/build/static/js/main.69a32e2c.js.LICENSE.txt
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2024 Fonticons, Inc.
*/

/*!
* perfect-scrollbar v1.5.6
* Copyright 2024 Hyunje Jun, MDBootstrap and Contributors
* Licensed under MIT
*/

/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license qrcode.react
* Copyright (c) Paul O'Shannessy
* SPDX-License-Identifier: ISC
*/

/**
<<<<<<<< HEAD:apps/frontend/build/static/js/main.8ff0239a.js.LICENSE.txt
* @remix-run/router v1.23.0
========
* @remix-run/router v1.22.0
>>>>>>>> 2c975d4 (Compiled code after all bookkeeper updatescommits):apps/frontend/build/static/js/main.69a32e2c.js.LICENSE.txt
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
<<<<<<<< HEAD:apps/frontend/build/static/js/main.8ff0239a.js.LICENSE.txt
* React Router DOM v6.30.0
========
* React Router DOM v6.29.0
>>>>>>>> 2c975d4 (Compiled code after all bookkeeper updatescommits):apps/frontend/build/static/js/main.69a32e2c.js.LICENSE.txt
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
<<<<<<<< HEAD:apps/frontend/build/static/js/main.8ff0239a.js.LICENSE.txt
* React Router v6.30.0
========
* React Router v6.29.0
>>>>>>>> 2c975d4 (Compiled code after all bookkeeper updatescommits):apps/frontend/build/static/js/main.69a32e2c.js.LICENSE.txt
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

//! moment.js
1 change: 1 addition & 0 deletions apps/frontend/build/static/js/main.69a32e2c.js.map

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions apps/frontend/build/static/js/main.8ff0239a.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
*/

/*!
<<<<<<<< HEAD:apps/frontend/build/static/js/main.8ff0239a.js.LICENSE.txt
========
react-datepicker v7.6.0
https://github.com/Hacker0x01/react-datepicker
Released under the MIT License.
*/

/*!
>>>>>>>> 2c975d4 (Compiled code after all bookkeeper updatescommits):apps/frontend/build/static/js/main.69a32e2c.js.LICENSE.txt
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2024 Fonticons, Inc.
Expand Down Expand Up @@ -63,7 +72,11 @@
*/

/**
<<<<<<<< HEAD:apps/frontend/build/static/js/main.8ff0239a.js.LICENSE.txt
* @remix-run/router v1.23.0
========
* @remix-run/router v1.22.0
>>>>>>>> 2c975d4 (Compiled code after all bookkeeper updatescommits):apps/frontend/build/static/js/main.69a32e2c.js.LICENSE.txt
*
* Copyright (c) Remix Software Inc.
*
Expand All @@ -74,7 +87,11 @@
*/

/**
<<<<<<<< HEAD:apps/frontend/build/static/js/main.8ff0239a.js.LICENSE.txt
* React Router DOM v6.30.0
========
* React Router DOM v6.29.0
>>>>>>>> 2c975d4 (Compiled code after all bookkeeper updatescommits):apps/frontend/build/static/js/main.69a32e2c.js.LICENSE.txt
*
* Copyright (c) Remix Software Inc.
*
Expand All @@ -85,7 +102,11 @@
*/

/**
<<<<<<<< HEAD:apps/frontend/build/static/js/main.8ff0239a.js.LICENSE.txt
* React Router v6.30.0
========
* React Router v6.29.0
>>>>>>>> 2c975d4 (Compiled code after all bookkeeper updatescommits):apps/frontend/build/static/js/main.69a32e2c.js.LICENSE.txt
*
* Copyright (c) Remix Software Inc.
*
Expand All @@ -94,3 +115,5 @@
*
* @license MIT
*/

//! moment.js
6 changes: 5 additions & 1 deletion apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
"bootstrap": "^5.3.2",
"copy-to-clipboard": "^3.3.3",
"crypto-js": "^4.2.0",
"d3": "^7.9.0",
"framer-motion": "^10.16.5",
"node-sass": "^9.0.0",
"moment": "^2.30.1",
"node-sass": "^7.0.3",
"qrcode.react": "^3.1.0",
"react": "^18.2.0",
"react-bootstrap": "^2.10.1",
"react-datepicker": "^7.3.0",
"react-dom": "^18.2.0",
"react-perfect-scrollbar": "^1.5.8",
"react-router-dom": "^6.22.1"
Expand All @@ -30,6 +33,7 @@
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.1",
"@types/d3": "^7.4.3",
"@types/jest": "^29.5.12",
"@types/node": "^20.9.4",
"@types/react": "^18.2.61",
Expand Down
31 changes: 25 additions & 6 deletions apps/frontend/src/components/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import './App.scss';
import { useContext, useEffect } from 'react';
import { Outlet } from 'react-router-dom';
Expand All @@ -18,11 +16,32 @@ import LogoutComponent from '../modals/Logout/Logout';
import SetPasswordComponent from '../modals/SetPassword/SetPassword';
import logger from '../../services/logger.service';
import { AuthResponse } from '../../types/app-config.type';
import { EmptyHome } from '../ui/Loading/Loading';
import Bookkeeper from '../bookkeeper/BkprRoot/BkprRoot';
import CLNHome from '../cln/CLNHome/CLNHome';
import BalanceSheetRoot from '../bookkeeper/BalanceSheet/BalanceSheetRoot';
import SatsFlowRoot from '../bookkeeper/SatsFlow/SatsFlowRoot';
import VolumeRoot from '../bookkeeper/Volume/VolumeRoot';
import Terminal from '../bookkeeper/Terminal/TerminalRoot';

export const rootRouteConfig = [
{
path: "/", Component: Root,
children: [
{ path: "/", Component: () => <Navigate to="/home" replace /> },
{ path: "home", Component: CLNHome },
{ path: "bookkeeper", Component: Bookkeeper },
{ path: "bookkeeper/balancesheet", Component: BalanceSheetRoot },
{ path: "bookkeeper/satsflow", Component: SatsFlowRoot },
{ path: "bookkeeper/volume", Component: VolumeRoot },
{ path: "bookkeeper/terminal", Component: Terminal }
]
},
];

const rootRouter = createBrowserRouter(rootRouteConfig);

function App() {
const rootCtx = useContext(RootContext);
const clnCtx = useContext(CLNContext);
function Root() {
const appCtx = useContext(AppContext);
const currentScreenSize = useBreakpoint();
const { setCSRFToken, getAppConfigurations, getAuthStatus, initiateDataLoading } = useHttp();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
@import '../../../styles/constants.scss';

.react-datepicker-popper {
.react-datepicker {
border-color: $border-color;

&__header {
background-color: transparent;
border-bottom-color: $border-color;
}

&__navigation {
&-icon::before {
border-color: currentColor;
}

&:hover *::before {
border-color: $primary;
}
}

&__day {
&:hover {
background-color: rgba($primary, 0.1);
color: $primary;
}

&--selected {
background-color: $primary;
color: white;

&:hover {
background-color: darken($primary, 5%);
}
}

&--keyboard-selected {
background-color: rgba($primary, 0.1);
color: $primary;
}
}

&__current-month,
&__day-name {
color: inherit;
}
}
}

@include color-mode(dark) {
.react-datepicker-popper {
.react-datepicker {
background-color: $picker-background-color-dark;
border-color: $picker-border-color-dark;

&__header {
background-color: $picker-background-color-dark;
border-bottom-color: $picker-border-color-dark;
}

&__current-month,
&__day-name,
&__day {
color: $light-dark;
}

&__day {
&:hover {
background-color: rgba($primary, 0.1);
color: $primary;
}

&--selected {
background-color: $primary;
color: $white;

&:hover {
background-color: darken($primary, 5%);
}
}

&--keyboard-selected {
background-color: rgba($primary, 0.1);
color: $primary;
}
}

&__navigation-icon::before {
border-color: $light-dark;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { render, screen } from '@testing-library/react';
import BalanceSheetRoot from './BalanceSheetRoot';

jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useNavigate: jest.fn(),
}));

describe('Balance Sheet component ', () => {
beforeEach(() => render(<BalanceSheetRoot />));

it('should be in the document', () => {
expect(screen.getByTestId('balancesheet-container')).not.toBeEmptyDOMElement()
});
});
Loading