Progressive Web Application (PWA) for investors to view their portfolio balance, performance, and request withdrawals or deposits.
- ๐ Google Authentication - Secure login with Firebase Auth
- ๐ Dashboard - Portfolio metrics and performance tracking
- ๐ฐ Depรณsitos - View deposit addresses (USDT/USDC only)
- ๐ค Retiros - Submit partial or full withdrawal requests
- ๐งพ Historial - Movements table (planned)
- ๐ฑ PWA Support - Install as native app on mobile devices
- ๐จ Responsive Design - Optimized for mobile and desktop
- Frontend: React 18 + Vite
- Styling: Tailwind CSS
- Authentication: Firebase Auth (Google Sign-In)
- Data Source: Google Sheets API
- Hosting: Firebase Hosting
- Email: EmailJS
- Testing: Vitest + React Testing Library
The investor panel can live either:
- As a route under the same domain (recommended):
/app(e.g.winbit.../app) - As a subdomain:
app.winbit...
In both cases, the investor panel routes remain protected behind Firebase Auth.
When hosting the panel under /app, the development URL is typically:
http://localhost:5173/app/
- Default language: Espaรฑol
- Language switcher: Header (top-right) (Spanish / English)
- Language preference: stored in localStorage
- Translation system:
react-i18next
The app uses Argentine number formatting:
- Thousands separator: Point (
.) - Example:15.226 - Decimal separator: Comma (
,) - Example:15.226,00 - Currency format:
$15.226,00(no space between $ and number) - Percentage format:
+1,50%(always show sign for positive values) - Return values: Show
+sign for positive results (except portfolio value) - Zero values: No sign for zero (
$0,00,0,00%)
- Portfolio value:
$15.226,50(no sign) - Positive returns:
+$1.500,75and+1,50% - Negative returns:
-$500,25and-2,30% - Zero:
$0,00and0,00%
- Node.js 18+ and npm
- Firebase project with Authentication and Hosting enabled
- Google Cloud project with Sheets API enabled
- EmailJS account for email notifications
git clone <repository-url>
cd winbit-app
npm installCreate a .env file in the root directory:
# Firebase Configuration
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
# Google Sheets API
VITE_GOOGLE_SHEETS_API_KEY=your_google_sheets_api_key
VITE_GOOGLE_SHEETS_ID=your_sheet_id
# EmailJS Configuration
VITE_EMAILJS_SERVICE_ID=your_emailjs_service_id
VITE_EMAILJS_TEMPLATE_ID_WITHDRAWAL=your_withdrawal_template_id
VITE_EMAILJS_TEMPLATE_ID_DEPOSIT=your_deposit_template_id
VITE_EMAILJS_PUBLIC_KEY=your_emailjs_public_keyYour Google Sheet should have the following structure:
| Column A | Column B | Column C | Column D | Column E | Column F+ |
|---|---|---|---|---|---|
| Name | Balance | Invested | Returns% | Historical Data |
- Column A: Investor email (must match Google Sign-In email)
- Column B: Investor name
- Column C: Current balance (USD)
- Column D: Total invested (USD)
- Column E: Returns/Performance (%)
Edit src/config/wallets.js with your wallet addresses:
export const WALLETS = [
{
network: 'USDT (TRC20)',
address: 'your_usdt_trc20_address',
icon: 'โฎ',
},
{
network: 'USDC (TRC20)',
address: 'your_usdc_trc20_address',
icon: '$',
},
// Pending: final list of supported networks + addresses
];# Start development server
npm run dev
# Run tests
npm run test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch
# Build for production
npm run build
# Preview production build
npm run previewThe project uses Vitest and React Testing Library with a minimum 97% code coverage requirement.
# Run all tests
npm run test
# Generate coverage report
npm run test:coverage- Install Firebase CLI:
npm install -g firebase-tools- Login to Firebase:
firebase login- Initialize Firebase (if not done):
firebase initSelect:
- Hosting
- Use existing project
- Public directory:
dist - Single-page app: Yes
- GitHub actions: No
- Build and deploy:
npm run build
firebase deploysrc/
โโโ components/
โ โโโ ui/ # Reusable UI components
โ โโโ layout/ # Layout components
โ โโโ features/ # Feature-specific components
โ โโโ auth/ # Authentication
โ โโโ dashboard/ # Dashboard features
โ โโโ wallets/ # Wallet management
โ โโโ requests/ # Withdrawal/Deposit forms
โโโ hooks/ # Custom React hooks
โโโ services/ # API services
โโโ utils/ # Helper functions
โโโ pages/ # Page components
โโโ config/ # Configuration files
โโโ test/ # Test setup
โโโ App.jsx
โโโ main.jsx
- Portfolio updates are processed once per business day after the operational close
- Historical data available from investor's signup date
- Requests are received until 17:00 (GMT-3) and executed at 18:00 (GMT-3).
- Requests submitted after 17:00 (GMT-3) are processed the next day.
To finish the dashboard and history, we need the Google Sheet to explicitly define where these values come from:
- Dashboard metrics:
- Current portfolio value (USD)
- Total return since inception (USD)
- Total return since inception (%)
- Annual return (USD)
- Annual return (%)
- History table:
- Date, Movement type, Amount, Previous balance, New balance, Status
- Whether history is a single sheet with an
emailcolumn or per-investor tabs - Status values (e.g. Pending / Completed / Rejected)
- Only authenticated users with Google Sign-In
- User email must exist in Google Sheet
- Firebase security rules enforce authentication
- Google Sheets API key restricted to Sheets API only
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
Users can install Winbit as a native app:
- Visit the app in a supported browser
- Look for "Install" or "Add to Home Screen" prompt
- Follow browser-specific installation steps
- Ensure user's email exists in Column A of Google Sheet
- Check that email matches exactly (case-sensitive)
- Verify API key is correct and not restricted
- Check that Sheets API is enabled in Google Cloud Console
- Ensure sheet is shared with "Anyone with the link can view"
- Verify EmailJS credentials are correct
- Check EmailJS service is active
- Confirm email templates are published
Private - All rights reserved ยฉ 2024 Winbit