|
1 | | -# React + TypeScript + Vite |
| 1 | +# Florin Frontend |
| 2 | + |
| 3 | +## Overview |
| 4 | +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. |
| 5 | + |
| 6 | +## Tech Stack |
| 7 | +- **Frontend Framework**: React 19 |
| 8 | +- **Language**: TypeScript |
| 9 | +- **Build Tool**: Vite 6 |
| 10 | +- **Styling**: Tailwind CSS 4 |
| 11 | +- **State Management**: TanStack Query (React Query) |
| 12 | +- **Routing**: TanStack Router |
| 13 | +- **Form Handling**: React Hook Form with Zod validation |
| 14 | +- **UI Components**: Radix UI |
| 15 | +- **Blockchain Integration**: wagmi, viem |
| 16 | +- **Testing**: Vitest, React Testing Library |
| 17 | +- **Code Quality**: ESLint, Prettier |
2 | 18 |
|
3 | 19 | ## Setup |
4 | 20 |
|
5 | | -Run `yarn` or `npm install` |
| 21 | +### Prerequisites |
| 22 | +- Node.js (Latest LTS version recommended) |
| 23 | +- npm or yarn package manager |
| 24 | + |
| 25 | +### Installation |
| 26 | +1. Clone the repository: |
| 27 | +```bash |
| 28 | +git clone [repository-url] |
| 29 | +cd florin-fe |
| 30 | +``` |
| 31 | + |
| 32 | +2. Install dependencies: |
| 33 | +```bash |
| 34 | +npm install |
| 35 | +# or |
| 36 | +yarn install |
| 37 | +``` |
| 38 | + |
| 39 | +### Development |
| 40 | +To start the development server: |
| 41 | +```bash |
| 42 | +npm run dev |
| 43 | +# or |
| 44 | +yarn dev |
| 45 | +``` |
| 46 | +The application will be available at `http://localhost:5173` |
| 47 | + |
| 48 | +### Production Build |
| 49 | +To create a production build: |
| 50 | +```bash |
| 51 | +npm run build |
| 52 | +# or |
| 53 | +yarn build |
| 54 | +``` |
| 55 | + |
| 56 | +To preview the production build locally: |
| 57 | +```bash |
| 58 | +npm run preview |
| 59 | +# or |
| 60 | +yarn preview |
| 61 | +``` |
| 62 | + |
| 63 | +## Environment Variables |
| 64 | +The application uses environment variables for configuration. Create a `.env` file in the root directory with the following variables: |
| 65 | + |
| 66 | +```env |
| 67 | +VITE_WALLETCONNECT_PROJECT_ID="" |
| 68 | +VITE_RPC_URL="" |
| 69 | +VITE_API_BASE_URL="" |
| 70 | +VITE_EXPIRATION_HOURS=24 |
| 71 | +``` |
| 72 | + |
| 73 | +## Main Scripts |
| 74 | +- `npm run dev` - Start development server |
| 75 | +- `npm run build` - Create production build |
| 76 | +- `npm run preview` - Preview production build |
| 77 | +- `npm run lint` - Run ESLint |
| 78 | +- `npm run format` - Format code with Prettier |
| 79 | +- `npm run test` - Run tests |
| 80 | +- `npm run test:coverage` - Run tests with coverage report |
| 81 | +- `npm run deploy-prod` - Deploy to production |
| 82 | +- `npm run deploy-staging` - Deploy to staging |
| 83 | + |
| 84 | +## Tests |
| 85 | +The project uses Vitest and React Testing Library for testing. To run tests: |
| 86 | + |
| 87 | +```bash |
| 88 | +# Run tests in watch mode |
| 89 | +npm run test |
| 90 | + |
| 91 | +# Run tests with coverage |
| 92 | +npm run test:coverage |
| 93 | +``` |
| 94 | + |
| 95 | +## Deployment |
| 96 | +The project is deployed using github actions and netlify. Set the followings actions variables in order to correctly deploy to netlify: |
| 97 | + |
| 98 | +NETLIFY_SITE_ID |
| 99 | +NETLIFY_AUTH_TOKEN |
| 100 | + |
| 101 | +### Continuous deployment trigger |
| 102 | +On every new commit to `develop` (netflify preview) and `main` (netlify production) |
| 103 | + |
| 104 | +## Contributing |
| 105 | +1. Create a new branch for your feature |
| 106 | +2. Make your changes |
| 107 | +3. Run tests and ensure they pass |
| 108 | +4. Submit a pull request |
6 | 109 |
|
7 | | -Run `yarn dev` or `npm run dev` |
| 110 | +## License |
| 111 | +[Add your license information here] |
0 commit comments