Inventory service acts as a medicine inventory management and dispensing unit that helps in distributing the medicine to the pateint as per the prescription. Exposes below set of features as REST APIs.
- Item tracking
- Purchase order management
- Inventory reports
- Create, read, update, and delete inventory items.
- Get inventory levels.
This microservice is built on Java, Spring boot framework and MySQL DB.
- JDK 1.8
- Wildfly 11
- MySQL
- Springboot V2
To install the inventory module, follow these steps:
- Clone the repository to your local machine.
- Install the dependencies
mvn clean install
- You can copy
common_example.propertiestocommon_local.propertiesand edit the file accordingly. The file is undersrc/main/environmentfolder. - Run the spring server with local configuration
mvn spring-boot:run -DENV_VAR=local
Open the application in your browser. The inventory module will be accessible at http://localhost:3000/inventory.
This project uses Git hooks to enforce consistent code quality and commit message standards. Even though this is a Java project, the hooks are powered by Node.js. Follow these steps to set up the hooks locally:
-
Install Node.js and npm
- Download and install from nodejs.org
- Verify installation with:
node --version npm --version
-
Install dependencies
- From the project root directory, run:
npm ci - This will install all required dependencies including Husky, Commitlint, and Commitizen.
- From the project root directory, run:
-
Verify hooks installation
- The hooks should be automatically installed by Husky.
- You can verify by checking if the
.huskydirectory contains executable hooks.
-
Set up Commitizen for guided commits:
- Once dependencies are installed, you can use Commitizen to ensure your commit messages follow the conventional format. Instead of using
git commit, use the following command:This command will guide you through a series of prompts to format your commit message according to the project's commit convention.npm run commit
- Once dependencies are installed, you can use Commitizen to ensure your commit messages follow the conventional format. Instead of using
This project follows a specific commit message format to ensure a clean and consistent commit history:
- Format:
type(scope): subject - Example:
feat(login): add remember me functionality
Types include:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code changes that neither fix bugs nor add featuresperf: Performance improvementstest: Adding or fixing testsbuild: Changes to build process or toolsci: Changes to CI configurationchore: Other changes (e.g., maintenance tasks, dependencies)
Commit messages will be automatically validated using Commitlint when you commit, ensuring that all commits follow the same convention.
Inventory module can be used to track items, create purchase orders, generate inventory reports, and scan barcodes. To access the inventory module, navigate to http://localhost:3000/inventory in your browser. You will be able to view all of the items in your inventory, create purchase orders and generate inventory reports.
All other features have been exposed as REST endpoints. Refer to the SWAGGER API specification for details.
If you encounter any issues, bugs, or have feature requests, please file them in the main AMRIT repository. Centralizing all feedback helps us streamline improvements and address concerns efficiently.
We'd love to have you join our community discussions and get real-time support!
Join our Discord server to connect with contributors, ask questions, and stay updated.