This front-end app is a React-based application designed to demo performing CRUD (Create, read, update, delete) operations on a GalaChain Contract.
- Node.js (recommended version 16.x or later)
- npm (Node Package Manager)
git clone https://github.com/wolfyy970/GalaChainCRUD
cd frontend-app- Copy the environment template:
cp env.dev .env- Configure the environment:
Edit the .env file and set the environment:
# Choose either 'local' or 'testnet'
REACT_APP_ENV=localnpm installnpm start- Runs the app in development mode
- Open http://localhost:3000 to view in browser
npm test- Launches the test runner in interactive watch mode
- See running tests for more information
npm run build- Builds the app for production in the
buildfolder - Correctly bundles React in production mode
- Optimizes the build for best performance
- The build is minified with hashed filenames
- App is ready for deployment
- Builds the app for production in the
- Create bags with unique ID, holder, and maximum weight
- View and manage bag contents
- Add items to bags
- Update item details (quantity)
- Remove items from bags
- Fetch and display bag items
The app supports two primary environments:
-
local: For testing with Gala Local network. -
testnet: For testing with Gala test network.
Note: The Testnet environment needs an active mainnet Ethereum wallet and by default the app connects the installed wallet on your browser
Note: The Local environment needs an running gala network on local machine
The environment is dynamically configured using the REACT_APP_ENV variable.
- Ensure all environment variables are correctly set
- Check network connectivity for TestNet environments
- Verify Node.js and npm versions
Distributed under the [MIT License]. See LICENSE for more information.