Spaces:
Sleeping
Sleeping
Commit ·
8b86c19
1
Parent(s): bb193ea
Replace all AGS AI references with CropDriveTM
Browse files- Updated app title, subtitles, and copyright notices
- Replaced AGS AI Assistant with CropDriveTM Assistant
- Updated PDF generation system name
- Updated admin account email and name
- Updated machine ID file name
- Updated all translation strings (English and Malaysian)
- Updated README.md title
- .gitignore +29 -0
- README.md +2 -2
- app.py +2 -2
- modules/__init__.py +1 -1
- modules/dashboard.py +1 -1
- modules/upload.py +1 -1
- utils/auth_utils.py +7 -7
- utils/parameter_standardizer.py +1 -1
- utils/translations.py +9 -9
.gitignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Python
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
*.so
|
| 6 |
+
.Python
|
| 7 |
+
|
| 8 |
+
# Virtual environments
|
| 9 |
+
venv/
|
| 10 |
+
env/
|
| 11 |
+
ENV/
|
| 12 |
+
|
| 13 |
+
# IDE
|
| 14 |
+
.vscode/
|
| 15 |
+
.idea/
|
| 16 |
+
*.swp
|
| 17 |
+
*.swo
|
| 18 |
+
|
| 19 |
+
# OS
|
| 20 |
+
.DS_Store
|
| 21 |
+
Thumbs.db
|
| 22 |
+
|
| 23 |
+
# Environment variables
|
| 24 |
+
.env
|
| 25 |
+
.env.local
|
| 26 |
+
|
| 27 |
+
# Logs
|
| 28 |
+
*.log
|
| 29 |
+
|
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title: "
|
| 3 |
emoji: "🌴"
|
| 4 |
colorFrom: "green"
|
| 5 |
colorTo: "blue"
|
|
@@ -9,6 +9,6 @@ python_version: "3.10"
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
-
#
|
| 13 |
|
| 14 |
AI-powered assistant for analyzing agricultural documents and data using Streamlit on Hugging Face Spaces.
|
|
|
|
| 1 |
---
|
| 2 |
+
title: "CropDriveTM Assistant"
|
| 3 |
emoji: "🌴"
|
| 4 |
colorFrom: "green"
|
| 5 |
colorTo: "blue"
|
|
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# CropDriveTM Assistant
|
| 13 |
|
| 14 |
AI-powered assistant for analyzing agricultural documents and data using Streamlit on Hugging Face Spaces.
|
app.py
CHANGED
|
@@ -127,7 +127,7 @@ except Exception as e:
|
|
| 127 |
|
| 128 |
# Page configuration
|
| 129 |
st.set_page_config(
|
| 130 |
-
page_title="
|
| 131 |
page_icon="🌴",
|
| 132 |
layout="wide",
|
| 133 |
initial_sidebar_state="expanded"
|
|
@@ -322,7 +322,7 @@ def show_sidebar():
|
|
| 322 |
# Logo and title
|
| 323 |
st.markdown(f"""
|
| 324 |
<div class="sidebar-logo">
|
| 325 |
-
<h2>🌴
|
| 326 |
<p>{t('app_subtitle')}</p>
|
| 327 |
</div>
|
| 328 |
""", unsafe_allow_html=True)
|
|
|
|
| 127 |
|
| 128 |
# Page configuration
|
| 129 |
st.set_page_config(
|
| 130 |
+
page_title="CropDriveTM Assistant",
|
| 131 |
page_icon="🌴",
|
| 132 |
layout="wide",
|
| 133 |
initial_sidebar_state="expanded"
|
|
|
|
| 322 |
# Logo and title
|
| 323 |
st.markdown(f"""
|
| 324 |
<div class="sidebar-logo">
|
| 325 |
+
<h2>🌴 CropDriveTM</h2>
|
| 326 |
<p>{t('app_subtitle')}</p>
|
| 327 |
</div>
|
| 328 |
""", unsafe_allow_html=True)
|
modules/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
# Modules package for
|
|
|
|
| 1 |
+
# Modules package for CropDriveTM Assistant
|
modules/dashboard.py
CHANGED
|
@@ -1763,7 +1763,7 @@ def get_real_time_notifications(user_id: str) -> List[Dict[str, Any]]:
|
|
| 1763 |
notifications = [
|
| 1764 |
{
|
| 1765 |
'id': '1',
|
| 1766 |
-
'title': 'Welcome to
|
| 1767 |
'message': 'Start by uploading your first SP LAB report for analysis.',
|
| 1768 |
'date': datetime.now().strftime('%Y-%m-%d %H:%M'),
|
| 1769 |
'priority': 'high',
|
|
|
|
| 1763 |
notifications = [
|
| 1764 |
{
|
| 1765 |
'id': '1',
|
| 1766 |
+
'title': 'Welcome to CropDriveTM Assistant!',
|
| 1767 |
'message': 'Start by uploading your first SP LAB report for analysis.',
|
| 1768 |
'date': datetime.now().strftime('%Y-%m-%d %H:%M'),
|
| 1769 |
'priority': 'high',
|
modules/upload.py
CHANGED
|
@@ -53,7 +53,7 @@ except ImportError:
|
|
| 53 |
def get_machine_id():
|
| 54 |
"""Generate a persistent machine identifier that persists across sessions"""
|
| 55 |
if 'machine_id' not in st.session_state:
|
| 56 |
-
machine_id_file = os.path.join(os.path.expanduser('~'), '.
|
| 57 |
machine_id = None
|
| 58 |
|
| 59 |
# Try to read existing machine ID from file
|
|
|
|
| 53 |
def get_machine_id():
|
| 54 |
"""Generate a persistent machine identifier that persists across sessions"""
|
| 55 |
if 'machine_id' not in st.session_state:
|
| 56 |
+
machine_id_file = os.path.join(os.path.expanduser('~'), '.cropdrive_machine_id')
|
| 57 |
machine_id = None
|
| 58 |
|
| 59 |
# Try to read existing machine ID from file
|
utils/auth_utils.py
CHANGED
|
@@ -531,9 +531,9 @@ class AuthManager:
|
|
| 531 |
import streamlit as st
|
| 532 |
# Prepare shared content
|
| 533 |
try:
|
| 534 |
-
app_name = st.secrets.get('app', {}).get('name', '
|
| 535 |
except Exception:
|
| 536 |
-
app_name = '
|
| 537 |
subject = f"Reset your password for {app_name}"
|
| 538 |
text_body = f"""
|
| 539 |
Hello,\n\nFollow this link to reset your {app_name} password for your {to_email} account.\n\n{reset_link}\n\nIf you didn’t ask to reset your password, you can ignore this email.\n\nThanks,\n\nYour {app_name} team\n"""
|
|
@@ -713,16 +713,16 @@ Hello,\n\nFollow this link to reset your {app_name} password for your {to_email}
|
|
| 713 |
users_ref = db.collection(COLLECTIONS['users'])
|
| 714 |
|
| 715 |
# Check if default admin exists
|
| 716 |
-
admin_query = users_ref.where(filter=FieldFilter('email', '==', '
|
| 717 |
existing_admin = admin_query.get()
|
| 718 |
|
| 719 |
if not existing_admin:
|
| 720 |
# Create default admin user
|
| 721 |
admin_data = {
|
| 722 |
-
'email': '
|
| 723 |
-
'name': '
|
| 724 |
-
'company': '
|
| 725 |
-
'password_hash': self._hash_password('
|
| 726 |
'role': 'admin',
|
| 727 |
'is_active': True,
|
| 728 |
'created_at': datetime.now(),
|
|
|
|
| 531 |
import streamlit as st
|
| 532 |
# Prepare shared content
|
| 533 |
try:
|
| 534 |
+
app_name = st.secrets.get('app', {}).get('name', 'CropDriveTM Assistant') if hasattr(st, 'secrets') else 'CropDriveTM Assistant'
|
| 535 |
except Exception:
|
| 536 |
+
app_name = 'CropDriveTM Assistant'
|
| 537 |
subject = f"Reset your password for {app_name}"
|
| 538 |
text_body = f"""
|
| 539 |
Hello,\n\nFollow this link to reset your {app_name} password for your {to_email} account.\n\n{reset_link}\n\nIf you didn’t ask to reset your password, you can ignore this email.\n\nThanks,\n\nYour {app_name} team\n"""
|
|
|
|
| 713 |
users_ref = db.collection(COLLECTIONS['users'])
|
| 714 |
|
| 715 |
# Check if default admin exists
|
| 716 |
+
admin_query = users_ref.where(filter=FieldFilter('email', '==', 'admin@cropdrive.ai')).limit(1)
|
| 717 |
existing_admin = admin_query.get()
|
| 718 |
|
| 719 |
if not existing_admin:
|
| 720 |
# Create default admin user
|
| 721 |
admin_data = {
|
| 722 |
+
'email': 'admin@cropdrive.ai',
|
| 723 |
+
'name': 'CropDriveTM Admin',
|
| 724 |
+
'company': 'CropDriveTM',
|
| 725 |
+
'password_hash': self._hash_password('cropdrive123'),
|
| 726 |
'role': 'admin',
|
| 727 |
'is_active': True,
|
| 728 |
'created_at': datetime.now(),
|
utils/parameter_standardizer.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
"""
|
| 2 |
Parameter Standardization Utility
|
| 3 |
Handles consistent naming and mapping of soil and leaf analysis parameters
|
| 4 |
-
across all modules in the
|
| 5 |
"""
|
| 6 |
|
| 7 |
import re
|
|
|
|
| 1 |
"""
|
| 2 |
Parameter Standardization Utility
|
| 3 |
Handles consistent naming and mapping of soil and leaf analysis parameters
|
| 4 |
+
across all modules in the CropDriveTM system.
|
| 5 |
"""
|
| 6 |
|
| 7 |
import re
|
utils/translations.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
"""
|
| 2 |
-
Translation system for
|
| 3 |
Supports English and Bahasa Malaysia (Malaysian)
|
| 4 |
"""
|
| 5 |
|
|
@@ -10,7 +10,7 @@ from typing import Dict, Any
|
|
| 10 |
TRANSLATIONS = {
|
| 11 |
'en': {
|
| 12 |
# Common
|
| 13 |
-
'app_title': '
|
| 14 |
'app_subtitle': 'Advanced Oil Palm Cultivation Analysis System',
|
| 15 |
'language': 'Language',
|
| 16 |
'english': 'English',
|
|
@@ -25,7 +25,7 @@ TRANSLATIONS = {
|
|
| 25 |
'nav_upload': 'Upload',
|
| 26 |
|
| 27 |
# Home Page
|
| 28 |
-
'home_title': 'Welcome to
|
| 29 |
'home_what_title': 'What this tool does:',
|
| 30 |
'home_what_1': 'Reads your soil and leaf test reports',
|
| 31 |
'home_what_2': 'Analyzes the data using AI',
|
|
@@ -296,7 +296,7 @@ TRANSLATIONS = {
|
|
| 296 |
'system_status': 'System Status',
|
| 297 |
|
| 298 |
# Footer
|
| 299 |
-
'footer_copyright': '© 2025
|
| 300 |
|
| 301 |
# PDF Report
|
| 302 |
'pdf_title': 'Agricultural Analysis Report',
|
|
@@ -308,7 +308,7 @@ TRANSLATIONS = {
|
|
| 308 |
'pdf_farm_name': 'Farm Name:',
|
| 309 |
'pdf_oil_palm_plantation': 'Oil Palm Plantation',
|
| 310 |
'pdf_report_generated': 'Report Generated:',
|
| 311 |
-
'pdf_generated_by': 'Generated by
|
| 312 |
'pdf_platform_name': 'Advanced Agricultural Intelligence Platform',
|
| 313 |
'pdf_executive_summary': 'Executive Summary',
|
| 314 |
'pdf_executive_summary_text': 'This report provides a comprehensive analysis of your agricultural data, including soil and leaf nutrient levels, deficiency identification, and actionable recommendations for optimal crop management.',
|
|
@@ -343,7 +343,7 @@ TRANSLATIONS = {
|
|
| 343 |
},
|
| 344 |
'ms': {
|
| 345 |
# Common
|
| 346 |
-
'app_title': 'Pembantu
|
| 347 |
'app_subtitle': 'Sistem Analisis Penanaman Kelapa Sawit Lanjutan',
|
| 348 |
'language': 'Bahasa',
|
| 349 |
'english': 'Bahasa Inggeris',
|
|
@@ -358,7 +358,7 @@ TRANSLATIONS = {
|
|
| 358 |
'nav_upload': 'Muat Naik',
|
| 359 |
|
| 360 |
# Home Page
|
| 361 |
-
'home_title': 'Selamat Datang ke Pembantu
|
| 362 |
'home_what_title': 'Apa yang alat ini lakukan:',
|
| 363 |
'home_what_1': 'Membaca laporan ujian tanah dan daun anda',
|
| 364 |
'home_what_2': 'Menganalisis data menggunakan AI',
|
|
@@ -629,7 +629,7 @@ TRANSLATIONS = {
|
|
| 629 |
'system_status': 'Status Sistem',
|
| 630 |
|
| 631 |
# Footer
|
| 632 |
-
'footer_copyright': '© 2025 Pembantu
|
| 633 |
|
| 634 |
# PDF Report (Malaysian)
|
| 635 |
'pdf_title': 'Laporan Analisis Pertanian',
|
|
@@ -641,7 +641,7 @@ TRANSLATIONS = {
|
|
| 641 |
'pdf_farm_name': 'Nama Ladang:',
|
| 642 |
'pdf_oil_palm_plantation': 'Ladang Kelapa Sawit',
|
| 643 |
'pdf_report_generated': 'Laporan Dijana:',
|
| 644 |
-
'pdf_generated_by': 'Dijana oleh Sistem Analisis
|
| 645 |
'pdf_platform_name': 'Platform Kecerdasan Pertanian Lanjutan',
|
| 646 |
'pdf_executive_summary': 'Ringkasan Eksekutif',
|
| 647 |
'pdf_executive_summary_text': 'Laporan ini menyediakan analisis komprehensif data pertanian anda, termasuk tahap nutrien tanah dan daun, pengenalan kekurangan, dan cadangan yang boleh diambil untuk pengurusan tanaman yang optimum.',
|
|
|
|
| 1 |
"""
|
| 2 |
+
Translation system for CropDriveTM Assistant
|
| 3 |
Supports English and Bahasa Malaysia (Malaysian)
|
| 4 |
"""
|
| 5 |
|
|
|
|
| 10 |
TRANSLATIONS = {
|
| 11 |
'en': {
|
| 12 |
# Common
|
| 13 |
+
'app_title': 'CropDriveTM Assistant',
|
| 14 |
'app_subtitle': 'Advanced Oil Palm Cultivation Analysis System',
|
| 15 |
'language': 'Language',
|
| 16 |
'english': 'English',
|
|
|
|
| 25 |
'nav_upload': 'Upload',
|
| 26 |
|
| 27 |
# Home Page
|
| 28 |
+
'home_title': 'Welcome to CropDriveTM Assistant',
|
| 29 |
'home_what_title': 'What this tool does:',
|
| 30 |
'home_what_1': 'Reads your soil and leaf test reports',
|
| 31 |
'home_what_2': 'Analyzes the data using AI',
|
|
|
|
| 296 |
'system_status': 'System Status',
|
| 297 |
|
| 298 |
# Footer
|
| 299 |
+
'footer_copyright': '© 2025 CropDriveTM Assistant | Advanced Oil Palm Cultivation Analysis System',
|
| 300 |
|
| 301 |
# PDF Report
|
| 302 |
'pdf_title': 'Agricultural Analysis Report',
|
|
|
|
| 308 |
'pdf_farm_name': 'Farm Name:',
|
| 309 |
'pdf_oil_palm_plantation': 'Oil Palm Plantation',
|
| 310 |
'pdf_report_generated': 'Report Generated:',
|
| 311 |
+
'pdf_generated_by': 'Generated by CropDriveTM Analysis System',
|
| 312 |
'pdf_platform_name': 'Advanced Agricultural Intelligence Platform',
|
| 313 |
'pdf_executive_summary': 'Executive Summary',
|
| 314 |
'pdf_executive_summary_text': 'This report provides a comprehensive analysis of your agricultural data, including soil and leaf nutrient levels, deficiency identification, and actionable recommendations for optimal crop management.',
|
|
|
|
| 343 |
},
|
| 344 |
'ms': {
|
| 345 |
# Common
|
| 346 |
+
'app_title': 'Pembantu CropDriveTM',
|
| 347 |
'app_subtitle': 'Sistem Analisis Penanaman Kelapa Sawit Lanjutan',
|
| 348 |
'language': 'Bahasa',
|
| 349 |
'english': 'Bahasa Inggeris',
|
|
|
|
| 358 |
'nav_upload': 'Muat Naik',
|
| 359 |
|
| 360 |
# Home Page
|
| 361 |
+
'home_title': 'Selamat Datang ke Pembantu CropDriveTM',
|
| 362 |
'home_what_title': 'Apa yang alat ini lakukan:',
|
| 363 |
'home_what_1': 'Membaca laporan ujian tanah dan daun anda',
|
| 364 |
'home_what_2': 'Menganalisis data menggunakan AI',
|
|
|
|
| 629 |
'system_status': 'Status Sistem',
|
| 630 |
|
| 631 |
# Footer
|
| 632 |
+
'footer_copyright': '© 2025 Pembantu CropDriveTM | Sistem Analisis Penanaman Kelapa Sawit Lanjutan',
|
| 633 |
|
| 634 |
# PDF Report (Malaysian)
|
| 635 |
'pdf_title': 'Laporan Analisis Pertanian',
|
|
|
|
| 641 |
'pdf_farm_name': 'Nama Ladang:',
|
| 642 |
'pdf_oil_palm_plantation': 'Ladang Kelapa Sawit',
|
| 643 |
'pdf_report_generated': 'Laporan Dijana:',
|
| 644 |
+
'pdf_generated_by': 'Dijana oleh Sistem Analisis CropDriveTM',
|
| 645 |
'pdf_platform_name': 'Platform Kecerdasan Pertanian Lanjutan',
|
| 646 |
'pdf_executive_summary': 'Ringkasan Eksekutif',
|
| 647 |
'pdf_executive_summary_text': 'Laporan ini menyediakan analisis komprehensif data pertanian anda, termasuk tahap nutrien tanah dan daun, pengenalan kekurangan, dan cadangan yang boleh diambil untuk pengurusan tanaman yang optimum.',
|