Git Product home page Git Product logo

openboxes-mobile's Introduction

Documentation Status dbdocs docker image Financial Contributors on Open Collective PRs Welcome Join the chat at https://gitter.im/openboxes/openboxes

OpenBoxes

About

OpenBoxes is an Open Source Inventory and Supply Chain Management System. The initial implementation of OpenBoxes will occur at Partners In Health-supported facilities in Haiti.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License

Copyright (c) 2012 Partners In Health. All rights reserved. The use and distribution terms for this software are covered by the Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.

Deployment Options

We currently support deploying the OpenBoxes application to DigitalOcean and Azure. We would like to support other deployment options like Amazon Web Services, Vultr, Linode, and others but don't have the resources to build and maintain these deployment options at the moment. If interested in other deployment options, please participate in the discussion here to help us better understand your requirements and expectations regarding deployment. For instance, it would be helpful to hear from service providers who would like to manage multiple customers or users who aren't tech savvy but prefer a certain deployment platform because of its ease of use.

Deploy to DigitalOcean

The Deploy to DigitalOcean button will redirect you to DigitalOcean, where you will be able to choose

For more information and step-by-step instructions go to: https://community.openboxes.com/t/install-openboxes-via-digitalocean-marketplace/311

For our DigitalOcean marketplace app go to: https://marketplace.digitalocean.com/apps/openboxes-server?refcode=da4712a483b4

Deploy to DigitalOcean

Deploy to Azure

Deploy to Azure button will bring you to Azure portal, where after filling a few of the properties you can get your OpenBoxes environment in a matter of minutes. In the Azure setup screen, look at each property's tooltip description to understand its purpose.

For more information and step-by-step instructions go to: https://openboxes.atlassian.net/wiki/spaces/OBW/pages/1719435265/Push-button+deployment

Deploy to Azure uses the ARM template defined in openboxes-devops repository.

Deploy to Azure

Visualize will open armviz.io to display graph of all of the Azure resources, which the deployment will provision.

Visualize

Setup development environment

Install Dependencies

Required

Optional

Basic setup instructions for developers

These instructions are for developers only. If you are a user/implementer, please check out our Installation documentation.

1. Install Dependencies

Install required dependencies above

2. Install Grails and Java 8*

Check that you have SDK Man installed properly (otherwise follow instructions on the skdman install page).

$ sdk version
SDKMAN 5.13.2

Install Grails 3.3.10

$ sdk install grails 3.3.10

Install Java 8*

$ sdk install java 8.0.332-zulu

* - in case you have not installed Java yet.

3. Clone repository

If you are a core contributor:

git clone [email protected]:openboxes/openboxes.git      

If you are a not core contributor, fork openboxes git repository and replace git url with the one of your forked repository

git clone [email protected]:<gitusername>/openboxes.git      

4. Create database

Create openboxes database

mysql -u root -p -e 'create database openboxes default charset utf8;'

Create openboxes user

mysql -u root -p -e 'grant all on openboxes.* to "openboxes"@"localhost" identified by "openboxes";'

5. Create Openboxes configuration file

Edit $HOME/.grails/openboxes-config.properties

# Database connection settings
# You can use dataSource.url when you are using a non-dev/non-test database (test-app may not run properly).
# If you want to run $ grails test-app you should comment out the dataSource.url below and create a new 
# openboxes_test database.  Eventually, we will move to an in-memory H2 database for testing, but we're 
# currently stuck with MySQL because I'm using some MySQL-specific stuff in the Liquibase changesets.  My bad.

dataSource.url=jdbc:mysql://localhost:3306/openboxes
dataSource.username=openboxes
dataSource.password=openboxes

# OpenBoxes mail settings (disabled by default)
grails.mail.enabled=false

NOTE: If you are running in development mode with a copy of an existing production database, you will need to instruct the application to not setup test fixtures automatically by uncommenting the above property:

openboxes.fixtures.enabled=false

6. Install NPM dependencies

npm config set engine-strict true
npm install

7. Build React frontend

You can build React frontend with this command, but it will be automatically build when starting the application.

npm run bundle

8. React frontend Hot-Reload

When using this command React fronted will be rebuild automatically after any change, you just need to refresh the browser to see the effect.

npm run watch

9. Upgrade the project to the currently installed grails version

Either of the following actions (upgrade, compile, run-app) should generate the all important Spring configuration (/WEB-INF/applicationContext.xml) and start the dependency resolution process.

grails upgrade

OR

grails compile

The grails compile step is not necessary since grails run-app will invoke the compilation step, but it doesn't hurt anything.

If you see any errors, run the command again.

IMPORTANT That last line is important. Because of some quirkiness with the way older versions of Grails resolve dependencies and generates config files, you may need to run either of these commands multiple times in order to resolve all dependencies and generate the config files.

Once the dependency resolution phase has completed, all dependencies will be stored in a local ivy cache (usually under $USER_HOME/.grails/ivy-cache). You do not have to worry about this, just know that the dependencies are now on your machine and Grails will attempt to find them there before it tries to resolve them in a remote repository.

10. Start application in development mode

The application can be run in development mode. This starts the application running in an instance of Tomcat within the Grails console. You may need to run 'grails run-app' several times in order to download all dependencies.

grails run-app

11. Open application in Google Chrome

http://localhost:8080/openboxes

12. Log into OpenBoxes

You can use the default accounts (manager:password OR admin:password). Once you are logged in as an admin, you can create own account. Or you can use the signup form to create a new account.

13. React tests

