"In our app, we have inventory control, invoicing, sailors orders etc.. And I want to add bom
How does bom work?"
After having worked with a number of off-the-shelf Enterprise Resource Planning systems (ERP's), Manufacturing Resource Planning systems (MRP's) and having developed a few proprietary ones myself where BOM's were involved, the answer to the question is:
"HOW DO YOU WANT/NEED IT TO WORK?"
What Mike says above is certainly true, but beyond that it can be used as:
* An integral part of Inventory resource planning and purchasing.
* An integral part of Production operations which calls on Inventory to 'build' a finished part.
* A mere reference
* Other ways....
In general all Items are individually represented in your Inventory data table. However some of the items might be built/assembled from a combination of other items (generally referred to as sub-components).
Those combinations are what makes up the Bill Of Materials (BOM) for the other Inventory items. The 'build' or 'recipe' for each finished product which uses sub-components is typically stored in the BOM data table. Its records generally contain the top-level Inventory ItemNo, the Sub-component Inventory ItemNo, Quantity, and sometime a description and/or note regarding how to use.
Then when something such as Production or Inventory Planning needs to determine which individual Inventory parts (and how many of them) need to be combined to make some other part, it references the BOM.
Sometimes Production is provided with a 'build list' for an item which comes out of the BOM data table and sometimes also contains instructions (notes) on how to use the sub-components.
The BOM is also taken into account when a 'completed' item is assembled in that the BOM is used to decrement the Inventory counts for all of its BOM sub-component parts.
My advice would be to first define your wants and/or needs within your organization and then, like Mike suggests above, you might read up on the subject before beginning your development.
Good Luck,
JRB-Bldr