Skip to content

ThinkLikeAFounder/circlecare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

149 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CircleCare - Next Generation Care Circles on Stacks

A complete rebuild leveraging Clarity 4 features for enhanced security, performance, and user experience

Clarity Version Stacks License

Overview

CircleCare transforms expense sharing from tracking debts into flowing care. Instead of "you owe Alice $50," we recognize that communities operate in circles of mutual careβ€”everyone contributes when they can, everyone receives when they need, and support comes full circle.

This is a ground-up rebuild of CircleCare, architected from the start to leverage Clarity 4's powerful new features including:

  • contract-hash? for contract integrity verification
  • restrict-assets? for enhanced asset protection
  • to-ascii? for improved data serialization
  • stacks-block-time for time-based logic
  • secp256r1-verify for passkey authentication readiness

Why This Rebuild?

The original CircleCare prototype demonstrated the concept. This rebuild takes it to production-ready standards:

Smart Contract Improvements (Clarity 4)

  • Enhanced Security: Leveraging restrict-assets? to prevent unauthorized asset movements
  • Contract Verification: Using contract-hash? to ensure contract integrity
  • Time-Based Features: Implementing stacks-block-time for expiring expenses and automated settlements
  • Better Data Handling: Using to-ascii? for improved serialization and cross-chain readiness
  • Future-Ready Auth: Foundation laid for secp256r1-verify passkey authentication

Frontend Modernization

  • Complete UI Redesign: Fresh color palette while maintaining CircleCare's warm, flowing philosophy
  • Enhanced UX: Improved wallet connection, transaction feedback, and error handling
  • Performance Optimizations: Better state management and data fetching strategies
  • Accessibility: WCAG 2.1 AA compliance from the ground up
  • Mobile-First: Responsive design optimized for all device sizes

Project Structure

circlecare/
β”œβ”€β”€ contracts/                   # Clarity 4 smart contracts
β”‚   β”œβ”€β”€ contracts/
β”‚   β”‚   β”œβ”€β”€ circle-factory.clar     # Circle creation and management
β”‚   β”‚   └── circle-treasury.clar    # Expense and settlement logic
β”‚   β”œβ”€β”€ tests/                      # Comprehensive contract tests
β”‚   └── Clarinet.toml               # Clarity 4 configuration
β”‚
β”œβ”€β”€ frontend/                    # Next.js 15 application
β”‚   β”œβ”€β”€ app/                     # App router pages
β”‚   β”œβ”€β”€ components/              # Reusable UI components
β”‚   β”œβ”€β”€ lib/                     # Contract interactions & utilities
β”‚   └── types/                   # TypeScript definitions
β”‚
└── docs/                        # Documentation
    β”œβ”€β”€ ARCHITECTURE.md          # Technical architecture
    β”œβ”€β”€ CLARITY_4_FEATURES.md    # How we use Clarity 4
    └── DEPLOYMENT.md            # Deployment guide

Tech Stack

Smart Contracts

  • Clarity 4: Latest version with enhanced features
  • Clarinet 2.x: Development and testing framework
  • Vitest: Unit testing with clarinet-sdk

Frontend

  • Next.js 15: React framework with App Router
  • React 19: Latest React features
  • TypeScript 5.x: Type safety throughout
  • Tailwind CSS 4: Modern utility-first CSS
  • Stacks.js: Web3 integration
  • TanStack Query: Data fetching and caching

Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/ThinkLikeAFounder/circlecare.git
    cd circlecare
  2. Install contract dependencies

    cd contracts
    npm install
  3. Install frontend dependencies

    cd ../frontend
    npm install

Development

Smart Contracts

cd contracts
clarinet test              # Run contract tests
clarinet console           # Interactive REPL
clarinet check             # Syntax checking

Frontend

cd frontend
npm run dev                # Start development server
npm run build              # Production build
npm run type-check         # TypeScript validation

Clarity 4 Feature Implementation

1. Contract Integrity Verification (contract-hash?)

We use contract-hash? to verify that interacting contracts match expected implementations, preventing malicious contract substitution.

2. Asset Protection (restrict-assets?)

Settlement operations are wrapped with restrict-assets? to ensure:

  • Users can only transfer amounts they actually owe
  • Contract funds remain protected during external calls
  • Automatic rollback on unauthorized transfers

3. Time-Based Logic (stacks-block-time)

Expenses can now have:

  • Expiration timestamps for automatic resolution
  • Time-locked settlements
  • Scheduled recurring contributions

4. Enhanced Serialization (to-ascii?)

Convert principals, amounts, and other data to ASCII for:

  • Better logging and events
  • Cross-chain message formatting
  • Human-readable receipts

Key Features

For Users

  • Create Care Circles: Organize your community
  • Track Contributions: Transparent expense sharing
  • Settle Debts: Simple STX transfers
  • Time-Based Expenses: Set expiration dates
  • Verified Contracts: Know you're interacting with authentic code

For Developers

  • Clarity 4 Native: Built for the latest Clarity features
  • Comprehensive Tests: Full test coverage
  • Type-Safe: TypeScript throughout the stack
  • Well-Documented: Clear code and documentation
  • Extensible: Easy to build on top of

Testing

Smart Contracts

cd contracts
npm test                   # Run all tests
npm run test:watch         # Watch mode
npm run test:coverage      # Coverage report

Frontend

cd frontend
npm run test              # Unit tests
npm run test:e2e          # End-to-end tests

Deployment

Smart Contracts

See DEPLOYMENT.md for detailed instructions.

cd contracts
clarinet deployments generate --testnet
clarinet deployments apply --testnet

Frontend

Deploy to Vercel, Netlify, or any static hosting:

cd frontend
npm run build

Documentation

Comprehensive documentation is available in the /docs directory:

πŸ“š Complete Documentation

πŸš€ User Resources

πŸ—οΈ Developer Resources

πŸ”§ Technical Resources

Contributing

We welcome contributions! Please see our Contributing Guide for detailed guidelines:

  1. Check existing issues or create a new one
  2. Fork the repository
  3. Create a feature branch
  4. Make your changes with tests
  5. Submit a pull request

For quick contributions:

  • πŸ› Bug Reports: Use GitHub Issues
  • πŸ’‘ Feature Requests: Create detailed GitHub Issues
  • πŸ“ Documentation: Improve our docs
  • πŸ”§ Code: Follow our development guidelines

Roadmap

Phase 1: Foundation (Current)

  • Core Clarity 4 contracts with all new features
  • Modern frontend with improved UX
  • Comprehensive test coverage
  • Documentation

Phase 2: Enhanced Features

  • Recurring contributions
  • Multi-token support (sBTC, other SIP-010 tokens)
  • Passkey authentication using secp256r1-verify
  • Mobile app (React Native)

Phase 3: Advanced

  • Cross-chain bridges
  • DAO governance
  • Analytics dashboard
  • API for third-party integrations

License

MIT License - see LICENSE file for details

Acknowledgments

Support & Community

πŸ“– Documentation & Help

🀝 Community & Support

πŸ› οΈ Developer Resources


CircleCare - Where care comes full circle, powered by Clarity 4 on Stacks

About

Care-centered expense sharing built on Stacks Bitcoin L2. Fair, transparent, and warm.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors