minimalchat / daemon

Minimal Chat's API server daemon
https://minimal.chat
BSD 3-Clause "New" or "Revised" License
55 stars 8 forks source link

Seed db with dummy data via a script (keep these in a new repo?) #16

Closed broneks closed 7 years ago

broneks commented 7 years ago

operators clients chats messages

mihok commented 7 years ago

This could also be put into the Makefile using template files + curl

teesloane commented 7 years ago

I feel like this should just be written in the project in a .go file no? Just make an external file that creates dummy data as the operator project does too. We could just do a environment variable check for development and if so, store some dummy chats in memory to respond with on GET requests.

broneks commented 7 years ago

Keeping it external from the source code is more versatile. A makefile for example could be passed arguments saying which seed to use (in case we have different data covering different scenarios). Also once we have a database it makes more sense to import data via command line than from within the app.

teesloane commented 7 years ago

that's true, that makes more sense. So this will automate putting the data into memory through a series of post requests I suppose?

either way, you've got me on board.

mihok commented 7 years ago

So I started tryng to tackle this issue and realized that because the API (by design) doesnt allow full CRUD (specifically Create) of Chats, Clients, or Operators, generating this data outside of the codebase is a little difficult.

mihok commented 7 years ago

Closing this for now