{"id":30284143,"url":"https://github.com/a-hemeda/order-management-system","last_synced_at":"2026-05-16T18:31:46.387Z","repository":{"id":306597816,"uuid":"1026708456","full_name":"A-Hemeda/Order-Management-System","owner":"A-Hemeda","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-26T12:54:03.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-16T18:41:29.119Z","etag":null,"topics":["api","csharp","dotnet","web"],"latest_commit_sha":null,"homepage":"","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/A-Hemeda.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":"2025-07-26T12:54:00.000Z","updated_at":"2025-08-03T16:43:16.000Z","dependencies_parsed_at":"2025-07-26T18:38:12.040Z","dependency_job_id":"0cb2512c-1ed7-4b15-bba4-3a6e09dff8e8","html_url":"https://github.com/A-Hemeda/Order-Management-System","commit_stats":null,"previous_names":["a-hemeda/order-management-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/A-Hemeda/Order-Management-System","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A-Hemeda%2FOrder-Management-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A-Hemeda%2FOrder-Management-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A-Hemeda%2FOrder-Management-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A-Hemeda%2FOrder-Management-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/A-Hemeda","download_url":"https://codeload.github.com/A-Hemeda/Order-Management-System/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A-Hemeda%2FOrder-Management-System/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33114164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","csharp","dotnet","web"],"created_at":"2025-08-16T18:38:30.664Z","updated_at":"2026-05-16T18:31:46.382Z","avatar_url":"https://github.com/A-Hemeda.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Order Management System API\n\nA comprehensive .NET 8 Web API for managing orders, products, customers, and users with JWT authentication and role-based authorization.\n\n## 🚀 Features\n\n- **JWT Authentication \u0026 Authorization** - Secure API with role-based access control\n- **RESTful API Design** - Clean, consistent API endpoints following REST principles\n- **DTO Pattern** - Separation of API contracts from domain models\n- **AutoMapper Integration** - Automatic mapping between DTOs and domain models\n- **Global Exception Handling** - Consistent error responses across the application\n- **Swagger Documentation** - Interactive API documentation with JWT support\n- **Validation** - Comprehensive input validation using data annotations\n- **Logging** - Structured logging for monitoring and debugging\n- **In-Memory Database** - Entity Framework Core with in-memory database for development\n\n## 🏗️ Architecture\n\n```\nOrderManagementSystem/\n├── Controllers/          # API endpoints\n├── DTOs/                # Data Transfer Objects\n├── Models/              # Domain entities\n├── Repositories/        # Data access layer\n├── Services/            # Business logic layer\n├── Extensions/          # Service collection extensions\n├── Middleware/          # Custom middleware\n└── Mapping/             # AutoMapper profiles\n```\n\n## 🛠️ Prerequisites\n\n- .NET 8.0 SDK\n- Visual Studio 2022, VS Code, or any .NET-compatible IDE\n\n## 📦 Installation \u0026 Setup\n\n1. **Clone the repository**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd OrderManagementSystem\n   ```\n\n2. **Restore dependencies**\n   ```bash\n   dotnet restore\n   ```\n\n3. **Run the application**\n   ```bash\n   dotnet run\n   ```\n\n4. **Access the API**\n   - API Base URL: `https://localhost:7148` or `http://localhost:5287`\n   - Swagger UI: `https://localhost:7148` (root URL)\n\n## 🔐 Authentication\n\nThe API uses JWT (JSON Web Tokens) for authentication. To access protected endpoints:\n\n1. **Register a user** (POST `/api/Users/register`)\n2. **Login** (POST `/api/Users/login`) to get a JWT token\n3. **Include the token** in the Authorization header: `Bearer \u003cyour-token\u003e`\n\n### User Roles\n- **Admin**: Full access to all endpoints\n- **Customer**: Limited access (can create orders, view own data)\n\n## 📚 API Endpoints\n\n### Authentication\n- `POST /api/Users/register` - Register a new user\n- `POST /api/Users/login` - Login and get JWT token\n\n### Products\n- `GET /api/Product` - Get all products\n- `GET /api/Product/{id}` - Get product by ID\n- `POST /api/Product` - Create new product (Admin only)\n- `PUT /api/Product/{id}` - Update product (Admin only)\n- `DELETE /api/Product/{id}` - Delete product (Admin only)\n\n### Customers\n- `POST /api/Customer` - Create new customer\n- `GET /api/Customer/{id}/orders` - Get customer orders\n\n### Orders\n- `GET /api/Order` - Get all orders (Admin only)\n- `GET /api/Order/{id}` - Get order by ID\n- `POST /api/Order` - Create new order (Customer only)\n- `PUT /api/Order/{id}/status` - Update order status (Admin only)\n\n### Invoices\n- `GET /api/Invoice` - Get all invoices (Admin only)\n- `GET /api/Invoice/{id}` - Get invoice by ID (Admin only)\n\n## 🔧 Configuration\n\n### JWT Settings\nUpdate `appsettings.json` or use environment variables:\n\n```json\n{\n  \"Jwt\": {\n    \"Key\": \"YourSecretKeyHere\",\n    \"Issuer\": \"OrderSystemAPI\",\n    \"Audience\": \"OrderSystemUsers\",\n    \"DurationInMinutes\": 60\n  }\n}\n```\n\n### Environment Variables\nFor production, use environment variables:\n```bash\nexport JWT__KEY=\"YourSecretKeyHere\"\nexport JWT__ISSUER=\"OrderSystemAPI\"\nexport JWT__AUDIENCE=\"OrderSystemUsers\"\nexport JWT__DURATIONINMINUTES=\"60\"\n```\n\n## 🧪 Testing\n\n### Using Swagger UI\n1. Navigate to the root URL in your browser\n2. Use the interactive Swagger interface to test endpoints\n3. Click \"Authorize\" to add your JWT token\n\n### Using HTTP Client\n```bash\n# Register a user\ncurl -X POST \"https://localhost:7148/api/Users/register\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\":\"admin\",\"password\":\"password123\",\"role\":\"Admin\"}'\n\n# Login\ncurl -X POST \"https://localhost:7148/api/Users/login\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\":\"admin\",\"password\":\"password123\"}'\n\n# Use the returned token\ncurl -X GET \"https://localhost:7148/api/Product\" \\\n  -H \"Authorization: Bearer \u003cyour-token\u003e\"\n```\n\n## 📝 Code Quality Features\n\n- **DTO Pattern**: Clean separation between API and domain models\n- **Validation**: Comprehensive input validation with meaningful error messages\n- **Logging**: Structured logging for monitoring and debugging\n- **Exception Handling**: Global exception handling with consistent error responses\n- **Documentation**: XML comments and Swagger documentation\n- **Security**: JWT authentication with role-based authorization\n\n## 🔄 Development Workflow\n\n1. **Add new features**:\n   - Create DTOs in the `DTOs/` folder\n   - Add validation attributes\n   - Update AutoMapper profiles in `Mapping/MappingProfile.cs`\n   - Implement business logic in services\n   - Create controller endpoints with proper documentation\n\n2. **Testing**:\n   - Use Swagger UI for manual testing\n   - Add unit tests for services and controllers\n   - Add integration tests for API endpoints\n\n## 🚀 Deployment\n\n### Local Development\n```bash\ndotnet run\n```\n\n### Production\n```bash\ndotnet publish -c Release\ndotnet OrderManagementSystem.dll\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License.\n\n## 🆘 Support\n\nFor support and questions, please open an issue in the repository. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-hemeda%2Forder-management-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-hemeda%2Forder-management-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-hemeda%2Forder-management-system/lists"}