reactioncommerce / reaction-cli

A command line tool for working with Reaction Commerce.
33 stars 20 forks source link

Add db seeding functionality for development #67

Closed spencern closed 6 years ago

spencern commented 6 years ago

Create a new command seed that will seed the mongo database with fake products, orders, tags etc.

Currently, this functionality lives in https://github.com/reactioncommerce/reaction-devtools,

This issue is blocked by two issues:

  1. Removing the Meteor dependency from file-collections
  2. Abstracting the seeding functionality of devtools into an npm package: https://github.com/reactioncommerce/reaction-devtools/issues/18

This command may need to take a --dbport or similar flag to determine how to access the correct database.

Additional functionality could include passing a "size" flag (e.g. reaction seed --size large) or passing in specific parameters for different data sets - e.g. reaction seed --products 1000 --tags 200 --orders 5000 or something similar.

Questions

  1. Are there any major drawbacks to doing it this way?
  2. How else could we accomplish this functionality?
  3. Is this the correct place for this functionality or should it live in separate CLI command?

Acceptance criteria I can run the following command to seed a mongo database with a default set of product data

reaction seed
spencern commented 6 years ago

@jshimko suggests that we could export a mongo db with the seeded data as a temporary, easier solution.

spencern commented 6 years ago

@kieckhafer has created a data set that he will publish somewhere that contains a great set of starter data. Closing this issue in favor of that solution for now.