Skip to content

AliHasanov16/ApiApplicationWinForms

Repository files navigation

ERP-style system

📌 API-Based Inventory & Lot Tracking System (WinForms)

📖 Overview

This project is a Windows Forms desktop application that integrates with a custom REST API to manage inventory, lot tracking, and warehouse operations.

The system allows users to:

  • Authenticate via API (JWT / Bearer Token)
  • Query inventory, lots, variants, and warehouses
  • Track stock movements in real time
  • Perform warehouse entry transactions
  • Manage item-based filtering (lot, variant, warehouse, firm)
  • Display and process data in a dynamic UI (DataGridView)

It is designed as a real-time ERP-style client application that communicates with a backend API.


🏗️ Architecture

The project follows a layered architecture:

  • UI (WinForms) → User interface and interaction logic
  • BLL (Business Logic Layer) → Business rules and API coordination
  • DAL (Data Access Layer) → HTTP client and API communication
  • EL (Entity Layer) → Data models (Item, Lot, Warehouse, etc.)

🌐 Client-Server Architecture

The application acts as a desktop ERP client communicating with a REST API backend.

WinForms Client ↓ JWT Authentication ↓ REST API Requests ↓ Inventory / Lot / Warehouse Services ↓ Real-Time Data Processing


🔄 Core Workflow

  • User logs in → API returns JWT token
  • Token is stored and used for authorization
  • User selects:
    • Item
    • Warehouse
    • Variant (optional)
    • Lot code (optional)
  • Application sends request to API
  • API returns filtered stock/lots
  • Data is displayed in DataGridView
  • User can perform inventory operations (entry / transaction)

🚀 Features

  • 🔐 JWT-based authentication
  • 🌐 REST API integration using HttpClient
  • 📦 Real-time stock & lot tracking
  • 🏭 Warehouse (Ambar) management
  • 🔍 Dynamic filtering (item, lot, variant, firm)
  • 📊 Data visualization with DataGridView
  • ⚙️ Async / await API calls
  • 🧠 Context-based UI state management
  • 🧾 ERP-style transaction handling
  • 📡 Robust API error handling (401, 404, 500)

🛠️ Technologies Used

  • C#
  • Windows Forms
  • .NET Framework
  • HttpClient (REST API integration)
  • Newtonsoft.Json
  • Dapper (used in backend context)
  • LINQ
  • JSON communication

🔐 API Authentication

The system uses Bearer Token authentication:

  • Token is requested via login endpoint
  • Stored in application context (UIContextSide)
  • Automatically attached to every API request

📡 API Communication

All data is retrieved from a REST API:

  • /token → Authentication
  • /lotEntryTransactions → Stock & lot data
  • Warehouse, variant, and item filters are passed via query strings

💡 Key Learnings

  • Building real-time API-connected desktop applications
  • Managing authentication lifecycle in desktop apps
  • Structuring WinForms projects with layered architecture
  • Handling complex query-based filtering systems
  • Working with ERP-like inventory logic
  • Designing scalable API communication layers

📌 Notes

This project was developed as a real-world ERP simulation system.

It demonstrates how desktop applications can interact with modern APIs for:

  • Inventory tracking
  • Warehouse operations
  • Lot-based stock management

Future improvements:

  • Better UI/UX redesign (modern WinForms / WPF)
  • Logging system
  • Retry mechanism for API failures
  • Role-based access control

🔒 API Note

The API used in this project belongs to an internal/company-side ERP infrastructure.

For security and confidentiality reasons, API endpoints and backend source code are not included in this repository.


⚠️ API Error Handling

The application handles common API scenarios such as:

  • 401 Unauthorized
  • 404 Not Found
  • 500 Internal Server Error
  • Connection failures
  • Invalid responses

🔄 Why API-Based Architecture?

This project was designed to simulate modern enterprise systems where desktop applications communicate with centralized backend services via REST APIs.

The goal was to separate:

  • UI layer
  • Business logic
  • Data services
  • Authentication

🧠 Developer Insight

This project focuses heavily on real business logic:

  • Stock filtering
  • Lot-based inventory deduction
  • Variant handling
  • Multi-warehouse transfers

It simulates an enterprise-level logistics system.

About

API-based Windows Forms inventory and lot tracking system with JWT authentication, layered architecture, and real-time ERP-style data processing. The application communicates with a REST API to manage stock, warehouse operations, and lot-based transactions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages