Skip to content

roselynh100/half-a-human

Repository files navigation

🤯 Half A Human

Inspiration

As a writer myself, I often come across moments where I'm itching to write, but have no ideas. Although plots are indubitably important, I sometimes enjoy fleshing out characters first. That way, I can try to build my world around them, instead of being constrained later. Hence, I developed Half A Human, a website to help creatives with overcoming writer's block.

How It Works

The website itself has a minimalistic design. On the landing page, the user can select which details they'd like to generate, where options include name, age, and country. They can also choose the desired number of traits (the ideal range is between three and seven).

Image of Half A Human

Once the "generate" button is clicked, the website navigates to the Human page, where all the characteristics are laid out. The name and country are generated by an external API. If the user decides to include both, the country is decided by predicting the location the name is most likely from.

Human page

The Recents page displays six of the most recently generated humans! The data is pulled from a MongoDB cluster, and includes entries from anyone that has ever used the app (i.e. it's not local data, and the user will likely see humans that they did not generate themselves).

Things I Learnt

This was my first time building a Next.js app from top to bottom. While spending hours debugging cryptic errors, I learnt a lot of little quirks about Next.js — from the importance of using absolute urls in API calls, to how to get rid of pesky CORS issues.

In addition, after getting the generation working, I spent a lot of time making changes to the interface. I used Material UI for the base components, but added my own theme and fonts. I also utilized the Framer Motion library to add transitions and provide a better user experience. I now understand, from firsthand experience, how important a loading indicator is!

Next Steps

Although the function to generate traits makes sure there are no duplicates, it doesn't check to avoid contradictory terms. For example, it has once generated a human that was both rational and irrational — impossible! I tried to remove one from each pair of contradicting traits; however, the list is quite long, so I may have missed some. In the future, I hope to implement some kind of trait-detector function to make sure the generated human makes sense. (On the contrary, I think an unconventional mix of traits leads to interesting characters and lots of room for elaboration!)

Thanks for reading!

Releases

No releases published

Packages

No packages published