This project provides a simple utility to export data from an XML file to a Redis database. It is designed to parse specific XML structures and store the parsed data into Redis using predefined key structures.
/xml-to-redis/
|-- /src/
| |-- index.js
| |-- XmlParser.js
| |-- RedisClient.js
|-- /tests/
| |-- XmlParser.test.js
|-- config.xml
|-- docker-compose.yml
|-- Dockerfile
|-- package.json
|-- export.sh
|-- README.md
- Docker
- Docker Compose
- Node.js (npm or yarn)
- Clone the repository:
git clone [repository-url] xml-to-redis
cd xml-to-redis
- Install Node.js dependencies:
npm install
or
yarn
To run the application, use the provided export.sh
script with the path to your XML file:
./export.sh -v ./config.xml
If the -v
argument is present, the script will print all keys saved to Redis.
The project uses Docker Compose to run the Node.js application and Redis in separate containers. To start the services:
docker-compose up -d
Unit tests are provided for the XML parsing functionality. To run the tests:
npm test
or
yarn test
This project is open-sourced and is licensed under the MIT License.