
All checks were successful
build-and-push-ext / build_push (push) Successful in 35s
- Dockerfile optimisé: seulement docker-cli pour bitcoin-cli - README.md complet avec tous les endpoints et configuration - CHANGELOG.md mis à jour avec v1.1.1 - Tests unitaires pour les routes funds - Tests d'intégration pour le signer - Configuration Jest avec coverage - Scripts de test dans package.json - Fichier .env.test pour les tests
3.2 KiB
3.2 KiB
LeCoffre Backend Mini
Serveur Express.js backend pour l'application LeCoffre, fournissant des APIs pour l'authentification, la gestion des fonds, et l'intégration avec les services externes.
🚀 Fonctionnalités
- API REST : Endpoints pour l'authentification, gestion des fonds, SMS, email
- Intégration Signer : Connexion WebSocket au signer distant (dev3.4nkweb.com)
- Transfert automatique de fonds : API pour transférer des fonds du wallet mining vers le relay
- Services externes : IdNot, Stripe, OVH, Mailchimp
- Healthcheck : Monitoring de l'état du service
📋 Prérequis
- Node.js 19+
- Docker (pour l'exécution)
- Accès au signer distant (dev3.4nkweb.com)
🛠️ Installation
npm install
🏃♂️ Démarrage
Mode développement
npm run dev
Mode production
npm start
Build
npm run build
📡 Endpoints API
Endpoints principaux
GET /
- Documentation de l'APIGET /api/v1/health
- Healthcheck du service
Gestion des fonds
POST /api/v1/funds/transfer
- Transfert automatique de fondsGET /api/v1/funds/check
- Vérification des fonds du relay
Authentification
POST /api/v1/idnot/auth
- Authentification IdNot
Services externes
POST /api/sms
- Service SMSPOST /api/email
- Service emailPOST /api/stripe
- Service StripePOST /api/subscription
- Gestion des abonnements
🔧 Configuration
Variables d'environnement principales
# Configuration serveur
PORT=8080
NODE_ENV=production
# Signer distant
SIGNER_WS_URL=ws://dev3.4nkweb.com:9090
SIGNER_BASE_URL=https://dev3.4nkweb.com
SIGNER_API_KEY=your-api-key-change-this
# Relays
RELAY_URLS=wss://dev4.4nkweb.com/ws/,wss://dev3.4nkweb.com/ws/
VITE_BOOTSTRAPURL=https://dev4.4nkweb.com/ws/
# CORS
CORS_ALLOWED_ORIGINS=https://dev4.4nkweb.com,http://local.4nkweb.com:3000
Configuration complète
Voir le fichier .env.exemple
pour toutes les variables disponibles.
🐳 Docker
Build de l'image
docker build -t lecoffre-back-mini .
Exécution
docker run -p 8080:8080 --env-file .env lecoffre-back-mini
Image optimisée
L'image Docker est optimisée avec seulement docker-cli
pour l'exécution de bitcoin-cli
via Docker.
🧪 Tests
Tests unitaires
npm test
Tests d'intégration
npm run test:integration
Tests spécifiques
npm run test:funds # Tests des routes funds
npm run test:signer # Tests de connectivité signer
📊 Monitoring
Healthcheck
curl http://localhost:8080/api/v1/health
Logs
Les logs sont structurés avec des niveaux de log appropriés.
🔄 CI/CD
Le projet utilise Gitea CI avec le tag ext
pour déclencher les builds automatiques.
📝 Changelog
Voir CHANGELOG.md pour l'historique des versions.
🤝 Contribution
- Fork le projet
- Créer une branche feature (
git checkout -b feature/AmazingFeature
) - Commit les changements (
git commit -m 'Add some AmazingFeature'
) - Push vers la branche (
git push origin feature/AmazingFeature
) - Ouvrir une Pull Request
📄 Licence
Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.