-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programenhancementNew feature or requestNew feature or requestneeds-triage
Description
🔍 Problem Statement
📖 Description
Design a robust PostgreSQL schema to support core entities of the freelance platform. The schema should cover users, projects, milestones, contracts, and disputes, with indexing strategies for efficient queries.
Expected Behavior
- Users: Store freelancer and client profiles with wallet addresses, authentication details, and role distinctions.
- Projects: Represent client-created projects with metadata (title, description, budget, deadlines).
- Milestones: Track project milestones with title, description, amount, due date, and status.
- Contracts: Link freelancers to projects, including terms, escrow details, and status.
- Disputes: Record disputes raised by clients or freelancers, with reason, evidence, and resolution status.
🛠 Technical Notes
-
Schema Design:
- Normalize tables to avoid redundancy.
- Use foreign keys to enforce relationships (e.g., milestones → projects, contracts → users/projects).
- Include timestamps (
created_at,updated_at) for auditing.
-
Indexing Strategy:
- Index wallet addresses for fast authentication lookups.
- Index project IDs and milestone IDs for efficient joins.
- Consider composite indexes for queries involving user + project or project + milestone.
- Use partial indexes for filtering active vs. completed contracts.
-
Scalability Considerations:
- Support pagination for large contract/milestone histories.
- Optimize queries for dashboard views (freelancer and client).
- Ensure schema supports future extensions (e.g., ratings, reviews, notifications).
✅ Acceptance Criteria
- Schema includes tables for users, projects, milestones, contracts, and disputes.
- Relationships are correctly defined with foreign keys.
- Indexes are applied to critical query paths (wallet, project, milestone, contract).
- Schema passes migration tests and integrates with backend APIs.
npm run lintandnpm run buildsucceed.- No regression in authentication, wallet connection, or dashboard features.
📈 Expected Impact
High — Would significantly improve user experience
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programenhancementNew feature or requestNew feature or requestneeds-triage