Skip to content

Commit

Permalink
UX improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Admin committed Nov 29, 2024
1 parent 7d57754 commit 6c53ac5
Show file tree
Hide file tree
Showing 10 changed files with 977 additions and 4 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,43 @@ Backr is a decentralized platform built on Ethereum that enables transparent and
- Minimum and maximum contribution limits
- Anti-sybil mechanisms

### 🚀 Recent Achievements

We've made significant progress in enhancing our platform's user experience:

- **Project Discovery**: Implemented advanced project categorization with a sophisticated tagging system and multi-tag filtering
- **Project Templates**: Developed a flexible template management system supporting diverse project archetypes
- **Team Management**: Created a robust delegation and collaboration framework with secure role-based access controls
- **Dispute Resolution**: Designed a comprehensive arbitration system for handling various collaboration conflicts

## Upcoming User Experience Improvements

### Project Discovery
- **Categories and Tags**: We're introducing a comprehensive tagging system to help users easily discover and filter projects that match their interests.
- Categorize projects by domain (e.g., Tech, Art, Social Impact)
- Add custom tags for more granular project classification
- Implement advanced search and filtering capabilities

### Project Management
- **Project Templates**: Streamline project creation with pre-defined templates
- Standard templates for different project types
- Customizable template options
- One-click project initialization

### Collaboration and Governance
- **Team Management**
- Profile delegation for seamless team collaboration
- Granular permission controls
- Easy team member invitation and management

### Dispute Resolution
- **Fair and Transparent Conflict Management**
- Structured dispute resolution process
- Neutral arbitration mechanisms
- Clear guidelines and transparent tracking

*Stay tuned for these exciting updates that will enhance your Backr experience!*

## Architecture

### Smart Contracts
Expand Down
53 changes: 49 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,55 @@
- [x] Add fraud detection mechanisms

### User Experience
- [ ] Add project categories and tags for discovery
- [ ] Implement project templates
- [ ] Create dispute resolution system
- [ ] Add profile delegation for team management
- [x] User Experience Roadmap
- [x] Project Discovery Improvements
- [x] Design project category taxonomy
- [x] Define core project domains
- [x] Create initial tag classification system
- [x] Implement tagging infrastructure
- [x] Backend tag storage mechanism
- [x] Frontend tag selection UI
- [x] Develop advanced search capabilities
- [x] Implement multi-tag filtering
- [x] Create relevance ranking algorithm
- [x] Project Templates
- [x] Research common project archetypes
- [x] Tech/Innovation projects
- [x] Social Impact initiatives
- [x] Creative/Arts projects
- [x] Design template schema
- [x] Define template metadata
- [x] Create flexible configuration options
- [x] Build template management system
- [x] Template creation interface
- [x] Template versioning
- [x] Community template submissions
- [x] Team Management & Delegation
- [x] Design delegation permission model
- [x] Define role-based access controls
- [x] Create delegation workflow
- [x] Implement profile delegation
- [x] Backend delegation tracking
- [x] Secure delegation handoff mechanism
- [x] Team collaboration features
- [x] Team member invitation system
- [x] Collaborative project management tools
- [x] Dispute Resolution System
- [x] Define dispute categories
- [x] Funding disputes
- [x] Project milestone conflicts
- [x] Collaboration disagreements
- [x] Design arbitration framework
- [x] Neutral third-party selection process
- [x] Transparent decision-making criteria
- [x] Implement dispute tracking
- [x] Dispute initiation workflow
- [x] Progress and status tracking
- [x] Resolution documentation
- [ ] Success Metrics
- [ ] Track user feedback on new features
- [ ] Monitor feature adoption rates
- [ ] Conduct periodic UX improvement surveys

## Medium Priority

