Spaces:
Running
Update LLM knowledge base with comprehensive current status
Browse filesMajor Updates to llm.txt:
- Added direct URLs for live application access and all endpoints
- Documented current Supabase database architecture and integration
- Detailed interactive mapping system with beautiful tree pins
- Updated authentication system with multi-role permissions
- Added comprehensive file locations guide for specific functionality
- Included recent major updates (map pins, repository cleanup, modular refactoring)
- Added system status endpoints and monitoring information
- Enhanced usage instructions for LLMs working with the project
- Documented current deployment status and key metrics
- Updated technology stack with Supabase integration
- Added troubleshooting guides and development workflows
The knowledge base now serves as a complete reference for understanding:
- Project architecture and current implementation
- Where to find specific functionality in the codebase
- How to debug issues and add new features
- Current operational status and monitoring
- All direct access URLs and API endpoints
This enables any LLM to quickly understand the project structure,
current status, and how to work with the TreeTrack application.
@@ -1,15 +1,91 @@
|
|
1 |
# TreeTrack - Professional Field Research Platform - LLM Knowledge Base
|
2 |
|
3 |
## PROJECT OVERVIEW
|
4 |
-
TreeTrack is a comprehensive tree mapping and urban forestry management web application with
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
### Key Information:
|
7 |
-
- **Platform**: Hugging Face Spaces (
|
8 |
-
- **
|
9 |
-
- **Technology Stack**: FastAPI + Modular JavaScript (ES6) +
|
10 |
- **Purpose**: Professional field research tool for tree documentation with 12 comprehensive data fields
|
11 |
-
- **Architecture**:
|
12 |
-
- **Version**:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
## DEPLOYMENT ARCHITECTURE
|
15 |
|
@@ -78,8 +154,10 @@ TreeTrackApp
|
|
78 |
|
79 |
### Backend
|
80 |
- **Framework**: FastAPI 0.115.0+
|
81 |
-
- **Server**: Uvicorn with standard extras
|
82 |
-
- **Database**:
|
|
|
|
|
83 |
- **File Handling**: aiofiles for async file operations
|
84 |
- **Validation**: Pydantic 2.10.0+ with custom validators
|
85 |
- **Configuration**: pydantic-settings for environment-based config
|
@@ -394,4 +472,120 @@ curl http://localhost:7860/api/version
|
|
394 |
4. Verify static files are copied correctly
|
395 |
5. Check HF Spaces logs for errors
|
396 |
|
397 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# TreeTrack - Professional Field Research Platform - LLM Knowledge Base
|
2 |
|
3 |
## PROJECT OVERVIEW
|
4 |
+
TreeTrack is a comprehensive tree mapping and urban forestry management web application with Supabase cloud database, modular JavaScript architecture, and beautiful interactive mapping. Deployed on **Hugging Face Spaces** using **Docker**.
|
5 |
+
|
6 |
+
### Current Status & Direct Access
|
7 |
+
- **Live Application**: https://huggingface.co/spaces/RoyAalekh/TreeTrack
|
8 |
+
- **Main Interface**: https://royaalekh-treetrack.hf.space/
|
9 |
+
- **Interactive Map**: https://royaalekh-treetrack.hf.space/map
|
10 |
+
- **API Documentation**: https://royaalekh-treetrack.hf.space/docs
|
11 |
+
- **Health Check**: https://royaalekh-treetrack.hf.space/health
|
12 |
+
- **Login Page**: https://royaalekh-treetrack.hf.space/login
|
13 |
+
- **Repository**: https://huggingface.co/spaces/RoyAalekh/TreeTrack/tree/main
|
14 |
|
15 |
### Key Information:
|
16 |
+
- **Platform**: Hugging Face Spaces (Docker deployment)
|
17 |
+
- **Database**: Supabase PostgreSQL with cloud storage
|
18 |
+
- **Technology Stack**: FastAPI + Supabase + Modular JavaScript (ES6) + Interactive Maps
|
19 |
- **Purpose**: Professional field research tool for tree documentation with 12 comprehensive data fields
|
20 |
+
- **Architecture**: Modular design with 6 specialized JavaScript modules + beautiful tree-shaped map pins
|
21 |
+
- **Version**: 6.0.0 (Latest: Enhanced mapping with Supabase integration)
|
22 |
+
- **Authentication**: Multi-role system (admin, researcher, viewer)
|
23 |
+
|
24 |
+
## CURRENT DATABASE ARCHITECTURE (SUPABASE)
|
25 |
+
|
26 |
+
### Database Provider: Supabase
|
27 |
+
- **Type**: PostgreSQL cloud database
|
28 |
+
- **Storage**: Supabase Storage for file uploads
|
29 |
+
- **Real-time**: Supabase real-time capabilities
|
30 |
+
- **Authentication**: Supabase Auth integration
|
31 |
+
- **URL**: Configured via environment variables
|
32 |
+
|
33 |
+
### Key Database Files
|
34 |
+
- **supabase_client.py**: Supabase client configuration and connection
|
35 |
+
- **supabase_database.py**: Database operations and queries
|
36 |
+
- **supabase_storage.py**: File storage operations
|
37 |
+
- **master_tree_database.py**: Master tree species database with autocomplete
|
38 |
+
- **auth.py**: Authentication logic and user management
|
39 |
+
|
40 |
+
### Database Tables
|
41 |
+
1. **trees**: Main tree records table with all 12 fields
|
42 |
+
2. **users**: User authentication and permissions
|
43 |
+
3. **file_uploads**: Tracking uploaded images/audio files
|
44 |
+
4. **master_species**: Reference database of tree species for autocomplete
|
45 |
+
|
46 |
+
## INTERACTIVE MAPPING SYSTEM
|
47 |
+
|
48 |
+
### Current Map Features
|
49 |
+
- **Technology**: Leaflet.js with custom styling
|
50 |
+
- **Map Interface**: https://royaalekh-treetrack.hf.space/map
|
51 |
+
- **Beautiful Tree Pins**:
|
52 |
+
- Red tree-shaped pins for new locations (temporary)
|
53 |
+
- Green tree-shaped pins for existing trees (permanent)
|
54 |
+
- 3D layered design with drop shadows
|
55 |
+
- Multiple highlight layers for realistic appearance
|
56 |
+
|
57 |
+
### Pin Design Specifications
|
58 |
+
- **Temporary Pins**: 32x40 pixels, red base (#dc2626) with tree icon
|
59 |
+
- **Tree Markers**: 36x44 pixels, green base (#16a34a) with detailed tree design
|
60 |
+
- **User Location**: 24x32 pixels, blue pin (#3b82f6)
|
61 |
+
- **Features**: SVG-based, scalable, professional appearance
|
62 |
+
|
63 |
+
### Map Functionality
|
64 |
+
- **Pin Dropping**: Click anywhere to drop location pin
|
65 |
+
- **Location Transfer**: Selected coordinates auto-fill form
|
66 |
+
- **Tree Popups**: Enhanced modal with proper close button and responsive design
|
67 |
+
- **GPS Location**: Get current user location
|
68 |
+
- **Tree Clustering**: Multiple trees in same area
|
69 |
+
- **Fixed Issues**: Popup overflow, button positioning, close button functionality
|
70 |
+
|
71 |
+
## AUTHENTICATION SYSTEM
|
72 |
+
|
73 |
+
### User Roles & Permissions
|
74 |
+
1. **Admin**: Full access (create, read, update, delete all)
|
75 |
+
2. **System**: Full administrative access
|
76 |
+
3. **Researcher**: Can add and edit own trees, view all
|
77 |
+
4. **Viewer**: Read-only access to tree data
|
78 |
+
|
79 |
+
### Authentication Features
|
80 |
+
- **Multi-role System**: Role-based access control
|
81 |
+
- **Session Management**: Secure token-based sessions
|
82 |
+
- **Login UI**: Professional login interface at /login
|
83 |
+
- **Permission Checking**: Per-operation permission validation
|
84 |
+
|
85 |
+
### Default Authentication (configured in auth.py)
|
86 |
+
- Admin user with full permissions
|
87 |
+
- System user for automated operations
|
88 |
+
- Role-based tree editing and deletion rights
|
89 |
|
90 |
## DEPLOYMENT ARCHITECTURE
|
91 |
|
|
|
154 |
|
155 |
### Backend
|
156 |
- **Framework**: FastAPI 0.115.0+
|
157 |
+
- **Server**: Uvicorn with standard extras
|
158 |
+
- **Database**: Supabase PostgreSQL (cloud-hosted)
|
159 |
+
- **Storage**: Supabase Storage for file uploads
|
160 |
+
- **Authentication**: Supabase Auth integration
|
161 |
- **File Handling**: aiofiles for async file operations
|
162 |
- **Validation**: Pydantic 2.10.0+ with custom validators
|
163 |
- **Configuration**: pydantic-settings for environment-based config
|
|
|
472 |
4. Verify static files are copied correctly
|
473 |
5. Check HF Spaces logs for errors
|
474 |
|
475 |
+
## CURRENT STATUS ENDPOINTS & DATA ACCESS
|
476 |
+
|
477 |
+
### System Status URLs
|
478 |
+
- **Health Check**: https://royaalekh-treetrack.hf.space/health
|
479 |
+
- **API Stats**: https://royaalekh-treetrack.hf.space/api/stats
|
480 |
+
- **Version Info**: https://royaalekh-treetrack.hf.space/api/version
|
481 |
+
- **Tree Data**: https://royaalekh-treetrack.hf.space/api/trees
|
482 |
+
|
483 |
+
### Interactive API Documentation
|
484 |
+
- **Swagger UI**: https://royaalekh-treetrack.hf.space/docs
|
485 |
+
- **ReDoc**: https://royaalekh-treetrack.hf.space/redoc
|
486 |
+
|
487 |
+
## RECENT MAJOR UPDATES (Latest Commits)
|
488 |
+
|
489 |
+
### Repository Cleanup (Latest)
|
490 |
+
- Removed development documentation files
|
491 |
+
- Cleaned up repository structure
|
492 |
+
- Preserved all core functionality
|
493 |
+
- Maintained Supabase integration files
|
494 |
+
|
495 |
+
### Enhanced Map Pins (Recent)
|
496 |
+
- Beautiful tree-shaped SVG pins with 3D design
|
497 |
+
- Fixed popup modal overflow and layout issues
|
498 |
+
- Improved responsive design for mobile
|
499 |
+
- Enhanced close button functionality
|
500 |
+
- Better coordinate transfer from map to form
|
501 |
+
|
502 |
+
### Modular Architecture (Version 5.0.0)
|
503 |
+
- Complete refactoring to 6 specialized modules
|
504 |
+
- Professional emoji-free interface
|
505 |
+
- Improved performance and maintainability
|
506 |
+
- Better error handling and user experience
|
507 |
+
|
508 |
+
## FILE LOCATIONS FOR SPECIFIC FUNCTIONALITY
|
509 |
+
|
510 |
+
### Authentication & Users
|
511 |
+
- **Backend**: `auth.py` (user management and permissions)
|
512 |
+
- **Frontend**: `static/js/modules/auth-manager.js`
|
513 |
+
- **Login Page**: `static/login.html`
|
514 |
+
|
515 |
+
### Database Operations
|
516 |
+
- **Main Database**: `supabase_database.py` (all CRUD operations)
|
517 |
+
- **Supabase Client**: `supabase_client.py` (connection and config)
|
518 |
+
- **Storage**: `supabase_storage.py` (file uploads)
|
519 |
+
- **Species Data**: `master_tree_database.py` (autocomplete)
|
520 |
+
|
521 |
+
### Interactive Mapping
|
522 |
+
- **Map Logic**: `static/map.js` (all mapping functionality)
|
523 |
+
- **Map Interface**: `static/map.html` (map page UI)
|
524 |
+
- **Pin Design**: Look for SVG definitions in map.js
|
525 |
+
- **Popup Modals**: Enhanced popup content in map.js
|
526 |
+
|
527 |
+
### Form Handling
|
528 |
+
- **Main Form**: `static/index.html` (12-field tree form)
|
529 |
+
- **Form Logic**: `static/js/modules/form-manager.js`
|
530 |
+
- **Validation**: Both client-side and server-side in app.py
|
531 |
+
- **Autocomplete**: `static/js/modules/autocomplete-manager.js`
|
532 |
+
|
533 |
+
### File Uploads & Media
|
534 |
+
- **Media Handling**: `static/js/modules/media-manager.js`
|
535 |
+
- **Camera Integration**: Photo capture functionality
|
536 |
+
- **Audio Recording**: Voice memo functionality
|
537 |
+
- **File Processing**: Server-side in app.py upload endpoints
|
538 |
+
|
539 |
+
### User Interface
|
540 |
+
- **UI Updates**: `static/js/modules/ui-manager.js`
|
541 |
+
- **Messages**: Success/error message system
|
542 |
+
- **Tree List**: Dynamic tree list rendering
|
543 |
+
- **Loading States**: Progress indicators and feedback
|
544 |
+
|
545 |
+
## USAGE INSTRUCTIONS FOR LLMs
|
546 |
+
|
547 |
+
### To Understand Project Structure:
|
548 |
+
1. **Main Application Logic**: Review app.py for API endpoints and business logic
|
549 |
+
2. **Frontend Architecture**: Check static/js/modules/ for modular components
|
550 |
+
3. **Database Schema**: Look at Pydantic models in app.py and Supabase operations
|
551 |
+
4. **Authentication Flow**: Review auth.py and auth-manager.js
|
552 |
+
5. **Mapping Features**: Examine map.js for interactive map functionality
|
553 |
+
|
554 |
+
### To Debug Specific Issues:
|
555 |
+
1. **API Problems**: Test endpoints via /docs interface
|
556 |
+
2. **Database Issues**: Check supabase_database.py operations
|
557 |
+
3. **UI Problems**: Review browser console and specific module files
|
558 |
+
4. **Authentication**: Check auth.py user configuration
|
559 |
+
5. **Map Problems**: Look at map.js event handlers and pin creation
|
560 |
+
|
561 |
+
### To Add New Features:
|
562 |
+
1. **Backend**: Extend app.py with new FastAPI routes
|
563 |
+
2. **Database**: Add operations to supabase_database.py
|
564 |
+
3. **Frontend**: Extend appropriate JavaScript module
|
565 |
+
4. **UI Changes**: Modify HTML files in static/
|
566 |
+
5. **New Pages**: Add route in app.py and HTML file in static/
|
567 |
+
|
568 |
+
### To Modify Existing Features:
|
569 |
+
1. **Tree Data Model**: Update Pydantic models in app.py
|
570 |
+
2. **Form Fields**: Modify index.html and form-manager.js
|
571 |
+
3. **Map Functionality**: Update map.js and map.html
|
572 |
+
4. **Authentication**: Modify auth.py and auth-manager.js
|
573 |
+
5. **File Handling**: Update media-manager.js and storage operations
|
574 |
+
|
575 |
+
## DEPLOYMENT STATUS & MONITORING
|
576 |
+
|
577 |
+
### Current Deployment Status
|
578 |
+
- **Status**: LIVE and OPERATIONAL
|
579 |
+
- **Platform**: Hugging Face Spaces Docker
|
580 |
+
- **Build Status**: Automatic deployment from main branch
|
581 |
+
- **Health Monitoring**: Real-time via /health endpoint
|
582 |
+
- **Performance**: Monitored via Supabase dashboard
|
583 |
+
|
584 |
+
### Key Metrics to Monitor
|
585 |
+
- **Response Time**: API endpoint performance
|
586 |
+
- **Database Load**: Supabase connection usage
|
587 |
+
- **Storage Usage**: File upload storage consumption
|
588 |
+
- **User Activity**: Authentication and session metrics
|
589 |
+
- **Error Rates**: Application error frequency
|
590 |
+
|
591 |
+
This comprehensive knowledge base reflects the current state of TreeTrack as of the latest updates and serves as the definitive guide for understanding the project's architecture, implementation, and operational status.
|