A comprehensive, production-ready order management system built with ASP.NET Core, featuring inventory tracking, user authentication, performance optimization, and state management.
- Inventory Management: Full CRUD operations for inventory items
- Order Management: Complete order lifecycle with item tracking
- User Authentication: JWT-based authentication with role-based authorization
- Performance Optimization: In-memory caching with intelligent invalidation
- State Management: Persistent state with session tracking
- Real-time Monitoring: Performance metrics and system health monitoring
- JWT Authentication: Secure token-based authentication
- Role-based Authorization: Admin, Manager, and Employee roles
- Password Policies: Complexity requirements and account lockout protection
- Input Validation: Comprehensive validation and sanitization
- Secure Error Handling: No information leakage in error responses
- Intelligent Caching: 30-second expiration with sliding window
- Query Optimization: AsNoTracking and eager loading
- Performance Monitoring: Real-time metrics and response time tracking
- Memory Management: Efficient memory usage with cache limits
- Response Headers: Cache status and timing information
- Framework: ASP.NET Core 9.0
- Database: SQLite with Entity Framework Core
- Authentication: ASP.NET Identity + JWT Bearer Tokens
- Caching: IMemoryCache with custom expiration policies
- Documentation: Swagger/OpenAPI 3.0
- Monitoring: Custom performance monitoring service
- Repository Pattern: Entity Framework DbContext
- Dependency Injection: Built-in DI container
- CQRS: Separate read/write operations with caching
- State Management: Session-based state persistence
- Observer Pattern: Performance metrics collection
POST /api/auth/register- User registrationPOST /api/auth/login- User login (returns JWT token)POST /api/auth/create-role- Create new role (Admin)POST /api/auth/assign-role- Assign role to user (Admin)
GET /api/inventory- Get all inventory itemsGET /api/inventory/{id}- Get specific inventory itemPOST /api/inventory- Create inventory item (Manager/Admin)PUT /api/inventory/{id}- Update inventory item (Manager/Admin)DELETE /api/inventory/{id}- Delete inventory item (Admin only)GET /api/inventory/performance-stats- Performance metrics (Admin)
GET /api/orders- Get all ordersGET /api/orders/{id}- Get specific orderGET /api/orders/{id}/summary- Get order summaryPOST /api/orders- Create order (Employee/Manager/Admin)PUT /api/orders/{id}- Update order (Manager/Admin)DELETE /api/orders/{id}- Delete order (Manager/Admin)POST /api/orders/{id}/items- Add item to orderDELETE /api/orders/{id}/items/{itemId}- Remove item from order
GET /api/system/health- System health checkGET /api/system/status- System status (Authenticated)GET /api/system/performance- Performance metrics (Admin)POST /api/system/cleanup- System cleanup (Admin)
GET /api/documentation- API documentationGET /api/documentation/architecture- System architecture
- Email:
admin@logitrack.com - Password:
Admin123! - Role: Admin
- Admin: Full system access including user management
- Manager: Inventory and order management (cannot delete inventory used in orders)
- Employee: Order creation and management, view-only inventory access
Include the JWT token in the Authorization header:
Authorization: Bearer {your-jwt-token}
- .NET 9.0 SDK
- Visual Studio Code or Visual Studio 2022
- Clone the repository
- Navigate to the project directory
- Restore packages:
dotnet restore
- Run database migrations:
dotnet ef database update
- Start the application:
dotnet run
- API:
https://localhost:7000 - Swagger UI:
https://localhost:7000/swagger - Health Check:
https://localhost:7000/api/system/health
Run the comprehensive workflow test:
.\test-workflow.ps1- Access Swagger UI at
/swagger - Use the "Authorize" button to set your JWT token
- Test all endpoints interactively
- Monitor response times via
X-Response-Timeheaders - Check cache performance via
X-Cacheheaders - View performance metrics at
/api/system/performance
- Duration: 30 seconds absolute, 15 seconds sliding
- Invalidation: Automatic on data modifications
- Headers:
X-Cache(HIT/MISS) andX-Response-Time
- AsNoTracking: Reduces memory usage by 30-50%
- Eager Loading: Prevents N+1 query problems
- Consistent Ordering: Predictable result ordering
- Real-time performance metrics
- Cache hit/miss ratios
- Response time tracking
- System health monitoring
- InventoryItem: Item management with location tracking
- Order: Order management with status tracking
- ApplicationUser: User management with Identity
- UserSession: Session tracking and management
- Orders have many-to-many relationship with InventoryItems
- Users can create multiple orders
- Sessions track user activity
ASPNETCORE_ENVIRONMENT: Development/ProductionJwtSettings__SecretKey: JWT signing keyJwtSettings__Issuer: JWT issuerJwtSettings__Audience: JWT audience
- Development: SQLite file (
logitrack.db) - Production: Configurable via connection strings
- Database connectivity
- Cache functionality
- System metrics
- Performance statistics
- Structured logging with different levels
- Performance monitoring
- Error tracking
- Security events
- JWT tokens with 24-hour expiration
- Secure password hashing
- Account lockout protection
- Role-based access control
- Endpoint-level security
- Business logic protection
- Input validation and sanitization
- SQL injection prevention
- XSS protection
- Secure error handling
- Use a production database (SQL Server, PostgreSQL)
- Configure proper JWT secrets
- Enable HTTPS in production
- Set up proper logging
- Configure monitoring and alerting
- Use a reverse proxy (nginx, IIS)
- Implement backup strategies
- Adjust cache expiration times
- Optimize database queries
- Configure connection pooling
- Monitor memory usage
- Set up performance alerts
The API includes comprehensive documentation available at:
/api/documentation- Complete API reference/api/documentation/architecture- System architecture/swagger- Interactive API testing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is part of a Coursera capstone project and is for educational purposes.
This LogiTrack Order Management System demonstrates:
- Modern Architecture: Clean, scalable design with separation of concerns
- Security Best Practices: Comprehensive authentication and authorization
- Performance Optimization: Intelligent caching and query optimization
- Production Readiness: Health checks, monitoring, and error handling
- Developer Experience: Comprehensive documentation and testing tools
The system is ready for production deployment and serves as a portfolio-quality example of modern .NET development practices.
Built with β€οΈ using ASP.NET Core 9.0