Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ yarn-error.log*
.turbo

# Bun
bun.lockb
bun.lockb

# Cursor
.cursor
.clinerules
.roo
2 changes: 2 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ SUPABASE_URL="your supabase url"
SUPABASE_ANON_KEY="your supabase anon key"
JWT_SECRET="your jwt secret"
SUPABASE_SERVICE_ROLE_KEY="your supabase service role key"

USE_MOCK=true
```

# Running the projects
Expand Down
36 changes: 36 additions & 0 deletions apps/backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
PORT=3000
SUPABASE_URL=supabase-url
SUPABASE_ANON_KEY=supabase_anon_key
JWT_SECRET=xyz
SUPABASE_SERVICE_ROLE_KEY=supabase_service_role_key

STELLAR_NETWORK=testnet
TRUSTLESS_WORK_API=https://api.trustlesswork.com

CLOUDINARY_CLOUD_NAME=cloudinary_cloud_name
CLOUDINARY_API_KEY=cloudinary_api_key
CLOUDINARY_API_SECRET=cloudinary_api_secret

# ----------------------------
# Stellar Network Configuration

# Your Stellar account secret key (starts with 'S')
# You can generate this using: stellar keys generate --global your_name --network testnet --fund
STELLAR_SECRET_KEY=SXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# The ID of your deployed Soroban contract
# This is obtained after deploying your contract using: stellar contract deploy ...
SOROBAN_CONTRACT_ID=CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# Soroban RPC endpoint
# Use https://soroban-testnet.stellar.org for testnet
# Use https://soroban-futurenet.stellar.org for futurenet
SOROBAN_RPC_URL=https://soroban-testnet.stellar.org

# Network passphrase (optional)
# Defaults to testnet if not specified
# SOROBAN_NETWORK_PASSPHRASE=Test SDF Network ; September 2015

# Development Mode
# Set to true to use mock implementation instead of real blockchain calls
USE_MOCK=false
19 changes: 19 additions & 0 deletions apps/backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,22 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Finder (MacOS) folder config
.DS_Store

# Added by Task Master AI
# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
dev-debug.log
# Dependency directories
node_modules/
# Environment variables
# Editor directories and files
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# OS specific
63 changes: 63 additions & 0 deletions apps/backend/.roomodes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"customModes": [
{
"slug": "boomerang",
"name": "Boomerang",
"roleDefinition": "You are Roo, a strategic workflow orchestrator who coordinates complex tasks by delegating them to appropriate specialized modes. You have a comprehensive understanding of each mode's capabilities and limitations, also your own, and with the information given by the user and other modes in shared context you are enabled to effectively break down complex problems into discrete tasks that can be solved by different specialists using the `taskmaster-ai` system for task and context management.",
"customInstructions": "Your role is to coordinate complex workflows by delegating tasks to specialized modes, using `taskmaster-ai` as the central hub for task definition, progress tracking, and context management. \nAs an orchestrator, you should:\nn1. When given a complex task, use contextual information (which gets updated frequently) to break it down into logical subtasks that can be delegated to appropriate specialized modes.\nn2. For each subtask, use the `new_task` tool to delegate. Choose the most appropriate mode for the subtask's specific goal and provide comprehensive instructions in the `message` parameter. \nThese instructions must include:\n* All necessary context from the parent task or previous subtasks required to complete the work.\n* A clearly defined scope, specifying exactly what the subtask should accomplish.\n* An explicit statement that the subtask should *only* perform the work outlined in these instructions and not deviate.\n* An instruction for the subtask to signal completion by using the `attempt_completion` tool, providing a thorough summary of the outcome in the `result` parameter, keeping in mind that this summary will be the source of truth used to further relay this information to other tasks and for you to keep track of what was completed on this project.\nn3. Track and manage the progress of all subtasks. When a subtask is completed, acknowledge its results and determine the next steps.\nn4. Help the user understand how the different subtasks fit together in the overall workflow. Provide clear reasoning about why you're delegating specific tasks to specific modes.\nn5. Ask clarifying questions when necessary to better understand how to break down complex tasks effectively. If it seems complex delegate to architect to accomplish that \nn6. Use subtasks to maintain clarity. If a request significantly shifts focus or requires a different expertise (mode), consider creating a subtask rather than overloading the current one.",
"groups": [
"read",
"edit",
"browser",
"command",
"mcp"
]
},
{
"slug": "architect",
"name": "Architect",
"roleDefinition": "You are Roo, an expert technical leader operating in Architect mode. When activated via a delegated task, your focus is solely on analyzing requirements, designing system architecture, planning implementation steps, and performing technical analysis as specified in the task message. You utilize analysis tools as needed and report your findings and designs back using `attempt_completion`. You do not deviate from the delegated task scope.",
"customInstructions": "1. Do some information gathering (for example using read_file or search_files) to get more context about the task.\n\n2. You should also ask the user clarifying questions to get a better understanding of the task.\n\n3. Once you've gained more context about the user's request, you should create a detailed plan for how to accomplish the task. Include Mermaid diagrams if they help make your plan clearer.\n\n4. Ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and plan the best way to accomplish it.\n\n5. Once the user confirms the plan, ask them if they'd like you to write it to a markdown file.\n\n6. Use the switch_mode tool to request that the user switch to another mode to implement the solution.",
"groups": [
"read",
["edit", { "fileRegex": "\\.md$", "description": "Markdown files only" }],
"command",
"mcp"
]
},
{
"slug": "ask",
"name": "Ask",
"roleDefinition": "You are Roo, a knowledgeable technical assistant.\nWhen activated by another mode via a delegated task, your focus is to research, analyze, and provide clear, concise answers or explanations based *only* on the specific information requested in the delegation message. Use available tools for information gathering and report your findings back using `attempt_completion`.",
"customInstructions": "You can analyze code, explain concepts, and access external resources. Make sure to answer the user's questions and don't rush to switch to implementing code. Include Mermaid diagrams if they help make your response clearer.",
"groups": [
"read",
"browser",
"mcp"
]
},
{
"slug": "debug",
"name": "Debug",
"roleDefinition": "You are Roo, an expert software debugger specializing in systematic problem diagnosis and resolution. When activated by another mode, your task is to meticulously analyze the provided debugging request (potentially referencing Taskmaster tasks, logs, or metrics), use diagnostic tools as instructed to investigate the issue, identify the root cause, and report your findings and recommended next steps back via `attempt_completion`. You focus solely on diagnostics within the scope defined by the delegated task.",
"customInstructions": "Reflect on 5-7 different possible sources of the problem, distill those down to 1-2 most likely sources, and then add logs to validate your assumptions. Explicitly ask the user to confirm the diagnosis before fixing the problem.",
"groups": [
"read",
"edit",
"command",
"mcp"
]
},
{
"slug": "test",
"name": "Test",
"roleDefinition": "You are Roo, an expert software tester. Your primary focus is executing testing tasks delegated to you by other modes.\nAnalyze the provided scope and context (often referencing a Taskmaster task ID and its `testStrategy`), develop test plans if needed, execute tests diligently, and report comprehensive results (pass/fail, bugs, coverage) back using `attempt_completion`. You operate strictly within the delegated task's boundaries.",
"customInstructions": "Focus on the `testStrategy` defined in the Taskmaster task. Develop and execute test plans accordingly. Report results clearly, including pass/fail status, bug details, and coverage information.",
"groups": [
"read",
"command",
"mcp"
]
}
]
}
34 changes: 34 additions & 0 deletions apps/backend/.taskmaster/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"models": {
"main": {
"provider": "anthropic",
"modelId": "claude-3-7-sonnet-20250219",
"maxTokens": 120000,
"temperature": 0.2
},
"research": {
"provider": "perplexity",
"modelId": "sonar-pro",
"maxTokens": 8700,
"temperature": 0.1
},
"fallback": {
"provider": "anthropic",
"modelId": "claude-3-5-sonnet-20240620",
"maxTokens": 8192,
"temperature": 0.1
}
},
"global": {
"logLevel": "info",
"debug": false,
"defaultSubtasks": 5,
"defaultPriority": "medium",
"projectName": "Taskmaster",
"ollamaBaseURL": "http://localhost:11434/api",
"bedrockBaseURL": "https://bedrock.us-east-1.amazonaws.com",
"defaultTag": "master",
"azureOpenaiBaseURL": "https://your-endpoint.openai.azure.com/",
"userId": "1234567890"
}
}
Comment on lines +1 to +34
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix JSON formatting to satisfy Prettier
CI is failing on a Prettier check for this file. Please run prettier --write apps/backend/.taskmaster/config.json (or your project’s format script) to resolve style issues.

🧰 Tools
πŸͺ› GitHub Actions: CI

[error] 1-35: Prettier formatting check failed. Run 'prettier --write' to fix code style issues.

πŸ€– Prompt for AI Agents
In apps/backend/.taskmaster/config.json lines 1 to 34, the JSON formatting does
not comply with Prettier style rules, causing CI failures. Run the Prettier
formatter on this file using the command `prettier --write
apps/backend/.taskmaster/config.json` or your project's formatting script to
automatically fix indentation, spacing, and other style issues.

6 changes: 6 additions & 0 deletions apps/backend/.taskmaster/state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"currentTag": "master",
"lastSwitched": "2025-06-16T03:38:45.075Z",
"branchTagMapping": {},
"migrationNoticeShown": false
}
Comment on lines +1 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix Prettier formatting issues.

The pipeline indicates Prettier formatting errors. Please run prettier --write to resolve the formatting issues.

#!/bin/bash
# Fix formatting issues
cd apps/backend/.taskmaster
prettier --write state.json
🧰 Tools
πŸͺ› GitHub Actions: CI

[error] 1-7: Prettier formatting check failed. Run 'prettier --write' to fix code style issues.

πŸ€– Prompt for AI Agents
In apps/backend/.taskmaster/state.json lines 1 to 6, the file has Prettier
formatting issues. Run the Prettier formatter on this file by executing
`prettier --write state.json` inside the apps/backend/.taskmaster directory to
fix the formatting errors automatically.

151 changes: 151 additions & 0 deletions apps/backend/.taskmaster/templates/PRD.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Project Requirements Document (PRD) - StellarRent

This document outlines the requirements for StellarRent, a decentralized P2P rental platform built on the Stellar blockchain. It is designed to guide the development of a functional MVP that validates the value proposition of renting properties with cryptocurrencies (USDC) instantly and reliably.

---

## Overview

StellarRent is a decentralized peer-to-peer rental platform that addresses the issues of traditional platforms like Airbnb, such as high commissions (10-20%), slow payments, and lack of transparency. Leveraging the Stellar blockchain, StellarRent enables:
- Instant payments in 5 seconds with USDC.
- Ultra-low commissions (~0.00001 USD per transaction).
- Enhanced trust through immutable reviews and smart contracts.

It targets global travelers and digital nomads seeking fast, affordable, and reliable rental options, as well as hosts looking to reduce costs and receive payments more quickly. Its value lies in eliminating intermediaries, reducing friction, and offering a crypto-friendly alternative to the rental market.

---

## Core Features

### 1. Property Listing
- **What it does**: Allows hosts to create property listings with title, description, price, location, amenities, and images.
- **Why it's important**: Forms the foundation for guests to find and book properties.
- **How it works at a high level**: Hosts complete a form in the interface; data is stored in a database, and a hash is recorded on the blockchain to ensure integrity.

### 2. Property Search and Booking
- **What it does**: Enables guests to search properties with filters (location, dates, guests) and book them.
- **Why it's important**: Facilitates the primary interaction between guests and hosts.
- **How it works at a high level**: Guests query available properties through the backend and confirm bookings, managed by smart contracts.

### 3. Instant Payments with USDC
- **What it does**: Allows guests to pay for bookings instantly using USDC via Stellar wallets.
- **Why it's important**: It is the core of the value proposition: fast and low-cost payments.
- **How it works at a high level**: Guests connect a wallet (e.g., Freighter), sign the transaction, and the payment is processed on the Stellar network with temporary custody.

### 4. User Profiles and Authentication
- **What it does**: Manages registration, login, and profile updates, including wallet integration.
- **Why it's important**: Ensures secure access and user identity verification.
- **How it works at a high level**: Registration/login with email/password or Stellar wallet; data is securely stored and sessions are managed with tokens.

### 5. Reservation Management
- **What it does**: Allows users to view and manage their reservations (guests) or requests (hosts).
- **Why it's important**: Provides transparency and control over transactions.
- **How it works at a high level**: Users access their reservations through the interface, with data synchronized between the database and the blockchain.

---

## User Experience

### User Personas
- **Global Travelers**: Tech-savvy individuals seeking quick and affordable rentals.
- **Digital Nomads**: Remote workers needing flexible rentals and instant payments.
- **Hosts**: Property owners wanting lower commissions and faster payments.

### Key User Flows
- **Guest Flow**: Search properties β†’ View details β†’ Book and pay with USDC β†’ Manage reservation.
- **Host Flow**: List property β†’ Manage availability β†’ Confirm bookings β†’ Receive payments.

### UI/UX Considerations
- **Web2 Experience**: Intuitive interface that hides blockchain complexity for non-crypto users.
- **Wallet Integration**: Simplified connection with clear instructions (e.g., "Connect wallet to pay").
- **Performance**: Fast load times and immediate feedback on actions like booking confirmations.

---

## Technical Architecture

### System Components
- **Frontend**: Next.js with TailwindCSS for the interface, integrated with Stellar SDK for wallet interactions.
- **Backend**: Bun with Express.js for API routing, Supabase for database and authentication.
- **Blockchain**: Stellar for payments, Soroban for smart contracts (e.g., listings and bookings).
- **Storage**: Supabase Storage for images and avatars.
- **Monitoring**: Health checks and structured logs.

### Data Models
- **Tables in Supabase**:
- `users`: id, email, name, password_hash, created_at, updated_at.
- `profiles`: user_id, name, avatar_url, phone, address, preferences.
- `properties`: id, title, description, price, address, city, amenities, images, owner_id, status.
- `bookings`: id, property_id, user_id, dates, guests, total, status, created_at.
- **Smart Contracts in Soroban**:
- `PropertyListing`: id, data_hash, owner, status.
- `BookingContract`: id, property_id, user_id, start_date, end_date, total_price, status.

### APIs and Integrations
- **RESTful API**: Endpoints for authentication, profiles, properties, and bookings.
- **Stellar SDK**: For wallet interactions and USDC payments.
- **Freighter**: Wallet integration for transaction signing.
- **Supabase**: Database, authentication, and file storage.

### Infrastructure Requirements
- **Containerization**: Docker for consistent environments.
- **Rate Limiting**: Prevent API abuse.
- **Monitoring**: Health checks every 30 seconds with automatic restart on failure.

---

## Development Roadmap

### Phase 1: MVP Requirements
- Authentication with email/password and wallet connection.
- Property listing (up to 10 images).
- Basic property search and filtering.
- Reservation system with USDC payment flow.
- Basic profile management with avatar upload.

### Phase 2: Future Enhancements
- Advanced filters (date availability, amenities).
- Blockchain-stored reviews.
- Real-time notifications (WebSockets).
- Full KYC integration.
- Introduction of a native token (STLRNT) for discounts.

---

## Logical Dependency Chain

1. **Foundation**:
- Set up authentication (email/password).
- Implement property listing and search.
2. **Core Functionality**:
- Develop reservation system with basic payments.
- Integrate wallet for USDC payments.
3. **Improvements**:
- Add payment custody.
- Implement profile management.
4. **Polishing**:
- Optimize performance and add pagination.

---

## Risks and Mitigations

- **Technical Challenges**:
- **Blockchain Integration**: Use Stellar documentation and community support.
- **Security**: Implement access policies and encryption; plan audits.
- **MVP Scope**:
- Prioritize essential features (listings, bookings, payments); defer non-critical ones.
- **Resource Constraints**:
- Follow dependency chain; consider outsourcing secondary tasks.

---

## Appendix

- **Research Findings**:
- Stellar’s low commissions and speed are ideal for rentals.
- Non-crypto users need a simplified UX.
- **Technical Specifications**:
- Database with security policies.
- Smart contracts for decentralized logic.
- File storage with public access for images.
47 changes: 47 additions & 0 deletions apps/backend/.taskmaster/templates/example_prd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<context>
# Overview
[Provide a high-level overview of your product here. Explain what problem it solves, who it's for, and why it's valuable.]

# Core Features
[List and describe the main features of your product. For each feature, include:
- What it does
- Why it's important
- How it works at a high level]

# User Experience
[Describe the user journey and experience. Include:
- User personas
- Key user flows
- UI/UX considerations]
</context>
<PRD>
# Technical Architecture
[Outline the technical implementation details:
- System components
- Data models
- APIs and integrations
- Infrastructure requirements]

# Development Roadmap
[Break down the development process into phases:
- MVP requirements
- Future enhancements
- Do not think about timelines whatsoever -- all that matters is scope and detailing exactly what needs to be build in each phase so it can later be cut up into tasks]

# Logical Dependency Chain
[Define the logical order of development:
- Which features need to be built first (foundation)
- Getting as quickly as possible to something usable/visible front end that works
- Properly pacing and scoping each feature so it is atomic but can also be built upon and improved as development approaches]

# Risks and Mitigations
[Identify potential risks and how they'll be addressed:
- Technical challenges
- Figuring out the MVP that we can build upon
- Resource constraints]

# Appendix
[Include any additional information:
- Research findings
- Technical specifications]
</PRD>
Loading
Loading