dev4 b0ab709d49
Some checks failed
build-and-push-ext / build_push (push) Failing after 11m46s
ci: docker_tag=ext
2025-09-21 17:05:50 +00:00
2025-09-21 17:05:50 +00:00
2025-09-21 16:57:41 +00:00
2025-09-17 16:10:30 +00:00
2025-06-25 09:09:31 +02:00
2025-09-18 10:12:56 +00:00
2025-09-07 15:30:32 +02:00
2025-09-07 21:10:39 +02:00
2025-09-18 10:12:56 +00:00

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'API
  • GET /api/v1/health - Healthcheck du service

Gestion des fonds

  • POST /api/v1/funds/transfer - Transfert automatique de fonds
  • GET /api/v1/funds/check - Vérification des fonds du relay

Authentification

  • POST /api/v1/idnot/auth - Authentification IdNot

Services externes

  • POST /api/sms - Service SMS
  • POST /api/email - Service email
  • POST /api/stripe - Service Stripe
  • POST /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

  1. Fork le projet
  2. Créer une branche feature (git checkout -b feature/AmazingFeature)
  3. Commit les changements (git commit -m 'Add some AmazingFeature')
  4. Push vers la branche (git push origin feature/AmazingFeature)
  5. Ouvrir une Pull Request

📄 Licence

Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.

Description
No description provided
Readme 3.7 MiB
Languages
JavaScript 98.7%
Dockerfile 1.3%