Stellar Portfolio Visualization & AI-Driven Insights Platform
AstraPort DApp is the frontend interface for users. It connects to Stellar wallets, visualizes portfolios, and displays AI-driven insights powered by advanced analytics.
astraport-dapp/
βββ app/ # Next.js App Router
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β βββ globals.css # Global Tailwind styles
β βββ not-found.tsx # 404 page
βββ src/
β βββ components/ # React components
β β βββ wallet/ # Wallet connection (WalletConnect)
β β βββ dashboard/ # Portfolio overview & charts
β β βββ risk/ # Risk visualization
β β βββ insights/ # AI insights display
β βββ hooks/ # Custom React hooks
β β βββ useStellarWallet.ts
β β βββ usePortfolio.ts
β β βββ useDashboardData.ts
β βββ services/ # API services & integrations
β β βββ stellar.ts # Stellar SDK wrapper
β β βββ portfolio.ts # Portfolio API client
β βββ store/ # Zustand state management
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
βββ tests/ # Jest tests
βββ examples/ # Code examples & mock data
βββ docs/ # Documentation
β βββ SETUP.md # Setup & installation guide
β βββ API.md # API integration guide
βββ public/ # Static assets
βββ package.json # Dependencies
βββ tsconfig.json # TypeScript config
βββ next.config.js # Next.js config
βββ tailwind.config.ts # Tailwind CSS config
βββ jest.config.js # Jest testing config
- Stellar wallet connection (Freighter integration)
- Account management
- Network selection (Testnet/Public)
- Portfolio overview with key metrics
- Interactive charts with Chart.js
- Asset breakdown
- Performance tracking
- Overall risk score calculation
- Volatility analysis
- Concentration risk metrics
- Counterparty risk assessment
- Portfolio recommendations
- Risk alerts
- Optimization suggestions
- Market insights
| Category | Technology |
|---|---|
| Framework | Next.js 14 (App Router) |
| Language | TypeScript 5 |
| UI Library | React 18 |
| Styling | Tailwind CSS 3 |
| State Management | Zustand |
| Blockchain | Stellar SDK 11 |
| Charting | Chart.js 4 + D3.js 7 |
| Testing | Jest + React Testing Library |
| Code Quality | ESLint, Prettier |
- Node.js 18+
- npm or yarn
- A Stellar wallet (e.g., Freighter)
# Clone repository
git clone https://github.com/Astraportt/astraport-dapp.git
cd astraport-dapp
# Install dependencies
npm install
# Set up environment
cp .env.example .env.local
# Start development server
npm run devOpen http://localhost:3000 in your browser.
NEXT_PUBLIC_STELLAR_NETWORK=testnet # testnet or public
NEXT_PUBLIC_ASTRAPORT_API_URL=https://api.astraport.dev
NEXT_PUBLIC_WALLET_TIMEOUT=300000
API_KEY=your_api_key_here- Setup Guide - Installation & wallet connection
- API Reference - API endpoints & integration
- Contributing - Development guidelines
- Changelog - Version history
# Run tests
npm test
# Watch mode
npm run test:watch
# Coverage
npm test -- --coverage# Development
npm run dev
# Production build
npm run build
npm start
# Type checking
npm run type-check
# Linting
npm run lintThe DApp communicates with AstraPort Core services:
GET /portfolio/{publicKey} # Portfolio data
GET /risk/{publicKey} # Risk metrics
GET /insights/{publicKey} # AI recommendations
See API Documentation for full details.
Handles Stellar wallet connection and account management.
import { WalletConnect } from '@/components/wallet';
export default function App() {
return <WalletConnect />;
}Interactive portfolio performance visualization.
import { PortfolioChart } from '@/components/dashboard';
export default function Dashboard() {
return <PortfolioChart />;
}Real-time risk assessment metrics.
import { RiskScoreDisplay } from '@/components/risk';
export default function RiskPanel() {
return <RiskScoreDisplay />;
}AI-powered portfolio recommendations.
import { InsightsList } from '@/components/insights';
export default function Insights() {
return <InsightsList />;
}const { connected, account, connectWallet, disconnectWallet } = useStellarWallet();const { portfolio, riskScore, insights, loading, errors } = useDashboardData();const { portfolio, loading, error, fetchPortfolio } = usePortfolioData(publicKey);See examples/ for mock data and integration examples:
mockData.ts- Sample portfolio, risk scores, and insightsusageDashboard.ts- Dashboard usage exampleswalletIntegration.ts- Wallet connection examples
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'feat: add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
See CONTRIBUTING.md for detailed guidelines.
- β TypeScript strict mode
- β Component testing setup
- β API service layer
- β State management (Zustand)
- β Error handling
- β Loading states
- β Responsive design (Tailwind CSS)
- β Environment configuration
- β Documentation
- β Examples & mock data
- β Project scaffold
- β Component structure
- β API integration layer
- β Testing setup
- Real wallet integration (Freighter)
- Historical data tracking
- Advanced charting (D3.js)
- Transaction history
- Portfolio rebalancing tools
- Custom alerts
- Multi-wallet support
- Export functionality
- Mobile application
- DeFi protocol integration
- Predictive analytics
- Community features
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@astraport.dev
Built with β€οΈ for the Stellar community