The 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.
https://www.loom.com/share/fef202af89364bd1a0873eabe559829d
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&creator=34642197&ctx=documentation
- 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. - To obtain a bearer token, send a
POST gadget
request to the authentication endpoint. - Bearer Token Generation : The token will be generated and must be included in the Authorization header for subsequent requests.
- Watch the authentication video tutorial for detailed guidance and refer to the Postman collection for example request configurations
- Complete inventory tracking with dynamic mission success probability
- Unique codename generation for each gadget
- Comprehensive status tracking (Available, Deployed, Decommissioned)
- Detailed gadget information management
- JWT-based authentication
- Secure self-destruct sequence with confirmation protocols
- Soft deletion mechanism to preserve historical records
- Backend: Node.js with Express.js (TypeScript)
- Database: PostgreSQL
- ORM: Sequelize
- Authentication: JSON Web Tokens (JWT)
- Caching: Redis
- Deployment: Render
- Containerization: Docker
IMF-Gadget-API/
β
βββ src/
β βββ libs/
β β βββ database.ts # Postgres database configuration
β β βββ helper.ts # Utility functions
β β βββ middleware.ts # Authentication middleware
β β βββ redis.ts # Redis cache client
β β
β βββ gadgetController.ts # Business logic
β βββ gadgetModels.ts # Data models
β βββ gadgetRoutes.ts # API route definitions
β βββ index.ts # Application entry point
β
βββ Dockerfile # Docker configuration
βββ docker-compose.yml # Multi-container orchestration
- Get All Gadgets
- Endpoint : GET
/gadgets
- Description : Retrieves all gadgets with randomly generated mission success probability
- Response Example:
[ { "id": "fd5bad1d-ac65-4c57-9ade-6e6b3521de86", "name": "Superhero", "codename": "Operation Kraken", "status": "Available", "missionSuccessProbability": 87, "decommissionedAt": null, "createdAt": "2025-01-26T12:46:57.570Z", "updatedAt": "2025-01-26T12:46:57.570Z" }, ]
-
Filter Gadgets by Status
- Endpoint : GET
/gadgets?status=Available
- Description : Retrieves gadgets filtered by specific status
- Supported Statuses : Available, Deployed, Decommissioned
- Endpoint : GET
-
Get Gadget by ID
- Endpoint : GET
/gadgets/:id
- Description : Retrieves a single gadget by its unique identifier
- Endpoint : GET
-
Create Gadget
- Endpoint : POST
/gadgets
- Description: Adds a new gadget to inventory
- Request Payload:
{ "name": "Advanced Tracking Device" }
- Features :
- Automatically generates unique codename
- Assigns default "Available" status
- Generates random mission success probability
- Endpoint : POST
-
Update Gadget
- Endpoint : PATCH
/gadgets/:id
- Description : Modify existing gadget information
- Request Payload :
{ "name": "Enhanced Tracking Device", "status": "Deployed" }
- Endpoint : PATCH
-
Decommission Gadget
- Endpoint : DELETE
/gadgets/:id
- Description : Marks gadget as "Decommissioned"
- Action :
- Sets status to Decommissioned
- Records decommission timestamp
- Prevents permanent data deletion
- Endpoint : DELETE
-
Self-Destruct Sequence
-
Endpoint : POST
/gadgets/:id/self-destruct
-
Description : Initiates gadget self-destruction protocol
-
Response Example :
{ "message": "Self-destruct sequence initiated.", "confirmationCode": "ABCD1234" }
-
- Node.js (v14+)
- PostgreSQL
- Redis
- Docker & Docker Compose
- Clone the repository :
git clone https://github.com/Rushhaabhhh/IMF-Gadget-API.git
cd IMF-Gadget-API
- Create the Environment File : Copy the contents of the .env.example file in .env for Environment Configuration
cp en.example .env
- Start containers
docker-compose up