Repository Structure:
- Move files from cluttered root directory into organized structure
- Create archive/ for archived data and scraper results
- Create bugulma/ for the complete application (frontend + backend)
- Create data/ for sample datasets and reference materials
- Create docs/ for comprehensive documentation structure
- Create scripts/ for utility scripts and API tools
Backend Implementation:
- Implement 3 missing backend endpoints identified in gap analysis:
* GET /api/v1/organizations/{id}/matching/direct - Direct symbiosis matches
* GET /api/v1/users/me/organizations - User organizations
* POST /api/v1/proposals/{id}/status - Update proposal status
- Add complete proposal domain model, repository, and service layers
- Create database migration for proposals table
- Fix CLI server command registration issue
API Documentation:
- Add comprehensive proposals.md API documentation
- Update README.md with Users and Proposals API sections
- Document all request/response formats, error codes, and business rules
Code Quality:
- Follow existing Go backend architecture patterns
- Add proper error handling and validation
- Match frontend expected response schemas
- Maintain clean separation of concerns (handler -> service -> repository)
3.5 KiB
5. Entity Relationships
The platform uses a three-tier entity model to accurately represent real-world industrial ecosystems:
Business Entity
Represents the legal/commercial entity - the company that SMEs identify with. Contains business capabilities, certifications, strategic profile, and relationships.
Site Entity
Represents physical locations/buildings where business activities occur. A business can operate at multiple sites (multi-site operations, industrial parks). Sites have their own infrastructure, utilities, and environmental characteristics.
Resource Flows
Attached to specific sites where they physically occur, owned by businesses. This allows:
- Multi-site businesses with different resource profiles per location
- Shared assets located at specific sites
- Accurate geographical matching and logistics planning
Relationship: Business owns/operates Sites, Sites host ResourceFlows and SharedAssets.
Multi-Modal Matching
The same engine now matches across 4 dimensions:
- Resource flows (original): Physics-based surplus-to-demand
- Service complementarity: "I service compressors, you have 30 compressors"
- Product supply chains: "I need packaging, you produce it 2km away"
- Compliance networks: "We both need oil separator cleaning → group buy"
UX Features for Felt Value
"Nearby Buyers & Suppliers"
Every resource card shows:
- Resource matches (existing functionality)
- Relevant suppliers (products for this process)
- Service providers (equipment maintenance)
"Shared OPEX Deals"
Cluster by recurring costs and offer group discounts:
- "3 of you can save 12% on waste pickup"
- "5 companies can get PPE bulk pricing"
"Opportunities Feed"
Timeline of local business opportunities:
- "Bakery A needs cold storage 5-10 m³ nearby"
- "Packaging C wants new suppliers within 10 km"
- "Pool B can take 20 kW low-temp heat"
Service-as-a-Resource
Formalize services as first-class resources:
For complete ResourceFlow schema, see schemas/resource_flow.json
Now match: "Plant emits 'faulty pumps' → 3 local companies output 'pump maintenance within 25km'"
Layered Architecture
Layer 1 (Core): Strict, typed, physics/economics-checked flows
Layer 2 (Business): Fuzzy, texty, lower-trust, human-verified
Matching priority:
- Try hard match (physics)
- If <N results, add soft match (business/services)
- Surface both but label differently
This keeps the platform serious for utilities while being sticky for SMEs.
Match State Management & Conflict Resolution
Edge State Machine (prevents double-booking of matches):
suggested: Match discovered by algorithmnegotiating: Both parties contacted, initial discussionsreserved: Match committed to (exclusive for N days)contracted: Legal agreement signedlive: Implementation in progressfailed: Match abandoned
Conflict Resolution: When multiple buyers want same resource:
- Priority: Contracted > Reserved > Negotiating > Suggested
- Time-based: First to reserve gets priority
- Economic: Higher value matches override lower ones
Execution Support Entities
Match Packet (partner-ready deliverables):
For complete MatchPacket schema, see schemas/match_packet.json
Facilitator Marketplace (external engineers as paid intermediaries):
For complete Facilitator schema, see schemas/facilitator.json