Fast & Secure DeFi Lending on Stellar
Stellarlend is a decentralized finance (DeFi) lending platform built on the Stellar blockchain. It enables users to borrow and lend digital assets with ultra-low fees, instant settlements, and full transparencyβpowered by Soroban smart contracts. The platform is designed for both crypto-native users and those new to DeFi, offering an intuitive interface for managing lending and borrowing operations on one of the most efficient blockchain networks.
This frontend application provides a modern, responsive web interface for interacting with the Stellarlend protocol, featuring real-time transaction tracking, interest rate calculations, and comprehensive dashboard analytics.
- Lending & Borrowing: Earn interest by lending assets or borrow against collateral
- Multi-Asset Support: Support for XLM, USDC, BTC, ETH, and other Stellar-based assets
- Real-Time Calculations: Dynamic interest rate and payment calculations
- Transaction Management: Track all lending, borrowing, and payment transactions
- Dashboard Analytics: Comprehensive metrics and insights
- Responsive Design: Optimized for desktop, tablet, and mobile devices
- Component Library: Built with Storybook for component development and documentation
- Node.js: v18.0.0 or higher
- Package Manager: npm, yarn, pnpm, or bun
- Git: For version control
git clone <repository-url>
cd Stellarlend-frontendChoose your preferred package manager:
# Using npm
npm install
# Using yarn
yarn install
# Using pnpm (recommended)
pnpm install
# Using bun
bun installCreate a .env.local file in the root directory:
cp .env.example .env.localEdit .env.local with your configuration:
# Stellar Network Configuration
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org
# API Configuration (if applicable)
NEXT_PUBLIC_API_URL=http://localhost:3001/api
# Feature Flags
NEXT_PUBLIC_ENABLE_ANALYTICS=falseNote: For production, use the Stellar mainnet configuration and secure your environment variables.
# Using npm
npm run dev
# Using yarn
yarn dev
# Using pnpm
pnpm dev
# Using bun
bun devOpen http://localhost:3000 in your browser to see the application.
npm run build
npm start# Run all tests
npm test
# Run tests in watch mode
npm test -- --watch
# Run tests with coverage
npm test -- --coverage# Start Storybook development server
npm run storybook
# Build Storybook for static hosting
npm run build-storybookStorybook will be available at http://localhost:6006
Stellarlend-frontend/
βββ app/ # Next.js App Router pages
β βββ account/ # User account pages
β βββ dashboard/ # Dashboard pages
β βββ lending/ # Lending & borrowing pages
β βββ layout.tsx # Root layout
βββ components/ # React components
β βββ atoms/ # Atomic design: smallest components
β βββ molecules/ # Composite components
β βββ organisms/ # Complex components
β βββ features/ # Feature-specific components
β β βββ account/ # Account feature components
β β βββ dashboard/ # Dashboard feature components
β β βββ lending/ # Lending feature components
β βββ marketing/ # Marketing page components
β βββ shared/ # Shared components
β βββ ui/ # UI components (buttons, icons, etc.)
β βββ layout/ # Layout components (navbar, sidebar, etc.)
β βββ common/ # Common utility components
βββ constants/ # Application constants
β βββ design-tokens.ts # Design system tokens
βββ context/ # React context providers
β βββ SidebarContext.tsx
βββ lib/ # Utility libraries
β βββ auth.ts # Authentication utilities
β βββ utils/ # Utility functions
β β βββ cn.ts # Class name utilities (Tailwind merge)
β β βββ index.ts # Utils barrel export
β βββ index.ts # Lib barrel export
βββ types/ # TypeScript type definitions
β βββ Transaction.ts # Transaction-related types
β βββ common.ts # Common utility types
β βββ index.ts # Types barrel export
βββ public/ # Static assets
β βββ icons/ # Icon assets
β βββ images/ # Image assets
βββ scripts/ # Build and utility scripts
β βββ svgToComponent.js # SVG to React component converter
β βββ generate-component.js
βββ test/ # Test utilities and helpers
β βββ test-utils.tsx
β βββ component-helpers.ts
βββ stories/ # Storybook stories
We use Plop for component scaffolding:
npm run generate-componentFollow the prompts to create a new component with proper structure, tests, and Storybook stories.
Place SVG files in public/images and run:
npm run svgThis will automatically convert SVGs to React components in components/shared/ui/icons/.
- Next.js Documentation - Learn about Next.js features and API
- React Documentation - React library documentation
- TypeScript Documentation - TypeScript language reference
- Tailwind CSS Documentation - Utility-first CSS framework
- Stellar Documentation - Stellar blockchain development guide
- Soroban Documentation - Soroban smart contracts
- Storybook - Component development environment
- Vitest - Fast unit test framework
- Playwright - End-to-end testing framework
- Framer Motion - Animation library
- Lucide Icons - Icon library
We welcome contributions! Please see our Contributing Guide for detailed guidelines.
Quick Start:
- Fork the repository and create a feature branch
- Follow the code style - We use ESLint and Prettier (configured with Husky pre-commit hooks)
- Write tests for new features and bug fixes
- Update documentation as needed
- Submit a pull request with a clear description of changes
- Linting: Run
npm run lintbefore committing - Formatting: Prettier is configured to run automatically on commit
- TypeScript: Strict mode enabled - ensure all types are properly defined
We use Conventional Commits. Examples:
feat: add new lending form componentfix: resolve transaction status display issuedocs: update README with setup instructions
For more details, see CONTRIBUTING.md.
The easiest way to deploy is using Vercel:
- Push your code to GitHub
- Import the repository in Vercel
- Configure environment variables
- Deploy!
# Build the application
npm run build
# Start production server
npm startFor more deployment options, see the Next.js deployment documentation.
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm start |
Start production server |
npm run lint |
Run ESLint |
npm test |
Run tests with Vitest |
npm run storybook |
Start Storybook |
npm run build-storybook |
Build Storybook for static hosting |
npm run svg |
Convert SVG files to React components |
npm run generate-component |
Generate new component scaffold |
- Never commit
.env.localor any files containing secrets - Use environment variables for all sensitive configuration
- Regularly update dependencies to patch security vulnerabilities
- Review and audit smart contract interactions before production use
[Add your license information here]
For questions, issues, or feature requests:
- Open an issue on GitHub
- Contact the development team
- Check the documentation links above
Built with β€οΈ for the Stellar ecosystem