{"id":24802805,"url":"https://github.com/rushhaabhhh/imf-gadget-api","last_synced_at":"2025-03-25T05:36:53.588Z","repository":{"id":274340163,"uuid":"922094658","full_name":"Rushhaabhhh/IMF-Gadget-API","owner":"Rushhaabhhh","description":"Secure gadget management API for IMF, built with TypeScript, Node.js, Express.js PostgreSQL, and Redis. Features JWT authentication, CRUD operations, self-destruct functionality, and mission-ready gadget tracking 🚀","archived":false,"fork":false,"pushed_at":"2025-01-26T17:17:23.000Z","size":149,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T18:24:41.977Z","etag":null,"topics":["authentication","nodejs","postgresql","redis-cache"],"latest_commit_sha":null,"homepage":"https://imf-gadget-api-4e0j.onrender.com/gadgets","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/Rushhaabhhh.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}},"created_at":"2025-01-25T09:55:22.000Z","updated_at":"2025-01-26T17:17:26.000Z","dependencies_parsed_at":"2025-01-26T18:24:50.289Z","dependency_job_id":"b46a4d79-4984-4a8a-8079-45b5122ec36e","html_url":"https://github.com/Rushhaabhhh/IMF-Gadget-API","commit_stats":null,"previous_names":["rushhaabhhh/imf-gadget-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rushhaabhhh%2FIMF-Gadget-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rushhaabhhh%2FIMF-Gadget-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rushhaabhhh%2FIMF-Gadget-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rushhaabhhh%2FIMF-Gadget-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rushhaabhhh","download_url":"https://codeload.github.com/Rushhaabhhh/IMF-Gadget-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407759,"owners_count":20610232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["authentication","nodejs","postgresql","redis-cache"],"created_at":"2025-01-30T05:16:22.011Z","updated_at":"2025-03-25T05:36:53.565Z","avatar_url":"https://github.com/Rushhaabhhh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IMF Gadget API Documentation\n\n## 📖 Overview\n\nThe IMF Gadget API is a sophisticated, secure system designed for managing high-tech gadgets used by the Impossible Missions Force. This comprehensive API provides robust functionality for tracking, maintaining, and controlling mission-critical equipment with enterprise-grade security features.\n\n---\n\n## Links\n\nhttps://www.loom.com/share/fef202af89364bd1a0873eabe559829d\n\n### Postman Collection Link : https://imf-gadget-8462.postman.co/workspace/IMF-Gadget-Workspace~760fa289-d5bf-42f2-9ae8-411d0ae51f2a/request/34642197-6e5a106c-b6bb-4f0d-94db-bd6f2d7db815?action=share\u0026creator=34642197\u0026ctx=documentation\n\n---\n## 🚨 Important Authentication Note\n\n- Bearer tokens are REQUIRED for ALL API endpoints EXCEPT `GET All Gadgets` route to retrieve gadgets so always include the bearer token in your request headers.\n- To obtain a bearer token, send a **`POST gadget`** request to the authentication endpoint.\n- Bearer Token Generation : The token will be generated and must be included in the Authorization header for subsequent requests.\n- Watch the authentication video tutorial for detailed guidance and refer to the Postman collection for example request configurations\n  \n---\n\n## 🚀 Key Features\n\n### Gadget Management\n- Complete inventory tracking with dynamic mission success probability\n- Unique codename generation for each gadget\n- Comprehensive status tracking (Available, Deployed, Decommissioned)\n- Detailed gadget information management\n\n### Security Features\n- JWT-based authentication\n- Secure self-destruct sequence with confirmation protocols\n- Soft deletion mechanism to preserve historical records\n\n---\n\n## 💻 Technical Architecture\n\n### Technology Stack\n\n- Backend: Node.js with Express.js (TypeScript)\n- Database: PostgreSQL\n- ORM: Sequelize\n- Authentication: JSON Web Tokens (JWT)\n- Caching: Redis\n- Deployment: Render\n- Containerization: Docker\n\n### Project Structure\n```\nIMF-Gadget-API/\n│\n├── src/\n│   ├── libs/\n│   │   ├── database.ts       # Postgres database configuration\n│   │   ├── helper.ts         # Utility functions\n│   │   ├── middleware.ts     # Authentication middleware\n│   │   └── redis.ts          # Redis cache client\n│   │\n│   ├── gadgetController.ts   # Business logic\n│   ├── gadgetModels.ts       # Data models\n│   ├── gadgetRoutes.ts       # API route definitions\n│   └── index.ts              # Application entry point\n│\n├── Dockerfile                # Docker configuration\n└── docker-compose.yml        # Multi-container orchestration\n```\n\n---\n\n## 🌐 API Endpoints\n\n1. Get All Gadgets\n\n- Endpoint : **GET** `/gadgets`\n- Description : Retrieves all gadgets with randomly generated mission success probability\n- Response Example:\n    ```json\n    [\n        {\n        \"id\": \"fd5bad1d-ac65-4c57-9ade-6e6b3521de86\",\n        \"name\": \"Superhero\",\n        \"codename\": \"Operation Kraken\",\n        \"status\": \"Available\",\n        \"missionSuccessProbability\": 87,\n        \"decommissionedAt\": null,\n        \"createdAt\": \"2025-01-26T12:46:57.570Z\",\n        \"updatedAt\": \"2025-01-26T12:46:57.570Z\"\n        },\n    ]\n    ```\n\n2. Filter Gadgets by Status\n\n    - Endpoint : **GET** `/gadgets?status=Available`\n    - Description : Retrieves gadgets filtered by specific status\n    - Supported Statuses : Available, Deployed, Decommissioned\n\n3. Get Gadget by ID\n\n    - Endpoint : **GET** `/gadgets/:id`\n    - Description : Retrieves a single gadget by its unique identifier\n\n4. Create Gadget\n\n    - Endpoint : **POST** `/gadgets`\n    - Description: Adds a new gadget to inventory\n    - Request Payload:\n        ```json\n        {\n        \"name\": \"Advanced Tracking Device\"\n        }\n        ```\n    - Features :\n        - Automatically generates unique codename\n        - Assigns default \"Available\" status\n        - Generates random mission success probability\n\n\n5. Update Gadget\n\n    - Endpoint : **PATCH** `/gadgets/:id`\n    - Description : Modify existing gadget information\n    - Request Payload :\n        ```json\n        {\n        \"name\": \"Enhanced Tracking Device\",\n        \"status\": \"Deployed\"\n        }\n        ```\n\n6. Decommission Gadget\n\n    - Endpoint : **DELETE** `/gadgets/:id`\n    - Description : Marks gadget as \"Decommissioned\"\n    - Action :\n        - Sets status to Decommissioned\n        - Records decommission timestamp\n        - Prevents permanent data deletion\n\n7. Self-Destruct Sequence\n\n    - Endpoint : **POST** `/gadgets/:id/self-destruct`\n    - Description : Initiates gadget self-destruction protocol\n    - Response Example :\n\n        ```json\n        {\n        \"message\": \"Self-destruct sequence initiated.\",\n        \"confirmationCode\": \"ABCD1234\"\n        }\n        ```\n\n## 🔧 Local Development Setup\n\n### Prerequisites\n\n- Node.js (v14+)\n- PostgreSQL\n- Redis\n- Docker \u0026 Docker Compose\n\n### Installation Steps\n\n1. Clone the repository :\n```bash\ngit clone https://github.com/Rushhaabhhh/IMF-Gadget-API.git\ncd IMF-Gadget-API\n```\n\n2. Create the Environment File : Copy the contents of the .env.example file in .env for Environment Configuration\n```bash\ncp en.example .env\n```\n\n3. Start containers\n```bash\ndocker-compose up \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frushhaabhhh%2Fimf-gadget-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frushhaabhhh%2Fimf-gadget-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frushhaabhhh%2Fimf-gadget-api/lists"}