gothinkster / realworld

"The mother of all demo apps" — Exemplary fullstack Medium.com clone powered by React, Angular, Node, Django, and many more
https://realworld-docs.netlify.app/
MIT License
80.58k stars 7.33k forks source link

Realistic data for RealWorld? #77

Open anishkny opened 7 years ago

anishkny commented 7 years ago

I wonder if it's possible/feasible/helpful to fill the production db with more realistic data from some open data sets that might be floating around. It would look better in FE demos than "aaaaa", "sample title" etc... BE repos could also use it for testing their dbs. Just a thought.

EricSimons commented 7 years ago

Love this idea. @apai4 and I were originally kicking around creating profiles for authors from the 1900's and earlier (to avoid copyright restrictions) and post excerpts from their books/essays/etc at random intervals. Would be cool/hilarious to see Ben Franklin, Sun Tzu, etc posting articles on conduit :)

Alonski commented 7 years ago

That actually sounds pretty cool. Could maybe also setup a quote scraper from something like Wikipedia?

sandeesh commented 7 years ago

But how would this be helpful when so many users are constantly testing the demo. Unless access to create articles are restricted then the demo would soon be filled with user based content displaying on the front. Like @EricSimons mentions, inserting at random intervals might help, but that would require another setup.

It might be a good idea to create a dataset for new users to import to their database to get started. This might help with testing as well.

deksden commented 7 years ago

Good dataset could be description of Realword project of some sort: articles, comments, etc.

jamesbrewerdev commented 7 years ago

Ok. I think I've got an interesting solution to this one.

1) I love @EricSimons's idea of using authors from <= 1900. Since the work has no copyright restrictions, we can create articles that aesthetically look like what you'd see on Medium. Bonus points for using proper headings, paragraphs, images, etc.

2) @SandeeshS is on the money about users testing the demo. If we show everyone's content, then no one will see the content that @EricSimons mentioned. At the same time, a demo where we restrict users from posting probably isn't very useful.

Given (1) and (2), here is what I propose:

Specifically, this means that users (both logged in and logged out) should not see posts made by other users.

By allowing logged in users to see their own posts we solve the above problem of hiding posts making the demo useless.

By not allowing users to see posts by other users, we also solve the problem of surfacing only good content that accurately reflects the abilities of Conduit.

Another benefit is that this solves the pagination problem we ran into in the past where we were showing 100+ pages of content.

Thoughts?

EDIT: This will require a fork of whatever front-end/back-end that is currently running the demo. These changes should not be made in the public codebases.

EricSimons commented 7 years ago

^ love this idea @brwr! How far did you get on Sat with the Rails fork?

sandeesh commented 7 years ago

So which version of the current backend are we modding to get this rolling? I assume it's mostly gonna be node. I can probably get this done myself if you're fine with having the laravel version of api running in prod.

jamesbrewerdev commented 7 years ago

The demo is running a version of the Rails API.

On Tue, May 9, 2017 at 12:44 PM, Sandeesh notifications@github.com wrote:

So which version of the current backend are we modding to get this rolling? I assume it's mostly gonna be node. I can probably get this done myself if you're fine with having the laravel version of api running in prod.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gothinkster/realworld/issues/77#issuecomment-300280038, or mute the thread https://github.com/notifications/unsubscribe-auth/AD5-rBqD4XVn4Yvl5F6nQpi2s1luYZG4ks5r4MI1gaJpZM4NMYpF .

cirosantilli commented 3 years ago

If this is going to be done, there should be an API-based data generator in this repo I think. Faker is a well known ruby solution: https://github.com/faker-ruby/faker The Js port (preferred for inclusion in this repo): https://github.com/Marak/faker.js

On a related note, I'm using a local non-realistic but predictable direct-to-Sequelize-db version which is a must for the development:

But it is sequelize specific. Something like that for API would be great too though.