Skip to content

Commit 2e5e422

Browse files
committed
Add initial treasury dashboard HUD
1 parent b69948d commit 2e5e422

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+515
-21
lines changed

.github/workflows/deploy.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ jobs:
8787
DIGITALOCEAN_APP_NAME: ${{ secrets.DIGITALOCEAN_APP_NAME }}
8888
DIGITALOCEAN_APP_DOMAIN: ${{ secrets.DIGITALOCEAN_APP_DOMAIN }}
8989
DIGITALOCEAN_APP_DOMAIN_ALIAS: ${{ vars.DIGITALOCEAN_APP_DOMAIN_ALIAS }}
90-
DIGITALOCEAN_SIZE_SLUG: ${{ secrets.DIGITALOCEAN_SIZE_SLUG }}
90+
DIGITALOCEAN_SIZE_SLUG: ${{ vars.DIGITALOCEAN_SIZE_SLUG }}
9191
PREFECT_API_KEY: ${{ secrets.PREFECT_API_KEY }}
9292
PREFECT_API_URL: ${{ secrets.PREFECT_API_URL }}
9393
ENV: ${{ secrets.ENV }}
94-
GUNICORN_TIMEOUT: ${{ secrets.GUNICORN_TIMEOUT }}
94+
GUNICORN_TIMEOUT: ${{ vars.GUNICORN_TIMEOUT }}
9595
steps:
9696
- name: Check out source repository
9797
uses: actions/checkout@v2

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,5 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
file_system_store/

app-spec.yml

+20
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ envs:
3030
name: ${DIGITALOCEAN_APP_NAME}
3131
region: nyc
3232
services:
33+
- environment_slug: python
34+
image:
35+
registry_type: DOCR
36+
repository: dash-apps
37+
tag: ${GITHUB_SHA}
38+
health_check:
39+
http_path: /
40+
initial_delay_seconds: 60
41+
timeout_seconds: 1200
42+
period_seconds: 20
43+
success_threshold: 1
44+
failure_threshold: 20
45+
http_port: 8050
46+
routes:
47+
- path: /
48+
instance_count: 1
49+
instance_size_slug: ${DIGITALOCEAN_SIZE_SLUG}
50+
name: treasury-dashboard
51+
run_command: gunicorn --worker-tmp-dir /dev/shm --timeout ${GUNICORN_TIMEOUT} src.apps.treasury.index:server
52+
source_dir: /
3353
- environment_slug: python
3454
image:
3555
registry_type: DOCR

docker-compose.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
version: "3.5"
22

33
services:
4-
tco2-dashboard:
5-
image: dash-apps
4+
treasury:
5+
# image: dash-apps
66
build:
77
context: ./
88
working_dir: /src
99
env_file: .env
1010
entrypoint: python
11-
command: ["-m", "src.apps.tco2_dashboard.app"]
11+
command: ["-m", "src.apps.treasury.index"]
1212
ports:
1313
- 8050:8050
1414
volumes:
1515
- ./:/src
1616

17-
api:
18-
image: dash-apps
19-
working_dir: /src
20-
env_file: .env
21-
entrypoint: python
22-
command: ["-m", "src.apps.api.app"]
23-
ports:
24-
- 8051:8050
25-
volumes:
26-
- ./:/src
17+
# api:
18+
# image: dash-apps
19+
# working_dir: /src
20+
# env_file: .env
21+
# entrypoint: python
22+
# command: ["-m", "src.apps.api.app"]
23+
# ports:
24+
# - 8051:8050
25+
# volumes:
26+
# - ./:/src

requirements1.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
dash-bootstrap-components==1.0.3
2+
dash-extensions==0.1.1
23
Flask_Caching==1.10.1
34
gunicorn
45
millify
56
orjson
67
pycountry==22.1.10
78
pytest
8-
pandas<2.0.0
9+
pandas<3.0
10+
subgrounds<1.7
911
werkzeug<2.1.0
1012
circlify==0.14.0
1113
matplotlib==3.5.2
1214
plotly==5.7.0
1315
kaleido==0.2.1
14-
dash==2.8.1
16+
dash==2.14.2
1517

requirements2.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
prefect==2.12.0
22
prefect-aws==0.3.7
3-
pydantic==1.10.9
43
pyarrow==12.0.0
54
Flask-RESTful==0.3.10

scripts/smoketest.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
FAILING=0
44

5-
ENTRIES=(src/apps/api/app.py:/api/v1)
5+
ENTRIES=(src/apps/api/app.py:/api/v1 src/apps/treasury/index.py:/)
66

