{"id":19946678,"url":"https://github.com/codeincrypt/inventory-nodejs","last_synced_at":"2026-06-09T03:07:47.559Z","repository":{"id":232640215,"uuid":"784810969","full_name":"codeincrypt/inventory-nodejs","owner":"codeincrypt","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-10T16:31:48.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T14:17:21.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/codeincrypt.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}},"created_at":"2024-04-10T15:50:42.000Z","updated_at":"2024-04-10T16:12:19.000Z","dependencies_parsed_at":"2024-04-10T20:06:58.231Z","dependency_job_id":"35b2f881-189a-479c-a168-ea3472251b20","html_url":"https://github.com/codeincrypt/inventory-nodejs","commit_stats":null,"previous_names":["codeincrypt/inventory-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codeincrypt/inventory-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeincrypt%2Finventory-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeincrypt%2Finventory-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeincrypt%2Finventory-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeincrypt%2Finventory-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeincrypt","download_url":"https://codeload.github.com/codeincrypt/inventory-nodejs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeincrypt%2Finventory-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286079811,"owners_count":27282121,"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","status":"online","status_checked_at":"2025-11-27T02:00:05.795Z","response_time":58,"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":[],"created_at":"2024-11-13T00:31:54.240Z","updated_at":"2025-11-27T05:08:33.416Z","avatar_url":"https://github.com/codeincrypt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Inventory Management API with Analytics\n\n## Controllers\n- **admin.controller.js**\nContains controller functions related to admin operations.\n- **analytics.controller.js**\nContains controller functions related to analytics.\n- **auth.controller.js**\nContains controller functions related to authentication.\n- **orders.controller.js**\nContains controller functions related to order operations.\n- **product.controller.js**\nContains controller functions related to product operations.\n- **user.controller.js**\nContains controller functions related to user operations.\n\n## Middleware\n### auth\n- **requireLogin.js** : Middleware for authentication and authorization of both admin and user routes.\n### validation\n- **productValidation.js** : Contains validation functions for products and orders.\n\n\n## Routes\n### admin.js\n- **/profile (GET)** : Requires user login. Retrieves the user profile for the currently logged-in admin.\n- **/user/:id/orders (GET)** : Requires authentication middleware. Retrieves orders associated with a specific user.\n- **/user/:id/orders/:orderid (GET)** : Requires authentication middleware. Retrieves details of a specific order placed by a user.\n- **/analytics/top-products (GET)** : Requires authentication middleware. Retrieves analytics data for top products.\n- **/analytics/top-users (GET)** : Requires authentication middleware. Retrieves analytics data for top users.\n\n### auth.js\n- **/signup (POST)** : Handles user signup requests.\n- **/login (POST)** : Handles user login requests.\n- **/admin-login (POST)** : Handles admin login requests.\n\n### product.js\n- **/getProduct (GET)** : Retrieves all products.\n- **/getProduct/:id (GET)** : Retrieves a product by ID.\n- **/insertProduct (POST)** : Inserts a new product.\n- **/search (POST)** : Searches for products based on name or description.\n\n### user.js\n- **/profile (GET)** : Requires authentication middleware. Retrieves the user profile.\n- **/order (GET)** : Requires authentication middleware. Retrieves orders associated with the current user.\n- **/order/:id (GET)** : Requires authentication middleware. Retrieves details of a specific order placed by the current user.\n- **/createOrder (POST)** : Requires authentication middleware. Creates a new order.\n\n## Services\n### adminServices.js\nThis module contains SQL queries related to the admin table.\n- **loginUser** : SQL query to authenticate admin users.\n- **getUsersByEmail** : SQL query to retrieve admin users by email.\n\n### productService.js\nThis module handles operations related to products.\n- **insertNewProduct** : Inserts a new product into the database.\n- **getProduct** : Retrieves product details.\n- **getProductById** : Retrieves product by ID.\n- **getProductCount** : Retrieves the total count of products.\n- **getSearchProduct** : Searches for products based on name or description.\n\n### userService.js\nThis module handles operations related to users.\n- **createNewUser** : Creates a new user account.\n- **loginUser** : Authenticates users.\n- **getUsersByEmail** : Retrieves users by email.\n\n### orderService\nThis module contains SQL queries related to the order table.\n- **checkQuantity** : SQL query to check product quantity availability.\n- **updateStockQuantity** : SQL query to update product stock quantity.\n- **createNewOrder** : SQL query to create a new order.\n- **getOrdersByUserId** : SQL query to retrieve orders by user ID.\n- getOrdersViewByUserId** : SQL query to retrieve order details by user ID.\n- **getUserOrderCount** : SQL query to count the number of orders placed by a user.\n- **userOrders** : SQL query to fetch user orders.\n- **getTopOrderedProduct** : SQL query to retrieve the top ordered products.\n- **getTopUserOrders** : SQL query to retrieve top user orders.\n\n## Utils\n### db.js\nThis module handles the MySQL database connection.\n### config.js\nThis module imports configuration variables from a .env file using dotenv.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeincrypt%2Finventory-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeincrypt%2Finventory-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeincrypt%2Finventory-nodejs/lists"}