File size: 2,554 Bytes
7d05115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Project Structure Tree

project/
β”‚
β”œβ”€β”€ external_services/
β”‚   β”œβ”€β”€ linkedin_api/            # External LinkedIn API
β”‚   β”œβ”€β”€ bubble_db/               # Bubble.io database
β”‚   └── groq_api/                # GROQ API for NLP
β”‚
β”œβ”€β”€ core_application_ui/
β”‚   β”œβ”€β”€ app.py                   # Gradio UI, Main Control
β”‚   β”œβ”€β”€ ui_generators.py         # HTML & plot generation
β”‚   └── gradio_utils.py          # URL param helper
β”‚
β”œβ”€β”€ state_sync/
β”‚   β”œβ”€β”€ state_manager.py         # Manages TOKEN_STATE, Bubble read, sync decision
β”‚   β”œβ”€β”€ sync_logic.py            # Orchestrates data sync
β”‚   └── token_state/             # Gradio in-memory data store (conceptual)
β”‚
β”œβ”€β”€ linkedin_api_layer/
β”‚   β”œβ”€β”€ linkedin_data_api_calls.py       # Fetches LinkedIn posts, mentions, comments
β”‚   β”œβ”€β”€ linkedin_follower_stats.py       # Follower demographics
β”‚   β”œβ”€β”€ data_fetching_and_rendering.py   # Posts/Stats for analytics
β”‚   β”œβ”€β”€ mentions_dashboard.py            # Mentions data for analytics
β”‚   └── analytics_fetch_and_rendering.py # Fetch + render data for Analytics tab
β”‚
β”œβ”€β”€ nlp_services/
β”‚   β”œβ”€β”€ posts_categorization.py  # Summarization and classification (via GROQ)
β”‚   └── transformers/            # HuggingFace local models for sentiment
β”‚
β”œβ”€β”€ db_interface/
β”‚   └── bubble_api_calls.py      # Bubble CRUD API interface
β”‚
β”œβ”€β”€ utilities/
β”‚   β”œβ”€β”€ config.py                # Constants and environment variables
β”‚   β”œβ”€β”€ sessions.py              # LinkedIn API session management
β”‚   └── error_handling.py        # Error catching and display
β”‚
└── README.md                    # (Optional) Docs about architecture and flow




app.py
β”œβ”€β”€ uses: gradio_utils.py
β”œβ”€β”€ controls: state_manager.py
β”œβ”€β”€ triggers: sync_logic.py
β”œβ”€β”€ updates: token_state
└── renders: ui_generators.py, analytics_fetch_and_rendering.py

state_manager.py
β”œβ”€β”€ reads/writes: token_state
β”œβ”€β”€ reads: bubble_api_calls.py
└── uses: config.py

sync_logic.py
β”œβ”€β”€ reads/writes: token_state
β”œβ”€β”€ fetches from:
β”‚   β”œβ”€β”€ linkedin_data_api_calls.py
β”‚   β”œβ”€β”€ linkedin_follower_stats.py
β”œβ”€β”€ updates: bubble_api_calls.py
└── uses: config.py

linkedin_data_api_calls.py
β”œβ”€β”€ uses: sessions.py
β”œβ”€β”€ calls NLP: posts_categorization.py
β”œβ”€β”€ uses: transformers/
└── fetches from: LinkedIn API