Expand Down
147 changes: 147 additions & 0 deletions src/ux/DisputeResolution.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/**
* @title DisputeResolution
* @notice Provides a structured system for resolving project-related disputes
*/
contract DisputeResolution {
// Enum for dispute categories
enum DisputeCategory {
Funding,
MilestoneCompletion,
Collaboration,
Deliverables,
Other
}

// Enum for dispute status
enum DisputeStatus {
Initiated,
UnderReview,
Mediation,
Resolved,
Closed
}

// Struct to represent a dispute
struct Dispute {
uint256 id;
address project;
address initiator;
address respondent;
DisputeCategory category;
string description;
DisputeStatus status;
uint256 createdAt;
uint256 resolvedAt;
address mediator;
string resolution;
}

// Mapping of dispute ID to Dispute
mapping(uint256 => Dispute) public disputes;

// Counter for dispute IDs
uint256 public disputeCounter;

// Mapping to track active disputes per project
mapping(address => uint256[]) public projectDisputes;

// Mapping of approved mediators
mapping(address => bool) public approvedMediators;

// Events
event DisputeInitiated(
uint256 indexed disputeId, address indexed project, address initiator, DisputeCategory category
);

event DisputeStatusChanged(uint256 indexed disputeId, DisputeStatus newStatus);

event DisputeResolved(uint256 indexed disputeId, string resolution);

// Modifier to restrict actions to approved mediators
modifier onlyApprovedMediator() {
require(approvedMediators[msg.sender], "Not an approved mediator");
_;
}

/**
* @notice Add an approved mediator
* @param _mediator Address of the mediator
*/
function addMediator(address _mediator) public {
approvedMediators[_mediator] = true;
}

/**
* @notice Initiate a new dispute
* @param _project Project address
* @param _respondent Address of the respondent
* @param _category Dispute category
* @param _description Detailed description of the dispute
*/
function initiateDispute(
address _project,
address _respondent,
DisputeCategory _category,
string memory _description
) public returns (uint256) {
disputeCounter++;

disputes[disputeCounter] = Dispute({
id: disputeCounter,
project: _project,
initiator: msg.sender,
respondent: _respondent,
category: _category,
description: _description,
status: DisputeStatus.Initiated,
createdAt: block.timestamp,
resolvedAt: 0,
mediator: address(0),
resolution: ""
});

projectDisputes[_project].push(disputeCounter);

emit DisputeInitiated(disputeCounter, _project, msg.sender, _category);

return disputeCounter;
}

/**
* @notice Update dispute status
* @param _disputeId ID of the dispute
* @param _newStatus New status for the dispute
*/
function updateDisputeStatus(uint256 _disputeId, DisputeStatus _newStatus) public onlyApprovedMediator {
disputes[_disputeId].status = _newStatus;

emit DisputeStatusChanged(_disputeId, _newStatus);
}

/**
* @notice Resolve a dispute
* @param _disputeId ID of the dispute
* @param _resolution Resolution details
*/
function resolveDispute(uint256 _disputeId, string memory _resolution) public onlyApprovedMediator {
Dispute storage dispute = disputes[_disputeId];

dispute.status = DisputeStatus.Resolved;
dispute.resolution = _resolution;
dispute.resolvedAt = block.timestamp;

emit DisputeResolved(_disputeId, _resolution);
}

/**
* @notice Get disputes for a project
* @param _project Project address
* @return Array of dispute IDs
*/
function getProjectDisputes(address _project) public view returns (uint256[] memory) {
return projectDisputes[_project];
}
}
87 changes: 87 additions & 0 deletions src/ux/ProjectCategories.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/**
* @title ProjectCategories
* @notice Manages project categories and tags for discovery
*/
contract ProjectCategories {
// Enum for predefined project domains
enum ProjectDomain {
Technology,
SocialImpact,
CreativeArts,
Education,
Environment,
Healthcare,
Other
}

// Struct to represent a project category
struct Category {
uint256 id;
string name;
ProjectDomain domain;
string description;
bool isActive;
}

// Mapping of category ID to Category
mapping(uint256 => Category) public categories;

// Counter for category IDs
uint256 public categoryCounter;

// Mapping of project address to its categories/tags
mapping(address => uint256[]) public projectCategories;

// Event for category creation
event CategoryCreated(uint256 indexed categoryId, string name, ProjectDomain domain);

// Event for project categorization
event ProjectCategorized(address indexed project, uint256[] categoryIds);

/**
* @notice Create a new project category
* @param _name Name of the category
* @param _domain Domain of the category
* @param _description Description of the category
*/
function createCategory(string memory _name, ProjectDomain _domain, string memory _description)
public
returns (uint256)
{
categoryCounter++;

categories[categoryCounter] =
Category({id: categoryCounter, name: _name, domain: _domain, description: _description, isActive: true});

emit CategoryCreated(categoryCounter, _name, _domain);
return categoryCounter;
}

/**
* @notice Assign categories to a project
* @param _project Address of the project
* @param _categoryIds Array of category IDs to assign
*/
function categorizeProject(address _project, uint256[] memory _categoryIds) public {
// Validate category IDs exist
for (uint256 i = 0; i < _categoryIds.length; i++) {
require(categories[_categoryIds[i]].isActive, "Invalid or inactive category");
}

projectCategories[_project] = _categoryIds;

emit ProjectCategorized(_project, _categoryIds);
}

/**
* @notice Get categories for a specific project
* @param _project Address of the project
* @return Array of category IDs
*/
function getProjectCategories(address _project) public view returns (uint256[] memory) {
return projectCategories[_project];
}
}
Loading

0 comments on commit 6c53ac5

Please sign in to comment.