qccoders / startup-idea-generator

Click a button and receive a randomized startup idea!
http://startups.qccoders.org
GNU General Public License v3.0
5 stars 7 forks source link

Reintroduce a back-end API and enable persistence #47

Open jpdillingham opened 5 years ago

jpdillingham commented 5 years ago

Move generation of startup/noun pairings back to a back-end and reconfigure the application to fetch pairings from it rather than generating them directly in the browser.

A datastore of some type will be necessary to store the lists of startups and nouns, and should be flexible to support additional functionality.

jpdillingham commented 5 years ago

Related to #45 and a prerequisite for #46

mtliendo commented 5 years ago

Would the desired behavior be to have a request made to the api on every button click? Similar to the advice api?

jpdillingham commented 5 years ago

I'm imagining an /idea/ endpoint that would return an object with startup, noun and id properties. If a record for the startup/noun pairing exists in the database, return that id, otherwise generate one randomly. An extension of this would be /idea/id/ that would act as a permalink to that pairing.

In this scenario the id would be saved the first time someone 'reacts' or shares it to social media, otherwise it would be thrown away.