{"id":28157128,"url":"https://github.com/valentinmadiot/crud-test-2","last_synced_at":"2026-04-11T04:33:44.325Z","repository":{"id":211072711,"uuid":"522648287","full_name":"ValentinMadiot/CRUD-test-2","owner":"ValentinMadiot","description":"API RESTful utilisant Node.js et Express, incluant l'authentification, la gestion de données via MongoDB et les opérations CRUD. Sécurisée et validée pour un traitement fiable des informations.","archived":false,"fork":false,"pushed_at":"2025-06-23T19:28:12.000Z","size":861,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T13:53:39.984Z","etag":null,"topics":["api-testing","auth-middleware","bcrypt","cors","crud-operations","crypto-js","dotenv","error-handling","express","file-upload","helmet","http-methods","jsonwebtoken","mongodb","mongoose","multer","nodejs","openclassrooms","rest-api","secure-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ValentinMadiot.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}},"created_at":"2022-08-08T17:38:52.000Z","updated_at":"2025-06-23T19:28:15.000Z","dependencies_parsed_at":"2023-12-06T11:11:46.967Z","dependency_job_id":"29a7f4c9-4040-4166-8458-d58e64a69fbc","html_url":"https://github.com/ValentinMadiot/CRUD-test-2","commit_stats":null,"previous_names":["valentinmadiot/go-fullstack","valentinmadiot/crud-test-2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ValentinMadiot/CRUD-test-2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinMadiot%2FCRUD-test-2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinMadiot%2FCRUD-test-2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinMadiot%2FCRUD-test-2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinMadiot%2FCRUD-test-2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ValentinMadiot","download_url":"https://codeload.github.com/ValentinMadiot/CRUD-test-2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValentinMadiot%2FCRUD-test-2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31669116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api-testing","auth-middleware","bcrypt","cors","crud-operations","crypto-js","dotenv","error-handling","express","file-upload","helmet","http-methods","jsonwebtoken","mongodb","mongoose","multer","nodejs","openclassrooms","rest-api","secure-api"],"created_at":"2025-05-15T08:16:20.070Z","updated_at":"2026-04-11T04:33:44.317Z","avatar_url":"https://github.com/ValentinMadiot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr /\u003e \n\u003ch3 align=\"center\"\u003e🛒 CRUD Test 2 \u0026nbsp; – \u0026nbsp; Projet Scolaire\u003c/h3\u003e\n\n## \u003cbr /\u003e 📌 Sommaire\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp; 🎨 \u0026nbsp; [**Introduction**](#introduction)\u003cbr /\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp; ⚙️ \u0026nbsp; [**Technologies**](#technologies)\u003cbr /\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp; 🎯 \u0026nbsp; [**Fonctionnalités**](#fonctionnalités)\u003cbr /\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp; 🧱 \u0026nbsp; [**Schéma \u0026 Routes**](#schéma)\u003cbr /\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp; 🚀 \u0026nbsp; [**Installation**](#installation)\u003cbr /\u003e\n\n## \u003cbr /\u003e \u003ca name=\"introduction\"\u003e🎨 Introduction\u003c/a\u003e\n\nCe projet est un exercice scolaire réalisé dans le cadre d'un parcours chez **OpenClassrooms**.\n\nIl consiste à construire une API RESTful avec **Node.js**, **Express** et **MongoDB** pour gérer un catalogue de produits.\n\nL'API inclut une authentification sécurisée (**JWT**), une intégration complète à **MongoDB**, et des opérations **CRUD** (Create, Read, Update, Delete).\n\n## \u003cbr /\u003e \u003ca name=\"technologies\"\u003e⚙️ Technologies\u003c/a\u003e\n\n- **Backend** : Node.js, Express\n- **Base de données** : MongoDB (Mongoose)\n- **Sécurité** : Bcrypt, Crypto-js, Helmet, Jsonwebtoken\n- **Gestion des fichiers** : Multer\n- **Validation de schéma** : Mongoose-unique-validator\n- **Environnement** : Dotenv\n- **Langage** : JavaScript\n\n## \u003cbr /\u003e \u003ca name=\"fonctionnalités\"\u003e🎯 Fonctionnalités\u003c/a\u003e\n\n- CRUD complet sur produits\n- Authentification sécurisée avec JWT\n- Upload d’images via Multer\n- Sécurisation des headers avec Helmet\n- Gestion centralisée des erreurs\n\n## \u003cbr /\u003e \u003ca name=\"schéma\"\u003e🧱 Schéma \u0026 Routes\u003c/a\u003e\n\n### 🔧 Schéma Mongoose attendu\n\n```js\nmongoose.Schema({\n  name: { type: String, required: true },\n  description: { type: String, required: true },\n  price: { type: Number, required: true },\n  inStock: { type: Boolean, required: true },\n});\n```\n\n### 🔌 Endpoints requis\n\n- **GET** `/api/products`  \n  Retourne tous les produits sous la forme :\n\n  ```json\n  { \"products\": [ ... ] }\n  ```\n\n- **GET** `/api/products/:id`  \n  Retourne le produit correspondant à l’ID :\n\n  ```json\n  { \"product\": { ... } }\n  ```\n\n- **POST** `/api/products`  \n  Corps de requête attendu :\n\n  ```json\n  {\n    \"name\": \"Nom\",\n    \"description\": \"Description\",\n    \"price\": 99.99,\n    \"inStock\": true\n  }\n  ```\n\n  Retourne le produit nouvellement créé (avec `_id`) :\n\n  ```json\n  { \"product\": { ... } }\n  ```\n\n- **PUT** `/api/products/:id`  \n  Met à jour un produit existant.  \n  Corps attendu :\n\n  ```json\n  {\n    \"name\": \"Nom\",\n    \"description\": \"Description modifiée\",\n    \"price\": 120.0,\n    \"inStock\": false\n  }\n  ```\n\n  Réponse :\n\n  ```json\n  { \"message\": \"Modified!\" }\n  ```\n\n- **DELETE** `/api/products/:id`  \n  Supprime le produit correspondant à l’ID.  \n  Réponse :\n  ```json\n  { \"message\": \"Deleted!\" }\n  ```\n\n## \u003cbr /\u003e \u003ca name=\"installation\"\u003e🚀 Installation\u003c/a\u003e\n\n### ✅ Prérequis\n\n- [Git](https://git-scm.com/) \u0026nbsp;—\u0026nbsp; Système de gestion de versions\n- [Node.js](https://nodejs.org/fr) \u0026nbsp;—\u0026nbsp; Exécuteur local de scripts JavaScript\n- [npm](https://www.npmjs.com/) \u0026nbsp;—\u0026nbsp; Gestionnaire de paquets JavaScript\n- [MongoDB](https://www.mongodb.com/) — Base de données NoSQL\n- [Google Chrome](https://www.google.com/) \u0026nbsp;—\u0026nbsp; Navigateur moderne\n- [Visual Studio Code](https://code.visualstudio.com/) \u0026nbsp;—\u0026nbsp; Éditeur de code\n\n### 📥 Cloner le projet\n\n```bash\ngit clone https://github.com/ValentinMadiot/CRUD-Test-2\ncd CRUD-Test-2\n```\n\n### 🔧 Configuration de l'environnement\n\nRenommer `.env.exemple` en `.env`\n\nAjoutez les variables d’environnement dans le fichier `.env` :\n\n```bash\n# IDENTIFIANT BASE DE DONNEES (MongoDB)\nMONGODB_URI=mongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@cluster0.mongodb.net/myDatabase?retryWrites=true\u0026w=majority\n\n# PASSWORD JWT (JSON Web Token)\nJWT_KEY=mon_secret_token\n```\n\n### ▶️ Lancer le projet\n\n### Backend\n\n```bash\ncd backend\nnpm install\nnpm start\n```\n\nBackend disponible sur : `http://localhost:8080`\n\n### Frontend\n\n```bash\ncd frontend\nnpm install\nnpm start\n```\n\nFrontend disponible sur : `http://localhost:8081`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalentinmadiot%2Fcrud-test-2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalentinmadiot%2Fcrud-test-2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalentinmadiot%2Fcrud-test-2/lists"}