Florin is a modern web application built with React and TypeScript. It provides a user-friendly interface for interacting with blockchain functionality, featuring components for wallet integration, QR code generation, and form handling.
- Frontend Framework: React 19
- Language: TypeScript
- Build Tool: Vite 6
- Styling: Tailwind CSS 4
- State Management: TanStack Query (React Query)
- Routing: TanStack Router
- Form Handling: React Hook Form with Zod validation
- UI Components: Radix UI
- Blockchain Integration: wagmi, viem
- Testing: Vitest, React Testing Library
- Code Quality: ESLint, Prettier
- Node.js (Latest LTS version recommended)
- npm or yarn package manager
- Clone the repository:
git clone [repository-url]
cd florin-fe- Install dependencies:
npm install
# or
yarn installTo start the development server:
npm run dev
# or
yarn devThe application will be available at http://localhost:5173
To create a production build:
npm run build
# or
yarn buildTo preview the production build locally:
npm run preview
# or
yarn previewThe application uses environment variables for configuration. Create a .env file in the root directory with the following variables:
# WalletConnect project ID for wallet connection functionality
VITE_WALLETCONNECT_PROJECT_ID=""
# RPC URL for connecting to the Ethereum network
VITE_RPC_URL=""
# Base URL for the Florin API endpoints
VITE_API_BASE_URL="https://florin.bitcoinos.build"
# Number of hours until a transaction expires
VITE_EXPIRATION_HOURS=24
# Minimum amount allowed for transactions (in BTC)
VITE_MIN_AMOUNT="0.0004"
# Maximum amount allowed for transactions (in BTC)
VITE_MAX_AMOUNT="3"
# Number of confirmations required for EVM transactions to be completed
VITE_EVM_CONFIRMATIONS=10
# USD amount threshold that determines if the ui shows up the second step immediately or if wait for VITE_EVM_CONFIRMATIONS confirmations
VITE_EVM_CONFIRMATIONS_USD_AMOUNT=100
# Number of confirmations required for Bitcoin transactions
VITE_BTC_CONFIRMATIONS=6
# Default position id for reservation
VITE_DEFAULT_POSITION_ID=The application uses different contract addresses for different networks. These addresses are configured in src/constants/contracts.ts. To modify the contract addresses:
- Navigate to
src/constants/contracts.ts - Update the addresses in the
CONTRACTS_ADDRESSobject for the desired network:ammExchange: AMM Exchange contract addressmarketMakerProxy: Market Maker Proxy contract addressflorinForwarder: Florin Forwarder contract addresserc20BitSnark: ERC20 BitSnark token contract addresscontractRegistry: Contract Registry address
The file supports multiple networks, Sepolia testnet (chain ID: 11155111) and local development (chain ID: 31337).
npm run dev- Start development servernpm run build- Create production buildnpm run preview- Preview production buildnpm run lint- Run ESLintnpm run format- Format code with Prettiernpm run test- Run testsnpm run test:coverage- Run tests with coverage reportnpm run deploy-prod- Deploy to productionnpm run deploy-staging- Deploy to staging
The project uses Vitest and React Testing Library for testing. To run tests:
# Run tests in watch mode
npm run test
# Run tests with coverage
npm run test:coverageThe project is deployed using github actions and netlify. Set the followings actions variables in order to correctly deploy to netlify:
NETLIFY_SITE_ID NETLIFY_AUTH_TOKEN
On every new commit to develop (netflify preview) and main (netlify production)
- Create a new branch for your feature
- Make your changes
- Run tests and ensure they pass
- Submit a pull request
[Add your license information here]