{"id":21626134,"url":"https://github.com/andrenormanlang/inventory-management-api-csharp","last_synced_at":"2025-03-18T20:21:53.979Z","repository":{"id":255736089,"uuid":"853320568","full_name":"andrenormanlang/inventory-management-api-csharp","owner":"andrenormanlang","description":"A RESTful API for managing inventory data built with ASP.NET Core. This project supports basic CRUD operations for products, categories, and suppliers within an inventory system. The API is designed to integrate easily with front-end applications and provides detailed documentation for all endpoints.","archived":false,"fork":false,"pushed_at":"2024-10-03T11:20:20.000Z","size":923,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T22:42:02.496Z","etag":null,"topics":["asp-net-core","crud-api","csharp"],"latest_commit_sha":null,"homepage":"https://inventory-management-api-csharp.onrender.com/api/product","language":"C#","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/andrenormanlang.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":"2024-09-06T12:28:20.000Z","updated_at":"2024-10-03T11:54:25.000Z","dependencies_parsed_at":"2024-11-25T01:12:20.817Z","dependency_job_id":null,"html_url":"https://github.com/andrenormanlang/inventory-management-api-csharp","commit_stats":null,"previous_names":["andrenormanlang/inventory-management-api-csharp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrenormanlang%2Finventory-management-api-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrenormanlang%2Finventory-management-api-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrenormanlang%2Finventory-management-api-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrenormanlang%2Finventory-management-api-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrenormanlang","download_url":"https://codeload.github.com/andrenormanlang/inventory-management-api-csharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244297871,"owners_count":20430347,"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":["asp-net-core","crud-api","csharp"],"created_at":"2024-11-25T01:12:16.320Z","updated_at":"2025-03-18T20:21:53.957Z","avatar_url":"https://github.com/andrenormanlang.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📦 C# Inventory Management System API\n\n## 📄 Overview\nThis repository contains the source code for a C# inventory management system API. The API is built using ASP.NET Core and provides RESTful services for managing inventory data including products, categories, and suppliers.\n\n## ✨ Features\n- CRUD operations for product management.\n- Category management to organize products.\n- Supplier interaction to manage product suppliers.\n- Detailed API documentation.\n\n## 🛠 Technologies\n- ASP.NET Core 5\n- Entity Framework Core\n- MySQL\n\n## 🚀 Getting Started\n\n### 📋 Prerequisites\n- .NET 5 SDK\n- Visual Studio 2022\n- MySQL Server\n\n### Installation\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/andrenormlang/inventory-management-api-csharp.git  \n   git clone https://github.com/andrenormlang/inventory-management-api-csharp.git\n   ```\n   \n2. Open the solution in Visual Studio 2022.\n\n3. Restore the necessary packages. Visual Studio should prompt you to restore packages once the project is opened. Alternatively, you can restore packages by right-clicking on the solution in Solution Explorer and selecting Restore NuGet Packages.\n\n4. Set up the database URL as an environment variable:\n\nWindows:\nOpen Command Prompt or PowerShell and run:\n\n   ```powershell\n   setx DATABASE_URL \"server=localhost;port=3307;database=inventory_management;user=root;password=root\"\n   ```\nmacOS / Linux:\nAdd the following to your .bashrc, .zshrc, or .bash_profile\n\n```bash\n   export DATABASE_URL=\"server=localhost;port=3307;database=inventory_management;user=root;password=root\"\n```\n   \n5. Update the database by opening the Package Manager Console (Tools -\u003e NuGet Package Manager -\u003e Package Manager Console) and running:\n\n```powershell\n   Update-Database\n```\n\n6. 🪄Start the application by pressing F5 or clicking on the green Start button.\n\n### 📚 API Documentation\n\nOnce the application is running, you can access the API documentation by navigating to the following URL:\n\n```bash\nhttp://localhost:{port}/swagger\n```\n\nThis will provide interactive API documentation where you can test out the endpoints directly.\n\n### 💡 Posting in Bulk\n\nTo post multiple categories, products, or suppliers at once, you can use the **bulk post** endpoints.\n\n1. **Bulk Post Categories:**\n   Send a `POST` request to `/api/categories/bulk` with a JSON array containing multiple categories.\n\n   **Example Request:**\n\n   ```json\n   [\n     {\n       \"name\": \"Electronics\"\n     },\n     {\n       \"name\": \"Home Appliances\"\n     }\n   ]\n   ```\n\n2. **Bulk Post Suppliers:**\n   Send a `POST` request to `/api/suppliers/bulk` with a JSON array of suppliers.\n\n   **Example Request:**\n\n   ```json\n   [\n     {\n       \"name\": \"Best Supplier\",\n       \"address\": \"1234 Market St\",\n       \"phone\": \"555-555-5555\"\n     },\n     {\n       \"name\": \"Great Supplier\",\n       \"address\": \"5678 Main St\",\n       \"phone\": \"555-555-5556\"\n     }\n   ]\n   ```\n\n3. **Bulk Post Products:**\n   Send a `POST` request to `/api/products/bulk` with a JSON array of products.\n\n   **Example Request:**\n\n   ```json\n   [\n     {\n       \"name\": \"Laptop\",\n       \"price\": 999.99,\n       \"quantity\": 10,\n       \"categoryId\": 1,\n       \"supplierId\": 2\n     },\n     {\n       \"name\": \"Smartphone\",\n       \"price\": 699.99,\n       \"quantity\": 15,\n       \"categoryId\": 1,\n       \"supplierId\": 1\n     }\n   ]\n   ```\n\n### ⚙️ Environment Variables\n\nYou should avoid storing sensitive information, such as database credentials, directly in the `appsettings.json`. Instead, store these values as **environment variables**.\n\n#### Example for setting up the environment variable:\n\n```bash\nDATABASE_URL=\"server=localhost;port=3307;database=inventory_management;user=root;password=root\"\n```\n\nIn the `appsettings.json` or `appsettings.Development.json`, you can reference it like so:\n\n```json\n{\n  \"ConnectionStrings\": {\n    \"DefaultConnection\": \"${DATABASE_URL}\"\n  }\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrenormanlang%2Finventory-management-api-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrenormanlang%2Finventory-management-api-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrenormanlang%2Finventory-management-api-csharp/lists"}