The OrganisationAnalytics.jsx page now fetches and displays comprehensive organization data from the server:
- ✅
id- Organization ID - ✅
name- Organization name - ✅
description- Organization description - ✅
startDate- Campaign start date - ✅
endDate- Campaign end date - ✅
owner- Owner wallet address - ✅
isActive- Active status - ✅
forests- Array of forest IDs linked to organization - ✅
createdAt- Creation timestamp - ✅
updatedAt- Last update timestamp
- ✅
userAddress- Member wallet address - ✅
role- Member role (owner/user/investor) - ✅
joinedAt- Join date - ✅
displayName- User display name - ✅
forestsRegistered- Number of forests registered by member - ✅
verifiedArea- Total verified area in hectares - ✅
totalCarbonCredits- Total carbon credits earned
-
Organization Forests Display
- Fetches all forests linked to the organization
- Shows forest ID, area, carbon credits, NDVI, and status
- Grid layout with MagicCard components
-
Member Statistics
- Displays all organization members with their stats
- Shows forests registered, verified area, and carbon credits per member
- Filters investors separately
-
Timeline Information
- Start and end dates displayed
- Organization status (Active/Inactive)
- Clean card-based layout
-
Comprehensive KPIs
- Total members count
- Total forests (organization + member forests)
- Total verified area (aggregated from members)
- Total carbon credits (aggregated from members)
- Tokens raised (placeholder for future implementation)
-
User-Specific Data (if member)
- Shows user's own plots/forests
- Only visible to organization members
- Separate section from organization forests
OrganisationAnalytics Component
↓
fetchOrganisationById(orgId, account)
↓
Server: getOrganisationById handler
↓
Returns:
- organisation: {id, name, description, startDate, endDate, owner, isActive, forests[]}
- members: [{userAddress, role, joinedAt, displayName, forestsRegistered, verifiedArea, totalCarbonCredits}]
- isMember: boolean
↓
Component fetches organization forests using forest IDs
↓
Displays comprehensive analytics
- Header - Organization name, ID, member count
- Timeline Cards - Start date, end date, status
- Description - Organization about section
- Performance & Metrics - KPI grid with aggregated stats
- Organization Forests - All forests linked to organization
- Members - All organization members with stats
- Your Plots - User's forests (if member)
- Investors - Filtered investor members
GET /api/organisations/:id- Fetch organization detailsGET /api/forests/:id- Fetch individual forest dataGET /api/forests/getForests- Fetch user's forests (if member)GET /api/registration-sessions/active/:orgId- Check active session
-
Tokens Raised Tracking
- Add
tokensRaisedfield to OrganisationModel - Track investments via smart contract events
- Update on each investment transaction
- Add
-
Investment History
- Create InvestmentModel to track all investments
- Show investment timeline
- Display top investors
-
Forest Performance Charts
- NDVI trends over time
- Carbon credit accumulation graph
- Area growth visualization
-
Member Activity Feed
- Recent member actions
- Forest registrations timeline
- Voting history
✅ Fully Integrated - All available data from the server is now displayed in the analytics page ✅ Responsive - Works on all screen sizes ✅ Real-time - Fetches latest data on page load ✅ Member-aware - Shows different data based on membership status