Repository navigation
Expand file tree
/
Copy pathDashboard.py
More file actions
2741 lines (2335 loc) · 118 KB
/
Copy pathDashboard.py
File metadata and controls
2741 lines (2335 loc) · 118 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import streamlit as st
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
from datetime import datetime, timedelta
import calendar
import json
from login import login_form, logout
# Configure page
st.set_page_config(
page_title="Acolyte CXO Dashboard",
page_icon="🎯",
layout="wide",
initial_sidebar_state="expanded"
)
# Check authentication
if not st.session_state.get('authenticated', False):
st.title("Acolyte CXO Dashboard")
login_form()
else:
# Sidebar
with st.sidebar:
st.markdown(f"""
**Logged in as:**
{st.session_state.user_name}
{st.session_state.user_email}
""")
if st.button("Logout"):
logout()
st.title("Welcome to Acolyte CXO Dashboard")
# ... rest of your dashboard code ...
# Helper functions
def format_indian_currency(amount):
"""Convert number to Indian currency format with lakhs and crores"""
if amount >= 10000000: # 1 Crore
return f"₹{amount/10000000:.2f}Cr"
elif amount >= 100000: # 1 Lakh
return f"₹{amount/100000:.2f}L"
elif amount >= 1000: # 1 Thousand
return f"₹{amount/1000:.2f}"
else:
return f"₹{amount:.2f}"
def calculate_burn_rate():
total_q1 = sum(st.session_state.financial_data['budget']['Q1_2025'].values())
return total_q1 / 90 # Daily burn rate for Q1
def calculate_runway(total_funding=2500000): # 25L F&F round
daily_burn = calculate_burn_rate()
return total_funding / daily_burn if daily_burn > 0 else 0
def calculate_runway_with_buffer(total_funding=2500000, buffer=500000):
"""Calculate runway considering minimum buffer"""
usable_funding = total_funding - buffer
daily_burn = calculate_burn_rate()
return usable_funding / daily_burn if daily_burn > 0 else 0
def calculate_cac():
try:
total_spent = sum(st.session_state.financial_data['budget']['Q1_2025'].values())
total_users = (st.session_state.financial_data['users']['institutional'] +
st.session_state.financial_data['users']['digital'])
return total_spent / total_users if total_users > 0 else 0
except Exception:
return 0
def create_growth_trajectory_data():
dates = pd.date_range(start='2025-01-01', end='2025-03-31', freq='D')
# Weekly target calculation
weekly_targets = []
current_trajectory = []
base_weekly_increment = 20 # Starting with 20 users per week
cumulative_users = 0
for i, date in enumerate(dates):
week = (date - datetime(2025, 1, 1)).days // 7
# Weekly target increases over time
if week < 4:
target = 20
elif week < 8:
target = 30
else:
target = 40
weekly_targets.append(target)
# Create stepped growth for current trajectory
if i % 7 == 0: # At the start of each week
cumulative_users += target
current_trajectory.append(cumulative_users)
return pd.DataFrame({
'Date': dates,
'Weekly_Target': [20] * len(dates), # Constant target line
'Current_Trajectory': current_trajectory,
'First_Buffer': [175] * len(dates),
'Second_Buffer': [250] * len(dates)
})
if 'financial_data' not in st.session_state:
st.session_state.financial_data = {
'budget': {
'Q1_2025': {
'developer_costs': 150000,
'marketing_spends': 150000,
'aws_ai_model': 74700,
'aws_other': 50000,
'sales_budget': 160000,
'variable_costs': 40300
},
'Q2_2025': {
'developer_costs': 300000,
'marketing_spends': 300000,
'aws_ai_model': 149400,
'aws_other': 100000,
'sales_budget': 320000,
'variable_costs': 80600
}
},
'users': {
'institutional': 0,
'digital': 0,
'weekly_targets': {
'week1-4': 20,
'week5-8': 30,
'week9-12': 40
}
},
'partnerships': {
'active': 0,
'pipeline': [],
'total_potential_users': 0
},
'metrics': {
'cac': 0,
'burn_rate': 0,
'runway_days': 0,
'institutional_cac': 827,
'digital_cac': 3720
}
}
# Navigation
pages = ['Dashboard Overview', 'Financial Strategy', 'Partnership Tracker', 'User Analytics','Financial Projections','Investor Dashboard','Cap Table']
page = st.sidebar.radio('Navigation', pages)
if page == 'Dashboard Overview':
st.title('Acolyte CXO Dashboard')
# Top KPI Cards with Enhanced Metrics
col1, col2, col3, col4 = st.columns(4)
burn_rate = calculate_burn_rate()
runway = calculate_runway()
runway_with_buffer = calculate_runway_with_buffer()
cac = calculate_cac()
total_users = (st.session_state.financial_data['users']['institutional'] +
st.session_state.financial_data['users']['digital'])
with col1:
st.metric(
"Daily Burn Rate(In Thousands)",
format_indian_currency(burn_rate),
f"{runway:.0f} days runway"
)
st.caption(f"Buffer Adjusted: {runway_with_buffer:.0f} days")
with col2:
st.metric(
"Total Users",
f"{total_users}",
f"Target: {st.session_state.financial_data['users']['weekly_targets']['week1-4']} weekly"
)
st.caption(f"CAC: {format_indian_currency(cac)}")
with col3:
active_partnerships = st.session_state.financial_data['partnerships']['active']
st.metric(
"Active Partnerships",
f"{active_partnerships}", # Display just the number
"Target: 15-20"
)
# Add pipeline info as caption if needed
pipeline_count = len(st.session_state.financial_data['partnerships']['pipeline'])
st.caption(f"Pipeline: {pipeline_count} opportunities")
with col4:
total_budget = 2500000 # 25L F&F round
used_budget = sum(st.session_state.financial_data['budget']['Q1_2025'].values())
utilization = (used_budget/total_budget)*100
st.metric(
"Budget Utilization",
f"{utilization:.1f}%",
format_indian_currency(total_budget - used_budget) + " remaining"
)
# Budget Overview in Dashboard Overview page
st.header("Budget Overview")
col1, col2 = st.columns(2)
with col1:
# Current Q1 Budget Pie Chart
current_budget = st.session_state.financial_data['budget']['Q1_2025']
budget_df = pd.DataFrame({
'Category': current_budget.keys(),
'Amount': current_budget.values(),
'Percentage': [v/sum(current_budget.values())*100 for v in current_budget.values()]
})
budget_df['Amount_Formatted'] = budget_df['Amount'].apply(format_indian_currency)
fig = px.pie(budget_df, values='Amount', names='Category',
title='Q1 2025 Budget Distribution')
fig.update_layout(template="plotly_dark")
st.plotly_chart(fig, use_container_width=True)
# Show detailed breakdown
st.dataframe(budget_df[['Category', 'Amount_Formatted', 'Percentage']].style.format({
'Percentage': '{:.1f}%'
}))
with col2:
# Budget Utilization Gauge
total_budget = 2500000 # 25L F&F round
used_budget = sum(current_budget.values())
fig = go.Figure(go.Indicator(
mode = "gauge+number+delta",
value = (used_budget/total_budget)*100,
title = {'text': f"Budget Utilization"},
delta = {'reference': 80},
gauge = {
'axis': {'range': [None, 100]},
'threshold': {
'line': {'color': "red", 'width': 4},
'thickness': 0.75,
'value': 80
},
'steps': [
{'range': [0, 50], 'color': "lightgray"},
{'range': [50, 80], 'color': "gray"},
{'range': [80, 100], 'color': "red"}
]
}
))
fig.update_layout(template="plotly_dark")
st.plotly_chart(fig, use_container_width=True)
# Key metrics
st.metric("Total Budget", format_indian_currency(total_budget))
st.metric("Used Budget", format_indian_currency(used_budget))
st.metric("Remaining Budget", format_indian_currency(total_budget - used_budget))
# Additional Budget Analysis
st.header("Additional Budget Analysis")
# Risk Analysis
st.subheader("Risk Analysis")
risk_col1, risk_col2 = st.columns(2)
with risk_col1:
st.metric("Expected Monthly Burn Q2", "₹4.17L")
st.metric("Best Case Burn", "₹3.75L", "-10%")
st.metric("Worst Case Burn", "₹4.58L", "+10%")
with risk_col2:
st.metric("Expected Runway", "7 months")
st.metric("Best Case Runway", "8 months", "+1 month")
st.metric("Worst Case Runway", "6 months", "-1 month")
# Seed Round Allocation
st.subheader("Seed Round Allocation Plan")
seed_col1, seed_col2, seed_col3 = st.columns(3)
with seed_col1:
st.metric("Product Development", "₹2.00Cr", "40%")
with seed_col2:
st.metric("Market Expansion", "₹1.75Cr", "35%")
with seed_col3:
st.metric("Operations", "₹1.25Cr", "25%")
# Budget Control Triggers
st.subheader("Budget Control Triggers")
trigger_data = pd.DataFrame({
'Trigger Level': ['Warning', 'Critical Review', 'Emergency Measures'],
'Monthly Spend': ['110%', '120%', '130%'],
'Action Required': [
'Review and Optimize',
'Freeze Non-Essential Spending',
'Implement Emergency Measures'
]
})
st.dataframe(trigger_data)
# User Growth Analysis
st.header("User Growth Analysis")
growth_tab1, growth_tab2 = st.tabs(["Growth Trajectory", "Channel Analysis"])
with growth_tab1:
growth_data = create_growth_trajectory_data()
fig = go.Figure()
# Add weekly target line
fig.add_trace(go.Scatter(
x=growth_data['Date'],
y=growth_data['Weekly_Target'],
name='Weekly Target',
line=dict(color='blue', width=1)
))
# Add current trajectory
fig.add_trace(go.Scatter(
x=growth_data['Date'],
y=growth_data['Current_Trajectory'],
name='Current Trajectory',
line=dict(color='lightblue', width=2)
))
# Add buffer release lines
fig.add_hline(y=175, line_dash="dash",
annotation_text="First Buffer Release",
line_color="gray")
fig.add_hline(y=250, line_dash="dash",
annotation_text="Second Buffer Release",
line_color="gray")
fig.update_layout(
title='User Growth vs Target',
xaxis_title='Date',
yaxis_title='Users',
yaxis_range=[0, 500],
showlegend=True,
template="plotly_dark"
)
st.plotly_chart(fig, use_container_width=True)
elif page == 'Financial Strategy':
st.title('Financial Strategy')
# F&F Round Overview
st.header("Friends & Family Round (Q1 2025)")
ff_col1, ff_col2, ff_col3 = st.columns(3)
with ff_col1:
st.metric("Target Raise", "₹25L", "5% Equity")
st.metric("Pre-money Valuation", "₹5Cr", None)
with ff_col2:
st.metric("Confirmed Investment", "₹12-15L", "As of Nov 2024")
st.metric("Round Timeline", "Dec 15 - Jan 5", "2024-25")
with ff_col3:
st.metric("Minimum Investment", "₹50K", "Per Investor")
st.metric("Buffer Reserve", "₹5L", "20% of Round")
# Budget Analysis
st.header("Budget Analysis")
budget_tabs = st.tabs(["Current Budget", "Quarter Comparison", "Projections","Cap Table & Dilution"])
with budget_tabs[0]: # Current Budget
col1, col2 = st.columns(2)
with col1:
# Current Q1 Budget Pie Chart
current_budget = st.session_state.financial_data['budget']['Q1_2025']
budget_df = pd.DataFrame({
'Category': current_budget.keys(),
'Amount': current_budget.values(),
'Percentage': [v/sum(current_budget.values())*100 for v in current_budget.values()]
})
budget_df['Amount_Formatted'] = budget_df['Amount'].apply(format_indian_currency)
fig = px.pie(budget_df, values='Amount', names='Category',
title='Q1 2025 Budget Distribution')
fig.update_layout(template="plotly_dark")
st.plotly_chart(fig, use_container_width=True)
# Show detailed breakdown
st.dataframe(budget_df[['Category', 'Amount_Formatted', 'Percentage']].style.format({
'Percentage': '{:.1f}%'
}))
with col2:
# Budget Utilization Gauge
total_budget = 2500000 # 25L F&F round
used_budget = sum(current_budget.values())
fig = go.Figure(go.Indicator(
mode = "gauge+number+delta",
value = (used_budget/total_budget)*100,
title = {'text': f"Budget Utilization"},
delta = {'reference': 80},
gauge = {
'axis': {'range': [None, 100]},
'threshold': {
'line': {'color': "red", 'width': 4},
'thickness': 0.75,
'value': 80
},
'steps': [
{'range': [0, 50], 'color': "lightgray"},
{'range': [50, 80], 'color': "gray"},
{'range': [80, 100], 'color': "red"}
]
}
))
fig.update_layout(template="plotly_dark")
st.plotly_chart(fig, use_container_width=True)
# Key metrics
st.metric("Total Budget", format_indian_currency(total_budget))
st.metric("Used Budget", format_indian_currency(used_budget))
st.metric("Remaining Budget", format_indian_currency(total_budget - used_budget))
with budget_tabs[1]: # Quarter Comparison
st.subheader("Q1 vs Q2 Comparison")
q1_budget = st.session_state.financial_data['budget']['Q1_2025']
q2_budget = st.session_state.financial_data['budget']['Q2_2025']
comparison_df = pd.DataFrame({
'Category': q1_budget.keys(),
'Q1_Amount': q1_budget.values(),
'Q2_Amount': q2_budget.values()
})
comparison_df['Growth'] = ((comparison_df['Q2_Amount'] - comparison_df['Q1_Amount']) /
comparison_df['Q1_Amount'] * 100)
col1, col2 = st.columns(2)
with col1:
# Bar chart comparison
fig = px.bar(comparison_df, x='Category',
y=['Q1_Amount', 'Q2_Amount'],
title='Quarter-over-Quarter Comparison',
barmode='group')
fig.update_layout(template="plotly_dark")
st.plotly_chart(fig, use_container_width=True)
with col2:
# Growth metrics
for idx, row in comparison_df.iterrows():
st.metric(
row['Category'].replace('_', ' ').title(),
format_indian_currency(row['Q2_Amount']),
f"{row['Growth']:+.1f}%"
)
with budget_tabs[2]: # Projections
col1, col2 = st.columns(2)
with col1:
# Q2 Projected Budget Distribution
q2_df = pd.DataFrame({
'Category': q2_budget.keys(),
'Amount': q2_budget.values(),
'Percentage': [v/sum(q2_budget.values())*100 for v in q2_budget.values()]
})
fig = px.pie(q2_df, values='Amount', names='Category',
title='Q2 2025 Projected Budget Distribution')
fig.update_layout(template="plotly_dark")
st.plotly_chart(fig, use_container_width=True)
with col2:
# Quarter-over-Quarter comparison
fig = px.bar(comparison_df, x='Category',
y=['Q1_Amount', 'Q2_Amount'],
title='Budget Growth Comparison',
barmode='group')
fig.update_layout(template="plotly_dark")
st.plotly_chart(fig, use_container_width=True)
# Budget Growth Analysis
st.subheader("Budget Growth Analysis")
growth_df = comparison_df.copy()
growth_df['Q1_Amount'] = growth_df['Q1_Amount'].apply(format_indian_currency)
growth_df['Q2_Amount'] = growth_df['Q2_Amount'].apply(format_indian_currency)
growth_df['Growth'] = growth_df['Growth'].apply(lambda x: f"{x:+.1f}%")
st.dataframe(growth_df)
# Key Budget Insights
st.subheader("Key Budget Insights")
insight_col1, insight_col2 = st.columns(2)
with insight_col1:
q1_total = sum(q1_budget.values())
q2_total = sum(q2_budget.values())
st.metric("Q1 Total Budget", format_indian_currency(q1_total))
st.metric("Q2 Projected Budget", format_indian_currency(q2_total),
f"{((q2_total-q1_total)/q1_total)*100:+.1f}%")
with insight_col2:
st.metric("Monthly Burn Q1", format_indian_currency(q1_total/3))
st.metric("Projected Monthly Burn Q2", format_indian_currency(q2_total/3),
f"{((q2_total-q1_total)/q1_total)*100:+.1f}%")
with budget_tabs[3]: # Cap Table & Dilution
st.header("Cap Table & Dilution Analysis")
# Define cap table data structure
cap_table_data = {
'initial': {
'valuation': 10000, # Initial 1000 shares at ₹10
'share_value': 10,
'shareholders': {
'Nischay BK': {'shares': 500, 'type': 'Ordinary'},
'Subha': {'shares': 500, 'type': 'Ordinary'}
}
},
'post_team': {
'valuation': 16650, # 1665 shares at ₹10
'share_value': 10,
'shareholders': {
'Nischay BK': {'shares': 500, 'type': 'Ordinary'},
'Subha': {'shares': 500, 'type': 'Ordinary'},
'Boppl Pvt Ltd': {'shares': 416, 'type': 'Ordinary'},
'Ayesha': {'shares': 83, 'type': 'Ordinary'},
'Jason': {'shares': 83, 'type': 'Ordinary'},
'Varun': {'shares': 83, 'type': 'Ordinary'}
}
},
'post_ff': {
'valuation': 2500000, # F&F round of 25L
'share_value': 28409, # 25L/88 new shares
'shareholders': {
'Nischay BK': {'shares': 500, 'type': 'Ordinary'},
'Subha': {'shares': 500, 'type': 'Ordinary'},
'Boppl Pvt Ltd': {'shares': 416, 'type': 'Ordinary'},
'Ayesha': {'shares': 83, 'type': 'Ordinary'},
'Jason': {'shares': 83, 'type': 'Ordinary'},
'Varun': {'shares': 83, 'type': 'Ordinary'},
'F&F Investors': {'shares': 88, 'type': 'Preferred'}
}
},
'post_seed': {
'valuation': 50000000, # 5Cr investment for 10%
'share_value': 256410, # 5Cr/195 new shares
'shareholders': {
'Nischay BK': {'shares': 500, 'type': 'Ordinary'},
'Subha': {'shares': 500, 'type': 'Ordinary'},
'Boppl Pvt Ltd': {'shares': 416, 'type': 'Ordinary'},
'Ayesha': {'shares': 83, 'type': 'Ordinary'},
'Jason': {'shares': 83, 'type': 'Ordinary'},
'Varun': {'shares': 83, 'type': 'Ordinary'},
'F&F Investors': {'shares': 88, 'type': 'Preferred'},
'VC Investment': {'shares': 195, 'type': 'Preferred'}
}
}
}
# Function to calculate ownership percentages and values
def calculate_cap_table_metrics(round_data):
total_shares = sum(shareholder['shares'] for shareholder in round_data['shareholders'].values())
metrics = []
for name, data in round_data['shareholders'].items():
current_shares = data['shares']
percentage = (current_shares / total_shares) * 100
value = current_shares * round_data['share_value']
fully_diluted_value = value if round_data['valuation'] >= 2500000 else value * (2500000 / round_data['valuation'])
metrics.append({
'Shareholder': name,
'Shares': current_shares,
'Type': data['type'],
'Percentage': percentage,
'Current Value': value,
'Fully Diluted Value': fully_diluted_value if name not in ['F&F Investors', 'VC Investment'] else value
})
metrics_df = pd.DataFrame(metrics)
metrics_df = metrics_df.sort_values('Shares', ascending=False)
return metrics_df
# Create nested tabs for different rounds
round_tabs = st.tabs(["Initial Round", "Team Round", "F&F Round", "Seed Round"])
# Display cap table for each round
for tab, (round_name, round_data) in zip(round_tabs, cap_table_data.items()):
with tab:
# Create three columns for metrics
metric_cols = st.columns(3)
with metric_cols[0]:
st.metric("Valuation", format_indian_currency(round_data['valuation']))
with metric_cols[1]:
st.metric("Share Value", format_indian_currency(round_data['share_value']))
with metric_cols[2]:
total_shares = sum(shareholder['shares'] for shareholder in round_data['shareholders'].values())
st.metric("Total Shares", f"{total_shares:,}")
# Calculate and display detailed cap table
df = calculate_cap_table_metrics(round_data)
# Display ownership table and chart side by side
table_col, chart_col = st.columns([3, 2])
with table_col:
st.dataframe(df.style.format({
'Shares': '{:,.0f}',
'Percentage': '{:.2f}%',
'Value': lambda x: format_indian_currency(x)
}), use_container_width=True)
with chart_col:
fig = px.pie(df, values='Shares', names='Shareholder',
title=f'Ownership Distribution - {round_name.replace("_", " ").title()}')
fig.update_layout(template="plotly_dark")
st.plotly_chart(fig, use_container_width=True)
# Dilution Analysis
st.subheader("Founder Dilution Analysis")
# Calculate founder dilution across rounds
founder_dilution = []
for round_name, round_data in cap_table_data.items():
total_shares = sum(shareholder['shares'] for shareholder in round_data['shareholders'].values())
founder_shares = round_data['shareholders']['You']['shares'] + round_data['shareholders']['Subha']['shares']
founder_percentage = (founder_shares / total_shares) * 100
founder_dilution.append({
'Round': round_name.replace('_', ' ').title(),
'Founder Ownership': founder_percentage
})
# Create dilution visualization
dilution_df = pd.DataFrame(founder_dilution)
fig = px.line(dilution_df, x='Round', y='Founder Ownership',
title='Founder Ownership Dilution',
markers=True)
fig.update_layout(
template="plotly_dark",
yaxis_title="Founder Ownership (%)"
)
st.plotly_chart(fig, use_container_width=True)
# Available Capital Analysis
st.subheader("Available Capital Analysis")
authorized_shares = 10000
used_shares = sum(shareholder_data['shares'] for shareholder_data in
cap_table_data['post_seed']['shareholders'].values())
remaining_shares = authorized_shares - used_shares
capital_cols = st.columns(2)
with capital_cols[0]:
st.metric("Authorized Shares", f"{authorized_shares:,}")
st.metric("Used Shares", f"{used_shares:,}")
st.metric("Available Shares", f"{remaining_shares:,}")
with capital_cols[1]:
remaining_capital_df = pd.DataFrame({
'Category': ['Used Shares', 'Available Shares'],
'Shares': [used_shares, remaining_shares]
})
fig = px.pie(remaining_capital_df, values='Shares', names='Category',
title='Authorized Capital Utilization')
fig.update_layout(template="plotly_dark")
st.plotly_chart(fig, use_container_width=True)
# Success Buffer Strategy
st.header("Success Buffer Release Strategy")
buffer_col1, buffer_col2, buffer_col3 = st.columns(3)
total_users = (st.session_state.financial_data['users']['institutional'] +
st.session_state.financial_data['users']['digital'])
with buffer_col1:
st.subheader("Initial Operating Budget")
st.metric("Amount", "₹1.46L", "Immediately Available")
st.markdown("""
- Partnership Development: ₹50K
- Onboarding Resources: ₹30K
- Operations & Engagement: ₹66K
""")
with buffer_col2:
st.subheader("First Buffer Release")
progress1 = (total_users/175 * 100) if total_users <= 175 else 100
st.metric("Target", "175 Users", f"Current: {total_users}")
st.metric("Release Amount", "₹20K", "At 175 users")
st.progress(progress1/100, f"Progress: {progress1:.1f}%")
with buffer_col3:
st.subheader("Second Buffer Release")
progress2 = (total_users/250 * 100) if total_users <= 250 else 100
st.metric("Target", "250 Users", f"Current: {total_users}")
st.metric("Release Amount", "₹20K", "At 250 users")
st.progress(progress2/100, f"Progress: {progress2:.1f}%")
# Risk Management
st.header("Risk Management & Contingency")
# Risk Scenarios
risk_col1, risk_col2, risk_col3 = st.columns(3)
with risk_col1:
st.subheader("Best Case")
st.metric("Monthly Burn", format_indian_currency(q2_total/3 * 0.9))
st.metric("Runway", "8 months")
st.markdown("- Optimal resource utilization\n- High user conversion\n- Early partnerships")
with risk_col2:
st.subheader("Expected Case")
st.metric("Monthly Burn", format_indian_currency(q2_total/3))
st.metric("Runway", "7 months")
st.markdown("- Planned resource allocation\n- Target user acquisition\n- Regular partnership closure")
with risk_col3:
st.subheader("Worst Case")
st.metric("Monthly Burn", format_indian_currency(q2_total/3 * 1.1))
st.metric("Runway", "6 months")
st.markdown("- Higher resource needs\n- Slower user growth\n- Delayed partnerships")
# Budget Control Triggers
st.subheader("Budget Control Triggers")
triggers_df = pd.DataFrame({
'Trigger Level': ['Warning', 'Critical Review', 'Emergency Measures'],
'Monthly Spend': ['110%', '120%', '130%'],
'Action Required': [
'Review and Optimize',
'Freeze Non-Essential Spending',
'Implement Emergency Measures'
],
'Impact Level': ['Low', 'Medium', 'High']
})
st.dataframe(triggers_df, use_container_width=True)
# Seed Round Planning
st.header("Seed Round Planning")
seed_col1, seed_col2 = st.columns(2)
with seed_col1:
st.subheader("Target Metrics")
st.metric("Target Raise", "₹5Cr")
st.metric("Target Timeline", "End of Q2 2025")
st.metric("User Target", "1000 active users")
with seed_col2:
st.subheader("Allocation Plan")
seed_allocation = {
'Product Development': 40,
'Market Expansion': 35,
'Operations': 25
}
fig = px.pie(
values=list(seed_allocation.values()),
names=list(seed_allocation.keys()),
title='Planned Seed Round Allocation'
)
fig.update_layout(template="plotly_dark")
st.plotly_chart(fig, use_container_width=True)
elif page == 'Partnership Tracker':
st.title('Partnership Tracker')
# Add new partnership form
st.header("Add New Partnership")
with st.form("new_partnership"):
col1, col2 = st.columns(2)
with col1:
institution_name = st.text_input("Institution Name")
potential_students = st.number_input("Potential Students", min_value=0)
stage = st.selectbox("Stage", ["Initial Contact", "In Discussion",
"Agreement Phase", "Active"])
with col2:
contact_person = st.text_input("Contact Person")
expected_closure = st.date_input("Expected Closure Date")
notes = st.text_area("Notes")
submitted = st.form_submit_button("Add Partnership")
if submitted:
new_partnership = {
'name': institution_name,
'potential_students': potential_students,
'stage': stage,
'contact': contact_person,
'expected_closure': str(expected_closure),
'notes': notes,
'date_added': str(datetime.now().date())
}
st.session_state.financial_data['partnerships']['pipeline'].append(new_partnership)
if stage == 'Active':
st.session_state.financial_data['partnerships']['active'] += 1
st.session_state.financial_data['partnerships']['total_potential_users'] += potential_students
st.success(f"Partnership with {institution_name} added successfully!")
# Partnership Overview
st.header("Partnership Overview")
col1, col2, col3 = st.columns(3)
with col1:
st.metric("Active Partnerships",
st.session_state.financial_data['partnerships']['active'],
"Target: 15-20")
with col2:
pipeline_count = len(st.session_state.financial_data['partnerships']['pipeline'])
st.metric("Pipeline Opportunities", pipeline_count)
with col3:
total_potential = st.session_state.financial_data['partnerships']['total_potential_users']
st.metric("Potential Users", total_potential)
# Partnership Pipeline
if len(st.session_state.financial_data['partnerships']['pipeline']) > 0:
st.header("Partnership Pipeline")
# Convert pipeline data to DataFrame
pipeline_df = pd.DataFrame(st.session_state.financial_data['partnerships']['pipeline'])
# Stage-wise analysis
st.subheader("Pipeline Analysis")
if not pipeline_df.empty:
# Create pipeline visualization
fig = px.bar(pipeline_df,
x='stage',
y='potential_students',
title='Potential Users by Stage',
color='stage')
st.plotly_chart(fig, use_container_width=True)
# Detailed pipeline table
st.subheader("Pipeline Details")
display_columns = ['name', 'stage', 'potential_students',
'expected_closure', 'contact', 'notes']
if all(col in pipeline_df.columns for col in display_columns):
st.dataframe(pipeline_df[display_columns].sort_values('expected_closure'),
use_container_width=True)
# Pipeline Health Metrics
st.header("Pipeline Health")
health_col1, health_col2 = st.columns(2)
with health_col1:
if st.session_state.financial_data['partnerships']['active'] > 0:
progress = (st.session_state.financial_data['partnerships']['active'] / 15) * 100
st.metric("Progress to Target", f"{progress:.1f}%", "Target: 15 partnerships")
st.progress(min(progress/100, 1.0))
with health_col2:
avg_users = (st.session_state.financial_data['partnerships']['total_potential_users'] /
max(pipeline_count, 1))
st.metric("Avg Users per Partnership", f"{avg_users:.0f}", "Target: 50 per partnership")
# Add export functionality for partnerships data
if st.button("Export Partnership Data"):
partnership_data = pd.DataFrame(st.session_state.financial_data['partnerships']['pipeline'])
st.download_button(
label="Download Partnership Data as CSV",
data=partnership_data.to_csv(index=False),
file_name="partnership_pipeline.csv",
mime="text/csv"
)
elif page == 'User Analytics':
st.title('User Analytics')
# User Overview
st.header("User Overview")
col1, col2, col3, col4 = st.columns(4)
with col1:
st.metric("Institutional Users",
st.session_state.financial_data['users']['institutional'],
"75% of Total Target")
with col2:
st.metric("Digital Users",
st.session_state.financial_data['users']['digital'],
"25% of Total Target")
with col3:
total_users = (st.session_state.financial_data['users']['institutional'] +
st.session_state.financial_data['users']['digital'])
st.metric("Total Users", total_users)
with col4:
cac = calculate_cac()
st.metric("Overall CAC", format_indian_currency(cac))
# Growth Analysis
st.header("Growth Analysis")
growth_tabs = st.tabs(["Growth Trajectory", "Channel Performance", "CAC Analysis"])
with growth_tabs[0]:
growth_data = create_growth_trajectory_data() # Using the same function
fig = go.Figure()
# Add weekly target line
fig.add_trace(go.Scatter(
x=growth_data['Date'],
y=growth_data['Weekly_Target'],
name='Weekly Target',
line=dict(color='blue', width=1)
))
# Add current trajectory
fig.add_trace(go.Scatter(
x=growth_data['Date'],
y=growth_data['Current_Trajectory'],
name='Current Trajectory',
line=dict(color='lightblue', width=2)
))
# Add buffer release lines
fig.add_hline(y=175, line_dash="dash",
annotation_text="First Buffer Release",
line_color="gray")
fig.add_hline(y=250, line_dash="dash",
annotation_text="Second Buffer Release",
line_color="gray")
fig.update_layout(
title='User Growth Trajectory',
xaxis_title='Date',
yaxis_title='Users',
yaxis_range=[0, 500],
showlegend=True,
template="plotly_dark"
)
st.plotly_chart(fig, use_container_width=True)
with growth_tabs[1]:
col1, col2 = st.columns(2)
with col1:
channel_data = pd.DataFrame({
'Channel': ['Institutional', 'Digital'],
'Users': [st.session_state.financial_data['users']['institutional'],
st.session_state.financial_data['users']['digital']],
'Target_Split': [75, 25]
})
fig = px.pie(channel_data, values='Users', names='Channel',
title='Current User Distribution')
st.plotly_chart(fig, use_container_width=True)
with col2:
fig = px.bar(channel_data, x='Channel', y=['Users', 'Target_Split'],
title='Channel Performance vs Target',
barmode='group')
st.plotly_chart(fig, use_container_width=True)
with growth_tabs[2]:
col1, col2 = st.columns(2)
with col1:
cac_data = pd.DataFrame({
'Channel': ['Institutional', 'Digital'],
'Current_CAC': [st.session_state.financial_data['metrics']['institutional_cac'],
st.session_state.financial_data['metrics']['digital_cac']],
'Target_CAC': [1000, 2000]
})
fig = px.bar(cac_data, x='Channel', y=['Current_CAC', 'Target_CAC'],
title='CAC Performance vs Target',
barmode='group')
st.plotly_chart(fig, use_container_width=True)
with col2:
# CAC Trend (simulated data for demonstration)
cac_trend = pd.DataFrame({
'Week': range(1, 13),
'Institutional_CAC': [827] * 12,
'Digital_CAC': [3720] * 12
})
fig = px.line(cac_trend, x='Week', y=['Institutional_CAC', 'Digital_CAC'],
title='CAC Trend by Channel')
st.plotly_chart(fig, use_container_width=True)
st.subheader("CAC Analysis & Breakdown")
# Input Section for CAC Parameters
st.write("#### CAC Input Parameters")
input_col1, input_col2 = st.columns(2)
with input_col1:
# Marketing Costs
st.write("Marketing Costs")
digital_marketing = st.number_input("Digital Marketing Budget (₹)",
value=150000, step=10000, key="digital_mkt")
content_creation = st.number_input("Content Creation Cost (₹)",
value=30000, step=5000, key="content")
events_cost = st.number_input("Events & Workshops Cost (₹)",
value=50000, step=5000, key="events")
with input_col2:
# Sales Costs
st.write("Sales Costs")
sales_team = st.number_input("Sales Team Cost (₹)",
value=160000, step=10000, key="sales")
travel_cost = st.number_input("Travel & Meeting Cost (₹)",