Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Realistic data for RealWorld? #77

Open
anishkny opened this issue Apr 29, 2017 · 9 comments
Open

Realistic data for RealWorld? #77

anishkny opened this issue Apr 29, 2017 · 9 comments
Labels
Status: RFC awaiting for comments to be approved v2 changelog

Comments

@anishkny
Copy link
Member

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
Copy link
Member

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
Copy link
Member

Alonski commented Apr 30, 2017

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

@sandeesh
Copy link
Member

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
Copy link

deksden commented May 2, 2017

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

@jamesbrewerdev
Copy link

jamesbrewerdev commented May 5, 2017

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:

  • For the demo, we add the ability to flag accounts as "demo" accounts. This is a simple boolean on the user model that defaults to false. For demo accounts, we set demo: true. For user accounts, we do nothing.

  • Logged out users see only posts made by accounts with demo: true.

  • Logged in users see posts made by accounts with demo: true and posts made by their own account.

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
Copy link
Member

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

@sandeesh
Copy link
Member

sandeesh commented May 9, 2017

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
Copy link

jamesbrewerdev commented May 9, 2017 via email

@cirosantilli
Copy link
Contributor

cirosantilli commented Jun 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: RFC awaiting for comments to be approved v2 changelog
Projects
None yet
Development

No branches or pull requests

8 participants