DoubleDebug logo

Random persona

NodeExpressTypescript

3 days

Random Persona is a RestAPI for generating random personnal data, such as:

  • first name,
  • last name
  • gender,
  • age,
  • occupation and
  • avatar images.

The API originally had one signle endpoint that generated all the fields mentioned above. However, in the next iteration, I decided to split them up into separate endpoints in case people needed specific fields of personnal data. In version 1.1, I've also added an option to request data in bulk — I've added a quantity parameter to all of the endpoints.

  • /random-persona (first & last name, gender, age, occupation, avatar)
  • /random-name (first & last name, gender)
  • /random-occupation (occupation)
  • /random-avatar (gender, avatar)

Data sources

The data is static and taken from these sources:


Usage example (Tinder-like page)

While working on this API, the frontend developer in me decided that it would be a good idea to put this API to use and create a visual example of random personas. The first thing that came to mind was Tinder and their awesome swipe left-right user interface.

The source code of this demo is a ~100 line script that fetches data from the API and attaches it to the card. If you're interested, you can check it out here.

Documentation

Find the OpenAPI specification (generated using the SwaggerUI tool) here.

HomeProjectsEducationBlogContactBack to top

© 2022 Double Debug. All rights reserved.

GithubYouTubeTwitter