To run new frontend (React) tests type:

npm test

14. Grails tests

To run Grails tests type:

grails test-app

15. React documentation

Start a style guide dev server:

npm run styleguide

View your style guide in the browser:

http://localhost:6060

Troubleshooting

How to Debug

  • Run Grails normally
    grails run-app
    
  • In Intellij navigate to Run > Edit Configurations
  • Create a new Remote Debug Configuration
    • Name: openboxes-debug
    • Transport: Socket
    • Debugger mode: Attach
    • Host: localhost
    • Port: 5005
  • Command line arguments should look something like this:
    -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
    

Problem

Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

Solution

Execute the grails upgrade command in order to generate the files nece

$ grails upgrade

See the following stackoverflow article: http://stackoverflow.com/questions/24243027/grails-spring-security-sample-application-not-working

openboxes-mobile's People

Contributors

awalkowiak avatar bluesir9 avatar brilik avatar chetanmaharishi avatar drodzewicz avatar hellochirag avatar jmiranda avatar kchelstowski avatar kumaransoftsuave avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

openboxes-mobile's Issues

Support barcode scanning via devices connected over Bluetooth

Based on discussion with @jmiranda, this would be a 2 part functionality:

  1. Get data from devices connected over Bluetooth.
  2. Resolve data received over Bluetooth.

Getting data from devices connected over Bluetooth

There are 2 types of workflows that need to be supported as part of this

  1. Barcode scanning devices that communicate over Bluetooth directly.
  2. Barcode scanning devices that communicate via a custom protocol.

Barcode scanning devices that communicate over Bluetooth directly

Based on the demo provided by @jmiranda, these devices are first connected to the smart phone over Bluetooth and post that, whenever they detect any sort of barcode, they pass along that data to the smart phone and that data gets "pasted" into any text field that was in focus at the time.

Pretty bare bones setup. There must be some way to intercept that "pasting" action so that we can intercept that data and do something with it.

Barcode scanning devices that communicate via a custom protocol.

Let's look at Zebra devices for an example. They have their own SDKs and they also have APIs that rely on Android intents to communicate scanned data. The latter would obviously not work for iOS devices. So in order to support these devices, we will have to use their SDKs/APIs.

Resolve data received over Bluetooth

Once data has been received over Bluetooth, we need to figure out if it's relevant to us and then do something with it.

For now we are going to assume that the scanned data is going to point to a product "id" and upon scanning we are immediately going to resolve it as such. And if the scanned data was successfully resolved as a product, we will open the product details page for the same. Doesn't matter where the user was earlier, if a product was scanned, we will immediately take them to the respective product details page.

With bar code scanning, this is where we are going to try to get before considering further use cases.

Build failed with an exception while testing expo_eject branch

[jmiranda@jmiranda-ThinkPad-W540 openboxes-mobile (expo_eject)]$ adb devices
List of devices attached
19064521402185	device

[jmiranda@jmiranda-ThinkPad-W540 openboxes-mobile (expo_eject)]$ yarn android
yarn run v1.17.3
$ react-native run-android
warn Package expo-updates has been ignored because it contains invalid configuration. Reason: Cannot find module 'expo-updates/package.json'
Require stack:
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/cli.js
warn Package react-native-screens has been ignored because it contains invalid configuration. Reason: Cannot find module 'react-native-screens/package.json'
Require stack:
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/cli.js
warn Package react-native-unimodules has been ignored because it contains invalid configuration. Reason: Cannot find module 'react-native-unimodules/package.json'
Require stack:
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/cli.js
warn Package react-native-web has been ignored because it contains invalid configuration. Reason: Cannot find module 'react-native-web/package.json'
Require stack:
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/cli.js
warn Package babel-jest has been ignored because it contains invalid configuration. Reason: Cannot find module 'babel-jest/package.json'
Require stack:
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/cli.js
warn Package jest has been ignored because it contains invalid configuration. Reason: Cannot find module 'jest/package.json'
Require stack:
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/cli.js
warn Package react-test-renderer has been ignored because it contains invalid configuration. Reason: Cannot find module 'react-test-renderer/package.json'
Require stack:
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/tools/releaseChecker/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/runServer.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/start/start.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js
- /home/jmiranda/git/openboxes-mobile/node_modules/react-native/cli.js
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1314 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
Picked up JAVA_TOOL_OPTIONS: -Dhttps.protocols=TLSv1.2

FAILURE: Build failed with an exception.

* Where:
Settings file '/home/jmiranda/git/openboxes-mobile/android/settings.gradle' line: 3

* What went wrong:
A problem occurred evaluating settings 'openboxes-expo'.
> Could not read script '/home/jmiranda/git/openboxes-mobile/node_modules/react-native-unimodules/gradle.groovy' as it does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 557ms

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Picked up JAVA_TOOL_OPTIONS: -Dhttps.protocols=TLSv1.2
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Create component that accepts barcode scan

After scanning data into the field the field

  • should either store data in field as-is or should pull extra data using API.
  • should be read only
  • should transition focus to the next input field when available.
  • should display an error if API request does not return data

For example a SKU field should attempt to lookup the product associated with the SKU. The SKU and product name should be visible / read only. Clicking on the field should make it editable / scannable again.

In the case that the field is the only field on the page then subsequent scans could potentially update the field value even when the field is read only but we'd need to check if usability is ok there. I think a better approach for single field pages would be to move to the next page (in case of a wizard).

Note: We'll need a separate component for searching by SKU and bin location. This component should not exhibit behavior above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.