Confort+ is a modern, production-grade payment and session management system designed for secure, fraud-resistant customer interactions. Built with React (frontend) and Rust/Actix-web (backend), it integrates with Fapshi and Binance Pay for flexible payment options.
- Payment Processing: Secure integration with Fapshi (mobile money) and Binance Pay (cryptocurrency)
- Anti-Fraud Protection: Multi-layered security including unique codes, screenshot-resistant hologram effects, and webhook signature verification
- Manager Portal: Secure code verification interface with PIN authentication
- PWA Support: Offline-capable Progressive Web App with service worker caching
- Multi-Language Support: French as primary language with English fallback (powered by react-i18next)
- Production Ready: Comprehensive deployment documentation, security audits, and QA procedures
The application is fully localized in French, with English available as a fallback. All UI text, buttons, labels, and messages display in French by default. The localization system uses react-i18next for easy maintenance and potential future language additions.
Supported languages:
- 🇫🇷 Français (Primary)
- 🇬🇧 English (Fallback)
├── frontend/ # React-based customer app
│ ├── src/
│ │ ├── components/ # UI components (Payment, SuccessScreen, Manager Portal)
│ │ ├── lib/ # API client functions
│ │ ├── __tests__/ # Frontend unit tests
│ │ └── main.jsx # App entry point
│ ├── package.json
│ └── vite.config.js
│
├── src/ # Rust backend (Actix-web)
│ ├── main.rs # HTTP server, routes, middleware
│ ├── config.rs # Environment variable loading
│ ├── handlers.rs # API endpoints (payment, verification, webhooks)
│ ├── db.rs # Supabase HTTP REST API client
│ ├── models.rs # Request/Response schemas
│ ├── crypto.rs # HMAC-SHA256 signature verification
│ ├── code_gen.rs # 4-char unique code generation
│ └── lib.rs # Library module exports
│
├── tests/ # Integration & crypto tests
├── Cargo.toml # Rust project manifest
└── DEPLOYMENT.md # Production deployment guide
- Node.js 18+ (frontend)
- Rust 1.70+ (backend)
- npm or yarn (frontend package manager)
- Cargo (Rust build system)
cd frontend
npm install
npm run devThe frontend will be available at http://localhost:5173.
Environment Variables (frontend/.env):
VITE_API_BASE_URL=http://localhost:8000
VITE_MANAGER_PIN=1234
Create .env file in project root:
SUPABASE_URL=your_supabase_project_url
SUPABASE_SERVICE_KEY=your_service_role_key
FAPSHI_API_USER=your_fapshi_api_user
FAPSHI_API_KEY=your_fapshi_api_key
FAPSHI_WEBHOOK_SECRET=your_fapshi_webhook_secret
BINANCE_API_KEY=your_binance_api_key
BINANCE_SECRET_KEY=your_binance_secret_key
CORS_ORIGIN=http://localhost:5173
Build and run the backend:
# Build dependencies and server
cargo build --release
# Run the server
cargo run --releaseThe backend API will be available at http://localhost:8000. The release build produces a single deployable binary in target/release/confort (~7.3MB) with no Python runtime required.
Frontend:
cd frontend
npm testBackend (38 tests):
# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test suite
cargo test crypto
cargo test integrationFrontend Linting:
cd frontend && npm run lintConfort+ is designed for production deployment with:
- Frontend: Vercel hosting (PWA with automatic builds)
- Backend: Compiled Rust binary (AWS, Railway, Render, DigitalOcean, or similar)
- Database: Supabase PostgreSQL
- Payment Processing: CinetPay and Binance Pay webhooks
-
Frontend Deployment (Vercel):
- Fork/push to GitHub
- Connect to Vercel project
- Set environment variables in Vercel dashboard
- Deploy automatically on push
-
Backend Deployment:
- Build release binary:
cargo build --release - Deploy
target/release/confortbinary to your hosting platform - Set production environment variables (SUPABASE_URL, SUPABASE_SERVICE_KEY, API keys, etc.)
- Configure webhooks with CinetPay and Binance Pay
- Run binary:
./confort(listens on 0.0.0.0:8000)
- Build release binary:
-
Complete Setup: See DEPLOYMENT.md for comprehensive step-by-step instructions.
Frontend (set in Vercel):
VITE_API_BASE_URL: Production API URLVITE_MANAGER_PIN: Manager authentication PIN
Backend (set on server):
SUPABASE_URL: Supabase project URLSUPABASE_KEY: Service Role KeyCINETPAY_API_KEY: CinetPay API keyCINETPAY_SECRET_KEY: CinetPay secret keyBINANCE_API_KEY: Binance API keyBINANCE_SECRET_KEY: Binance secret keyCORS_ORIGIN: Production frontend URL
- HTTPS/TLS: All endpoints require HTTPS in production
- Webhook Verification: SHA256 HMAC signature verification for payment webhooks
- Database Security: Service Role Key isolation, no hardcoded secrets
- API Security: CORS configured for production domain only, rate limiting on sensitive endpoints
- Code Security: Unique 4-character codes, one-time use validation
- Screenshot Prevention: Animated hologram effects that appear different in screenshots
- PIN Protection: Manager portal secured with configurable PIN
POST /api/initiate— Initiate payment, create transactionGET /api/transaction/{id}— Get transaction details and generated codePOST /api/webhook/cinetpay— CinetPay payment confirmation webhookPOST /api/webhook/crypto— Binance Pay payment confirmation webhook
POST /api/verify-code— Verify code and transition from PAID to USED
Complete QA testing guide available in QA_TEST_GUIDE.md.
Key test scenarios:
- Payment flow (initiation → confirmation → code display)
- Code verification (valid, already-used, invalid)
- Fraud prevention (code reuse rejection, screenshot resistance)
- Network isolation (Wi-Fi whitelist validation)
- Error handling (network failures, timeout scenarios)
- DEPLOYMENT.md — Comprehensive deployment guide
- ENV_VARIABLES.md — Environment variable reference
- PRODUCTION_SECURITY.md — Security audit checklist
- FRAUD_PREVENTION.md — Fraud vectors and prevention strategies
- QA_TEST_GUIDE.md — Complete QA testing procedures
- PRODUCTION_READINESS.md — Acceptance criteria verification
- Create a feature branch:
git checkout -b feature/your-feature - Make changes and test locally
- Push to branch:
git push origin feature/your-feature - Create a pull request
MIT