Next.js web application for the RemitLend platform, providing user interfaces for borrowers and lenders to interact with the decentralized lending protocol.
The frontend is a modern React application built with Next.js that enables:
- Wallet connection (Freighter, Albedo, etc.)
- Credit score visualization
- Remittance NFT minting
- Loan request and management
- Lending pool participation
- Real-time transaction tracking
- Framework: Next.js 16 (App Router)
- React: 19.2.3
- Language: TypeScript
- Styling: Tailwind CSS 4
- Wallet Integration: Stellar Wallet Kit (planned)
- State Management: React hooks + Context API (planned)
- Node.js 18 or higher
- npm or yarn
- Stellar wallet (Freighter recommended)
# Install dependencies
npm install
# Start development server
npm run devOpen http://localhost:3000 in your browser.
# Development
npm run dev # Start dev server with hot reload
# Production
npm run build # Build for production
npm start # Run production build
# Code Quality
npm run lint # Check code quality with ESLintfrontend/
├── src/
│ └── app/ # Next.js App Router
│ ├── components/ # React components
│ │ └── global_ui/ # Reusable UI components
│ │ └── Spinner.tsx
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Home page
│ ├── not-found.tsx # 404 page
│ ├── globals.css # Global styles
│ └── favicon.ico
├── public/ # Static assets
│ ├── og-image.png
│ └── *.svg
├── next.config.ts # Next.js configuration
├── tailwind.config.ts # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
├── package.json
└── README.md
- Landing page with project overview
- Responsive design for mobile and desktop
- Loading states with spinner component
- SEO optimization with metadata
- Custom 404 page
- Wallet connection interface
- Credit score display
- Remittance NFT minting
- Loan request form
- Active loans management
- Repayment interface
- Transaction history
- Pool liquidity overview
- Deposit/withdraw interface
- Loan approval queue
- Yield tracking
- Portfolio analytics
- Real-time transaction status
- Notification system
- Multi-language support
- Dark mode toggle
- Wallet balance display
Loading indicator component.
import { Spinner } from "@/app/components/global_ui/Spinner";
<Spinner size="md" />;Props:
size: 'sm' | 'md' | 'lg' (default: 'md')
Button- Reusable button with variantsCard- Container componentModal- Dialog componentInput- Form input with validationWalletConnect- Wallet connection buttonTransactionStatus- Transaction feedbackLoanCard- Loan information displayPoolStats- Pool statistics display
The project uses Tailwind CSS 4 for styling with a custom configuration.
Key Features:
- Utility-first CSS
- Responsive design utilities
- Custom color palette (planned)
- Dark mode support (planned)
Example:
<div className="flex items-center justify-center min-h-screen bg-gray-50">
<h1 className="text-4xl font-bold text-gray-900">Welcome to RemitLend</h1>
</div>Global styles are defined in src/app/globals.css:
- CSS reset
- Tailwind directives
- Custom CSS variables
- Typography defaults
Integration with Stellar wallets for transaction signing.
Supported Wallets:
- Freighter
- Albedo
- Rabet
- xBull
Example Usage:
import { StellarWalletKit } from "@stellar/wallet-kit";
const kit = new StellarWalletKit({
network: "testnet",
selectedWallet: "freighter",
});
// Connect wallet
await kit.connect();
// Sign transaction
const signedTx = await kit.sign(transaction);Global state management using React Context API.
Contexts:
WalletContext- Wallet connection stateUserContext- User profile and credit scoreLoanContext- Active loans dataPoolContext- Lending pool information
Example:
import { useWallet } from "@/contexts/WalletContext";
function MyComponent() {
const { address, connected, connect, disconnect } = useWallet();
return (
<button onClick={connected ? disconnect : connect}>
{connected ? `Connected: ${address}` : "Connect Wallet"}
</button>
);
}The frontend communicates with the Express backend for off-chain data.
Base URL: http://localhost:3001/api
Example:
async function fetchCreditScore(userId: string) {
const response = await fetch(`http://localhost:3001/api/score/${userId}`);
const data = await response.json();
return data.score;
}Direct interaction with Soroban smart contracts via Stellar SDK.
Example:
import { Contract, SorobanRpc } from "@stellar/stellar-sdk";
const contract = new Contract(contractId);
const server = new SorobanRpc.Server("https://soroban-testnet.stellar.org");
// Call contract method
const result = await contract.call("get_score", [nftId]);Next.js 13+ App Router with file-based routing.
Current Routes:
/- Landing page/404- Not found page
Planned Routes:
/borrower- Borrower dashboard/lender- Lender dashboard/loans- Loan management/loans/[id]- Loan details/pool- Pool overview/profile- User profile
export const metadata = {
title: "RemitLend - Credit from Remittances",
description: "Turn your remittance history into credit history",
openGraph: {
title: "RemitLend",
description: "Decentralized lending for migrant workers",
images: ["/og-image.png"],
},
};- Static Generation: Pre-render pages at build time
- Image Optimization: Automatic image optimization
- Code Splitting: Automatic code splitting per route
- Font Optimization: Automatic font optimization
- Use
next/imagefor images - Implement lazy loading for heavy components
- Minimize client-side JavaScript
- Use server components when possible
- Implement proper caching strategies
- Unit Tests: Jest + React Testing Library
- E2E Tests: Playwright or Cypress
- Component Tests: Storybook
import { render, screen } from "@testing-library/react";
import { Spinner } from "@/app/components/global_ui/Spinner";
describe("Spinner", () => {
it("renders spinner", () => {
render(<Spinner />);
expect(screen.getByRole("status")).toBeInTheDocument();
});
});# Install Vercel CLI
npm i -g vercel
# Deploy
vercel# Build image
docker build -t remitlend-frontend .
# Run container
docker run -p 3000:3000 remitlend-frontendCreate .env.local for local development:
NEXT_PUBLIC_API_URL=http://localhost:3001
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_STELLAR_RPC_URL=https://soroban-testnet.stellar.orgThe application aims for WCAG 2.1 Level AA compliance:
- Semantic HTML elements
- ARIA labels where needed
- Keyboard navigation support
- Color contrast ratios
- Screen reader compatibility
Note: Full WCAG compliance requires manual testing with assistive technologies.
- Chrome (latest 2 versions)
- Firefox (latest 2 versions)
- Safari (latest 2 versions)
- Edge (latest 2 versions)
See CONTRIBUTING.md for guidelines.
- Use functional components with hooks
- Prefer TypeScript interfaces over types
- Use descriptive component names
- Keep components small and focused
- Extract reusable logic into custom hooks
- Follow Next.js best practices
npm run lint
npm run build# Kill process on port 3000
lsof -ti:3000 | xargs kill -9# Clean Next.js cache
rm -rf .next/
npm run build# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install- Next.js Documentation
- React Documentation
- Tailwind CSS Documentation
- Stellar Documentation
- Soroban Documentation
ISC License - See LICENSE file for details.
- Open an issue for bug reports
- Check existing issues before creating new ones
- Provide browser and OS information
- Include screenshots for UI issues