Skip to content

seifhassan89/InventoryManagementWebApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock Management Web API

This repository contains a web API built using .NET Core, Entity Framework, MySQL database and Swagger to manage stock items, supplies, transfers and withdraw requests. The API has the following entities:

  1. Stock: Represents a collection of items and their associated quantities.
  2. Item: Represents a specific item in the stock, including its name, description, and measuring unit.
  3. Request: Represents a request to either supply, transfer, or withdraw items from the stock.
  4. User: Represents a user account with a unique username, email, and associated role.
  5. Role: Represents a role assigned to a user, such as manager, or employee.
  6. Request Type: Represents the type of request being made, such as supply, transfer, or withdraw.
  7. Measuring Unit: Represents the unit of measure for an item, such as pounds, ounces, or kilograms.

The API allows users to manage stocks, items, and requests with different levels of access control. The API can be accessed through Swagger UI to interact with the API using a user-friendly interface.

Technologies Used

  • .NET Core 5.0
  • Entity Framework
  • MySQL database
  • Swagger

Getting Started

To get started with this project, follow these steps:

Installing

  1. Clone the repository to your local machine.
git clone https://github.com/seifhassan89/Stock-Management
  1. Navigate to the project directory.
cd stock-management
  1. Restore the project dependencies.
dotnet restore

Database Connection

To connect to your MySQL database, you need to update the connection string in the appsettings.json file with your own database information.

  • Here is an example of the connection string format:
"ConnectionStrings": {
    "DefaultConnection": "server=<server_name>;port=<port_number>;database=<database_name>;user=<user_name>;password=<password>"
}

Replace localhost with the name of your MySQL server, and database_name with the name of your database.

  • Run the following command to create the database schema:
dotnet ef database update

Run the application

  • Here is command to run your application:
dotnet run

Usage

The API endpoints can be tested using a tool such as Postman. The following endpoints are available:

image image image image image image image

Contributing

Contributions are welcome! If you'd like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new feature branch.
  3. Make your changes.
  4. Create a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.