- 🔗 Wallet Integration - Connect with Phantom, Solflare, or Backpack wallets
- 💳 Multi-Token Support - Pay with USDC, SOL, or USDT
- 🔒 Escrow System - Funds are securely held in smart contract escrow
- ⏱️ Automated Payments - Set-and-forget subscription billing
- 📊 Analytics Dashboard - Track spending, subscriptions, and savings
- 🎨 Beautiful UI - Modern dark theme with smooth animations
- Frontend: Next.js 14, React, TypeScript, Tailwind CSS
- Animations: Framer Motion
- Blockchain: Solana, Anchor Framework
- Wallet: @solana/wallet-adapter-react
- State Management: Zustand, React Query
- Forms: React Hook Form, Zod
- Node.js 18+ and pnpm/npm/yarn
- Rust and Cargo (for smart contract development)
- Solana CLI tools
- Anchor CLI
-
Clone the repository
git clone https://github.com/yourusername/chainpe.git cd chainpe -
Install dependencies
npm install # or pnpm install -
Set up environment variables
cp .env.example .env.local # Edit .env.local with your configuration -
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
-
Build the Anchor program
cd programs anchor build -
Deploy to devnet
anchor deploy --provider.cluster devnet
-
Update the program ID
- Copy the program ID from the deployment output
- Update
NEXT_PUBLIC_PROGRAM_IDin.env.local - Update
declare_id!inprograms/chainpe/src/lib.rs - Update
Anchor.tomlwith the new program ID
chainpe/
├── programs/ # Anchor smart contracts
│ └── chainpe/
│ └── src/
│ └── lib.rs # Main program logic
├── src/
│ ├── app/ # Next.js App Router pages
│ │ ├── page.tsx # Landing page
│ │ ├── dashboard/ # User dashboard
│ │ ├── services/ # Browse services
│ │ ├── transactions/ # Transaction history
│ │ ├── analytics/ # Spending analytics
│ │ ├── settings/ # User settings
│ │ └── api/ # API routes
│ ├── components/ # React components
│ │ ├── layout/ # Navbar, Footer
│ │ ├── ui/ # Reusable UI components
│ │ ├── services/ # Service-related components
│ │ └── subscriptions/ # Subscription components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities and constants
│ │ └── anchor/ # Anchor program integration
│ ├── stores/ # Zustand state stores
│ └── types/ # TypeScript types
├── public/ # Static assets
└── tailwind.config.ts # Tailwind configuration
| Color | Hex | Usage |
|---|---|---|
| Background | #0B0F14 |
Main background |
| Surface | #141A22 |
Cards, modals |
| Primary | #14F195 |
Solana green, CTAs |
| Secondary | #8B5CF6 |
Violet accents |
| Success | #22C55E |
Success states |
| Warning | #F59E0B |
Warnings |
| Error | #EF4444 |
Errors |
- Headings: Space Grotesk
- Body: Inter
- Code: JetBrains Mono
The ChainPe program includes the following instructions:
| Instruction | Description |
|---|---|
initialize_subscription |
Create a new subscription with escrow |
execute_billing_cycle |
Process a due payment (cron job) |
cancel_subscription |
Cancel and refund remaining escrow |
fund_escrow |
Add more funds to escrow |
pause_subscription |
Temporarily pause payments |
resume_subscription |
Resume a paused subscription |
pub struct SubscriptionAccount {
pub subscriber: Pubkey,
pub service_provider: Pubkey,
pub service_id: String,
pub payment_amount: u64,
pub billing_interval: i64,
pub next_execution: i64,
pub escrow_balance: u64,
pub total_payments_made: u32,
pub status: SubscriptionStatus,
pub created_at: i64,
pub bump: u8,
}- Connect your GitHub repository to Vercel
- Configure environment variables
- Deploy!
# Switch to mainnet
solana config set --url mainnet-beta
# Deploy
anchor deploy --provider.cluster mainnet| Endpoint | Method | Description |
|---|---|---|
/api/subscriptions |
GET | Get user subscriptions |
/api/subscriptions |
POST | Subscription actions |
/api/cron/billing |
POST | Execute billing cycles |
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ for the Solana ecosystem