77
for ENTRY in ${ENTRIES[@]}; do
88
ITEMS=(`echo $ENTRY | tr ":" " "`)
99
APP=${ITEMS[0]}
1010
SUBPATH=${ITEMS[1]}
1111
URL=http://127.0.0.1:8050$SUBPATH
12-
echo $APP : Starting
12+
echo $APP : Starting
1313
module="${APP////.}"
1414
nohup python -m ${module%.py} > /tmp/nohup.out 2>&1 &
1515
DASH_PID=$!
@@ -18,7 +18,7 @@ for ENTRY in ${ENTRIES[@]}; do
1818
echo $APP : Pinging $URL
1919
RESP_CODE=$(curl --head --location --write-out %{http_code} --silent --output response.txt $URL)
2020
echo $APP : Response code: $RESP_CODE
21-
kill $DASH_PID
21+
kill $DASH_PID
2222
# kill `lsof -w -n -i tcp:8050 | awk '$2!="PID" {print $2;}'` | head -n 1
2323
if [ "$RESP_CODE" != "200" ];
2424
then

src/apps/treasury/__init__.py

Whitespace-only changes.

src/apps/treasury/app.py

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import dash_bootstrap_components as dbc
2+
from dash import Dash
3+
4+
app = Dash(
5+
__name__,
6+
external_stylesheets=[dbc.themes.DARKLY],
7+
suppress_callback_exceptions=True,
8+
title="KlimaDAO Treasury Dashboard",
9+
use_pages=True,
10+
meta_tags=[
11+
{
12+
'name': 'viewport',
13+
'content':
14+
'width=device-width, initial-scale=1.0, maximum-scale=1.2, minimum-scale=0.5,'
15+
},
16+
{"property": "og:type", "content": "website"},
17+
{"property": "og:site_name", "content": "KlimaDAO Treasury Dashboard"},
18+
{"property": "og:title", "content": "Overview of KlimaDAO treasury composition and Green Ratio status"},
19+
{
20+
"property": "og:description",
21+
"content":
22+
"Overview of the inner workings of "
23+
"KlimaDAO's carbon-backed reserve currency protocol."
24+
},
25+
{
26+
"property": "og:image",
27+
"content": "https://static.wixstatic.com/media/5f17af_bfd51fccab89436e82f2cc2911097544~mv2.png/v1/fill/w_1306,h_734,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/5f17af_bfd51fccab89436e82f2cc2911097544~mv2.png" # noqa: E501
28+
},
29+
{"name": "twitter:card", "content": "summary_large_image"},
30+
{"name": "twitter:site", "content": "@discord"},
31+
{"name": "twitter:creator", "content": "@KlimaDAO"}
32+
]
33+
)
75.6 KB
Binary file not shown.
75.9 KB
Binary file not shown.
Binary file not shown.
76.9 KB
Binary file not shown.
76.3 KB
Binary file not shown.
76.1 KB
Binary file not shown.
75.9 KB
Binary file not shown.
76.3 KB
Binary file not shown.
+15
Loading
+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins)
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
http://scripts.sil.org/OFL
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/apps/treasury/assets/custom.css

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/* Fonts used in the app. To add a new font, it's easier to download the font tff file and import it here */
2+
@font-face {
3+
font-family: 'Como';
4+
src: url('Como/Como.ttf') format('truetype');
5+
}
6+
@font-face {
7+
font-family: 'Poppins';
8+
src: url('Poppins/Poppins-Regular.ttf') format('truetype');
9+
}
10+
@font-face {
11+
font-family: 'Poppins-SemiBold';
12+
src: url('Poppins/Poppins-SemiBold.ttf') format('truetype');
13+
}
14+
/* Set the default font to Poppins regular*/
15+
*{
16+
font-family: 'Poppins', sans-serif;
17+
}
18+
19+
.card_topic{
20+
font-family: 'Poppins-SemiBold', sans-serif;
21+
font-style: normal;
22+
font-weight: 500;
23+
font-size: 40px;
24+
line-height: 54px;
25+
text-align: center;
26+
color: #FFFFFF;
27+
}
28+
29+
.card_metric{
30+
font-family: 'Inter', sans-serif;
31+
font-style: normal;
32+
font-weight: 500;
33+
font-size: 26px;
34+
line-height: 54px;
35+
text-align: center;
36+
color: #FFFFFF;
37+
}
38+
.vl {
39+
border-left: 1px solid #FFFFFF;
40+
height: 100%;
41+
width: 1px;
42+
/*display: inline-block;*/
43+
margin: 0 auto;
44+
position: relative;
45+
transform: rotate(0deg);
46+
}
47+
.carousel-inner > .item > img {
48+
width:40px;
49+
height:60px;
50+
}
51+
52+
*{
53+
margin:0;
54+
padding:0;
55+
}
56+
body{
57+
font-family: 'Poppins', sans-serif;
58+
line-height:1.2;
59+
background-color: #202020;
60+
background-size:auto;
61+
background-position:center;
62+
}
63+
64+
.center {
65+
margin: auto;
66+
width: 100%;
67+
}
68+
.center_2{
69+
margin: 140px
70+
}
71+
72+

src/apps/treasury/assets/favicon.ico

1.9 KB
Binary file not shown.

src/apps/treasury/components/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)