{"id":46598454,"url":"https://github.com/raphplt/tcg-nexus","last_synced_at":"2026-03-07T15:33:01.105Z","repository":{"id":277525940,"uuid":"932663157","full_name":"raphplt/tcg-nexus","owner":"raphplt","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-05T15:54:02.000Z","size":18038,"stargazers_count":1,"open_issues_count":51,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-05T18:48:30.188Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tcg-nexus-web.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raphplt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-14T09:42:21.000Z","updated_at":"2026-03-05T15:14:11.000Z","dependencies_parsed_at":"2025-03-21T15:29:48.435Z","dependency_job_id":"0d6b33b6-0ead-4f72-8e19-4eed68f68065","html_url":"https://github.com/raphplt/tcg-nexus","commit_stats":null,"previous_names":["raphplt/tcgdex","raphplt/tcg-nexus"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/raphplt/tcg-nexus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphplt%2Ftcg-nexus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphplt%2Ftcg-nexus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphplt%2Ftcg-nexus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphplt%2Ftcg-nexus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphplt","download_url":"https://codeload.github.com/raphplt/tcg-nexus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphplt%2Ftcg-nexus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30219541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T14:02:48.375Z","status":"ssl_error","status_checked_at":"2026-03-07T14:02:43.192Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-07T15:33:00.374Z","updated_at":"2026-03-07T15:33:01.074Z","avatar_url":"https://github.com/raphplt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TCG Nexus Project\n\nCe README se trouve à la racine du **dépôt GitLab fourni par l’ETNA** et référence l’ensemble des ressources nécessaires pour accéder à votre projet.\n\n## 🔗 Liens de référence\n\n- **Dépôt de développement (GitHub)** : [https://github.com/raphplt/tcg-nexus](https://github.com/raphplt/tcg-nexus)\n- **Dépôt de rendu (GitLab ETNA)** : [https://rendu-git.etna-alternance.net/module-10020/activity-53631/group-1056981](https://rendu-git.etna-alternance.net/module-10020/activity-53631/group-1056981)\n- **Story Map Figma** : [[https://www.figma.com/design/xJi3bYfxhX4HsBdPtxrw2r/Story-Map?node-id=0-1](https://www.figma.com/design/xJi3bYfxhX4HsBdPtxrw2r/Story-Map?node-id=0-1)](https://www.figma.com/design/xJi3bYfxhX4HsBdPtxrw2r/Story-Map?node-id=0-1\u0026p=f\u0026t=TNtJuYX659gcvBoe-0)\n- **Wireframe Figma** : https://www.figma.com/design/ur8IpT8VxUjc3V7MFkvvTP/Wireframe?t=TNtJuYX659gcvBoe-0\n- **Board Github Project** : https://github.com/users/raphplt/projects/3\n- **Mirroring CI/CD** : GitHub Actions reproduit automatiquement ce repo sur GitLab\n\n## 📂 Structure du projet\n\n- `apps/web` : Front-end Next.js\n- `apps/api` : Back-end NestJS\n- `apps/fetch` : Microservice Express (fetch)\n- `apps/doc` : Documentation technique\n- `docs/` : Documentation supplémentaire (architecture, références, tests)\n\n## 📁 Structure de rendu ETNA\n\n- `/fiche_projet/` : **Fiche projet** (PDF) – contexte, objectifs, organisation, choix technos, story map\n- `/suivi_de_progression/` : **Documents de suivi** – bilan \u0026 plan d’action (tous les 2 RUNs), fichiers datés\n- `/apps`, `/docs` : Code source \u0026 documentation du POC\n\n## 📝 Fiche Projet\n\n\u003e Chemin : `/fiche_projet/fiche_projet.pdf`\n\nContient :\n\n- Contexte du projet et problématiques\n- Objectifs et solutions proposées\n- Organisation de l’équipe et rôles\n- Choix méthodologiques (Scrum, sprints) et technos\n- Story map et backlog priorisé\n\n## 📊 Suivi de Progression\n\nDans `/suivi_de_progression/`, chaque fichier `suivi_RUN\u003cN\u003e_\u003cYYYY-MM-DD\u003e.md` comprend :\n\n- Bilan des objectifs du RUN précédent (US réalisées, en cours, bloquées)\n- Problèmes rencontrés\n- Captures d’écran ou démos\n- Plan d’action pour le RUN suivant\n\n## ✅ Documentation Technique \u0026 POC\n\nLe POC doit démontrer :\n\n- Valeur d’usage partielle et faisabilité technique\n- Respect des contraintes (performance, sécurité, stockage)\n\n### Dossier `apps/doc` ou `docs/`\n\n- `architecture.md` : schéma et explications de l’architecture\n- `references.md` : liste des API et bibliothèques utilisées\n- Tests : répertoire contenant tests unitaires et fonctionnels\n- Commentaires in-code pertinents pour chaque module critique\n\n## 🚀 Installation \u0026 Développement\n\n### Prérequis\n\n- Node.js ≥ 18\n- npm ou yarn\n- MySQL\n- Turborepo\n\n### Installation\n\n```bash\ngit clone https://github.com/raphplt/tcg-nexus.git\ncd tcg-nexus\nnpm install\n```\n\n### Seed de la base\n\n```bash\nnpm run seed\n```\n\n### En mode développement\n\n```bash\nturbo dev\n# ou\nnpm run dev\n```\n\n### Build\n\n```bash\nturbo build\n```\n\n### Tests unitaires\n\n```bash\nturbo test\n```\n\n### Déploiement\n\nExemple avec Docker :\n\n```bash\ndocker-compose up --build\n```\n\n---\n\n## 🖥️ Déploiement VM Debian (API + Postgres + CI/CD)\n\nCette section décrit **toutes les étapes** pour héberger `apps/api` et une BDD PostgreSQL sur une VM Debian, avec un déploiement automatique et migrations.\n\n**Objectif** :\n\n- API NestJS (`apps/api`)\n- PostgreSQL persistant\n- CI/CD automatique (build + deploy + migrations)\n\n## 1) Accès VM + SSH\n\n1. Créer la VM (Debian 12 recommandé).\n2. Se connecter via le shell web (si SSH direct impossible).\n3. Ajouter la clé publique dans `~/.ssh/authorized_keys` (droits 700/600).\n\nVérification :\n\n```bash\nssh -i ~/.ssh/id_ed25519 \u003cuser\u003e@\u003cip\u003e\n```\n\nSi l’IP est en `172.16.x.x`, elle est privée : utilisez le **VPN/bastion** de l’école ou l’IP publique si disponible.\n\n---\n\n## 2) Sécurisation minimale\n\n```bash\nsudo apt update \u0026\u0026 sudo apt upgrade -y\nsudo apt install -y ufw\nsudo ufw allow OpenSSH\nsudo ufw allow 80\nsudo ufw allow 443\nsudo ufw enable\n```\n\nOptionnel (recommandé) : créer un utilisateur non-root et désactiver l’auth par mot de passe dans `/etc/ssh/sshd_config`.\n\n---\n\n## 3) Installer Docker + Compose\n\n```bash\nsudo apt install -y ca-certificates curl gnupg\nsudo install -m 0755 -d /etc/apt/keyrings\ncurl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg\necho \\\n  \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \\\n  $(. /etc/os-release \u0026\u0026 echo $VERSION_CODENAME) stable\" | \\\n  sudo tee /etc/apt/sources.list.d/docker.list \u003e /dev/null\n\nsudo apt update\nsudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin\nsudo usermod -aG docker $USER\nnewgrp docker\n```\n\n---\n\n## 4) Préparer le dossier de déploiement\n\nSur la VM :\n\n```bash\nmkdir -p /srv/tcg-nexus\ncd /srv/tcg-nexus\n```\n\nCréer un fichier `.env` (exemple) :\n\n```env\nPOSTGRES_DB=tcg\nPOSTGRES_USER=tcg\nPOSTGRES_PASSWORD=change_me\nDATABASE_URL=postgresql://tcg:change_me@db:5432/tcg\nNODE_ENV=production\n```\n\n---\n\n## 5) Docker Compose (API + Postgres)\n\nCréer `/srv/tcg-nexus/docker-compose.yml` :\n\n```yaml\nservices:\n  db:\n    image: postgres:16\n    restart: always\n    environment:\n      POSTGRES_DB: ${POSTGRES_DB}\n      POSTGRES_USER: ${POSTGRES_USER}\n      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}\n    volumes:\n      - db_data:/var/lib/postgresql/data\n    ports:\n      - \"5432:5432\"\n\n  api:\n    image: ghcr.io/\u003corg\u003e/\u003crepo\u003e-api:latest\n    restart: always\n    env_file: .env\n    depends_on:\n      - db\n    ports:\n      - \"3000:3000\"\n\nvolumes:\n  db_data:\n```\n\nRemplace `\u003corg\u003e/\u003crepo\u003e` par ton registry (GitHub Container Registry, GitLab Registry, etc.).\n\n---\n\n## 6) Migrations automatiques\n\n### — TypeORM\n\n```bash\nnpm run migration:run\n```\n\n---\n\n## 7) CI/CD (build + push + deploy + migrations)\n\nTu dois :\n\n1. Build l’image Docker de `apps/api`.\n2. Push dans un registry.\n3. SSH sur la VM.\n4. `docker compose pull` + `docker compose up -d`.\n5. Lancer les migrations.\n\n### Exemple (GitHub Actions)\n\nCréer [.github/workflows/deploy.yml](.github/workflows/deploy.yml) :\n\n```yaml\nname: Deploy API\non:\n\n  push:\n    branches: [\"main\"]\n\njobs:\n  build-and-deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Login GHCR\n        run: echo \"${{ secrets.GHCR_TOKEN }}\" | docker login ghcr.io -u ${{ github.actor }} --password-stdin\n\n      - name: Build \u0026 Push API\n        run: |\n          docker build -t ghcr.io/\u003corg\u003e/\u003crepo\u003e-api:latest -f apps/api/Dockerfile .\n          docker push ghcr.io/\u003corg\u003e/\u003crepo\u003e-api:latest\n\n      - name: Deploy on VM\n        uses: appleboy/ssh-action@v1.0.3\n        with:\n          host: ${{ secrets.VM_HOST }}\n          username: ${{ secrets.VM_USER }}\n          key: ${{ secrets.VM_SSH_KEY }}\n          script: |\n            cd /srv/tcg-nexus\n            docker compose pull\n            docker compose up -d\n            docker compose exec -T api npx prisma migrate deploy\n```\n\nSecrets requis :\n\n- `VM_HOST`, `VM_USER`, `VM_SSH_KEY`\n- `GHCR_TOKEN`\n\n### Exemple (GitLab CI)\n\nCréer [.gitlab-ci.yml](.gitlab-ci.yml) :\n\n```yaml\nstages: [build, deploy]\n\nbuild:\n  stage: build\n  image: docker:24\n  services: [docker:24-dind]\n  script:\n    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY\n    - docker build -t $CI_REGISTRY_IMAGE/api:latest -f apps/api/Dockerfile .\n    - docker push $CI_REGISTRY_IMAGE/api:latest\n\ndeploy:\n  stage: deploy\n  image: alpine:3.20\n  before_script:\n    - apk add --no-cache openssh-client\n    - eval $(ssh-agent -s)\n    - echo \"$SSH_PRIVATE_KEY\" | tr -d '\\r' | ssh-add -\n  script:\n    - ssh -o StrictHostKeyChecking=no $VM_USER@$VM_HOST \"cd /srv/tcg-nexus \u0026\u0026 docker compose pull \u0026\u0026 docker compose up -d \u0026\u0026 docker compose exec -T api npx prisma migrate deploy\"\n```\n\nVariables requises :\n\n- `VM_HOST`, `VM_USER`, `SSH_PRIVATE_KEY`\n\n---\n\n## 8) (Optionnel) Reverse proxy HTTPS\n\nInstaller Nginx + certbot (Let’s Encrypt) pour exposer l’API en HTTPS.\n\n---\n\n## 9) Vérifications post‑déploiement\n\n```bash\ndocker ps\ndocker compose logs -f api\ncurl http://\u003cip\u003e:3000/health\n```\n\n---\n\n## 10) Récapitulatif ordre d’exécution\n\n1. Accès SSH VM\n2. Sécurisation + firewall\n3. Docker/Compose\n4. Dossier `/srv/tcg-nexus` + `.env`\n5. `docker-compose.yml`\n6. Registry + build/push\n7. CI/CD deploy\n8. Migrations\n9. Vérif santé\n\n## ⚙️ Microservice de fetch\n\nAccessible à : `http://localhost:3005/tcgdex`\n\n## 📜 Licence\n\nCe projet est sous licence **MIT**. Voir le fichier [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphplt%2Ftcg-nexus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphplt%2Ftcg-nexus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphplt%2Ftcg-nexus/lists"}