Crates.io | open-stock |
lib.rs | open-stock |
version | 0.1.20 |
source | src |
created_at | 2023-04-09 01:02:07.5716 |
updated_at | 2024-02-22 01:11:40.535666 |
description | An Inventory Management Database Interface Layer for MySQL |
homepage | |
repository | |
max_upload_size | |
id | 833871 |
size | 779,796 |
The open source inventory manager.
With OpenStock
, you can manage:
In an API format.
For a visual interface, see
open-pos
.
OpenStock is a rust project utilizing rocket
and sea-orm
to batch and execute queries to a stored DB.
OpenStock is currently in Beta, so features may not yet be considered stable as many features are still considered experimental with the API formatting being largely subject to change. Thus, not ready for professional adoption as of yet.
OpenStock is available as a crate to be integrated in your project or project-space if you wish to utilize the type-system created by it. Accessible by:
cargo add open-stock
However, for a default setup, the API can be hosted yourself by performing the following:
docker-compose.yaml
(template file here).open-pos
, and adminer
.docker compose up
.It is recommended to add a database viewer such as adminer for development to monitor changes and trace any issues of object structure you may encounter.
Docker compose will come pre-installed with any install of Docker Desktop, but If you are on linux and do not have docker compose installed, you can install it from the guide here.
Please note:
open-pos
is not required, but is a free POS system provided with the open-stock
standard. You are free to use and/or modify it as necessary.
If you are launching the service from an ARM system, use ghcr.io/bennjii/open-stock:latest-arm
and ghcr.io/bennjii/open-pos:latest-arm
for native performance.
If using open-pos
, The NEXT_PUBLIC_API_URL
environment URL refers to where the open-stock
API is hosted. This is required for CORS, and is a required field. This can be a domain or IP.
It is important to consider how you wish to setup your provider. There are two methods of doing so shown below. A centralized approach will have a single server as a "source-of-truth", where each new retail location will interact with this one server. This is the most common approach and is the default implementation.
Alternatively, a fragmented approach can be undergone with replication layers existing at each store location or region to decrease server connection times due to large physical distances.
Please note, the fragmented approach has not been implemented yet but is planned for release in the future.
If you need to migrate data from an existing provider, you can do so using the migrator utility.
If you are using a provider not currently covered by the migration utility, you may request an implementation by publishing an issue with the tag, feature-request
and title +lang: <Existing Provider Name>
, and provide any associated information in the issue to help us implement the migration. Alternatively, you can implement the type conversions yourself and submit a pull request for it.
Rust was the perfect choice for this project as it aims to produce a reliable and consistent output whilst taking various forms of input. Rust offers this in combination with high performance, albeit slower development times. However, for this project the trade-off is more than worth it. As rust has recently become a far more matured language, database ORM's like sea-orm (based on SQLx) and Diesel are well build and provide a high degree of type-safety in formatting, reading, writing and relaying information from the database - preventing poorly formatted entries and invalid column values.