This project is an ASP.NET-based RESTful API designed to manage and track asset inventory from suppliers to warehouses, and from warehouses to stores. The API facilitates efficient tracking of assets, ensuring streamlined operations and better management of the supply chain.
- Asset Management: CRUD operations for assets.
- Supplier, Warehouse, and Store Management: CRUD operations for suppliers, warehouses, and stores.
- Tracking: Track assets from suppliers to warehouses and from warehouses to stores.
- Spatial Data Handling: Utilizes NetTopologySuite.Geometries for managing spatial data points in a spatial database (SDE).
- Authorization: Implemented using
AuthorizationHandler
andIAuthorizationRequirement
. - CORS Policy: Configured to support integration with a React frontend application.
- ASP.NET Core: For building the RESTful API.
- NetTopologySuite: For handling geometric data types.
- Entity Framework Core: For database access and management.
- Spatial Database (SDE): For managing spatial data.
- AutoMapper: For object mapping.
- n-Tier Architecture: Structured with Models, DTOs, Services, Context, Repository, and Presentation layers.
The API is structured using n-tier architecture, ensuring separation of concerns and facilitating maintainability and scalability:
- Models: Define the data structures.
- DTOs (Data Transfer Objects): Used for transferring data between layers.
- Services: Contain business logic.
- Context: Manages database connections.
- Repository: Handles data access logic.
- Presentation: API controllers and endpoints.
Below is the Entity Relationship Diagram (ERD) for the project, illustrating the relationships between different entities:
You can also view the diagram using the following link: Entity Relationship Diagram
-
Clone the repository:
git clone https://github.com/RadwaBahaa/Asset_Inventory_Backend.git cd Asset_Inventory_Backend
-
Setup the database:
- Ensure you have a spatial database (SDE) setup.
- Update the connection string in
appsettings.json
to point to your database.
-
Restore dependencies:
dotnet restore
-
Apply migrations:
dotnet ef database update
-
Run the application:
dotnet run
- GET /api/assets: Retrieve all assets.
- GET /api/assets/{id}: Retrieve a specific asset by ID.
- POST /api/assets: Create a new asset.
- PUT /api/assets/{id}: Update an existing asset.
- DELETE /api/assets/{id}: Delete an asset.
- GET /api/suppliers: Retrieve all suppliers.
- GET /api/suppliers/{id}: Retrieve a specific supplier by ID.
- POST /api/suppliers: Create a new supplier.
- PUT /api/suppliers/{id}: Update an existing supplier.
- DELETE /api/suppliers/{id}: Delete a supplier.
- GET /api/warehouses: Retrieve all warehouses.
- GET /api/warehouses/{id}: Retrieve a specific warehouse by ID.
- POST /api/warehouses: Create a new warehouse.
- PUT /api/warehouses/{id}: Update an existing warehouse.
- DELETE /api/warehouses/{id}: Delete a warehouse.
- GET /api/stores: Retrieve all stores.
- GET /api/stores/{id}: Retrieve a specific store by ID.
- POST /api/stores: Create a new store.
- PUT /api/stores/{id}: Update an existing store.
- DELETE /api/stores/{id}: Delete a store.
The API uses NetTopologySuite to manage spatial data for suppliers, warehouses, and stores. Each of these entities has a geographic location represented by points, enabling precise tracking and management.
This project is licensed under the MIT License.
For any questions or inquiries, please contact:
- Name: Radwa Bahaa El-Deen Abd El-Sabour
- Email: [email protected]
- LinkedIn: https://www.linkedin.com/in/radwabahaaeldeen