DEV Community

Cover image for Create a basic CRUD api and fill it with dummy data in SECONDS
anderspk
anderspk

Posted on

Create a basic CRUD api and fill it with dummy data in SECONDS

A few months ago, I released a free service to help with the need for dummy data and a CRUD api during frontend development -- and I'd like to share it with you today!😄

Who is this for?

This is for YOU when you're focused on the frontend, and don't want to hardcode dummy data to use in your app; you want to make an api call, you want lots of data, you want to be able to modify the shape of the data as you go along and find more requirements, and you might want to to make CRUD actions on the data.

Start your timer...

There's not much to it, so let's just jump straight in!

Step 1: Navigate to the website

Head on over to Crudpi.io and you'll be greeted by this screen.

Alt Text

Step 2: Create your first CRUD API

No time to waste! Just type in an appropriate name, and hit CREATE!

Alt Text

And you're done!

You can now go right ahead and start using the provided links to GET, POST, UPDATE, and DELETE your data.

Alt Text

But wait! There's more!

We need dummy data! Lots of it!

Step 3: Fill your api with dummy data

When you click JSON Inserter, you'll get access to a code editor where you can define a JSON object that you want inserted into your API. The cool part is that the editor has a built-in faker dummy data generator, and intelliSense to suggest dummy data, so you don't need to hard-code the values. Couple this with the ability to choose how many copies of the object you want inserted into your API, and you can quickly have 100 custom defined dummy data objects at your disposal in no time!

Alt Text

I've defined the object I want above. As you can see, "name", "address", and "logo", will be replaced with generated fake values, while "planet" is hardcoded as "Earth". I want 50 of these in my API.

And just like that...

My frontend now has access to exactly the data I need! I can also add more API's on the same page, and quickly delete/replace the saved data.

Alt Text

Thanks for reading! 😀😀

Top comments (2)

Collapse
 
victorioberra profile image
Victorio Berra

Very cool, I like that this let's the user have control over the fake data compared to all the other dummy APIs out there. Are you using the C# library Bogus for the fake data?

Collapse
 
orimdominic profile image
Orim Dominic Adah • Edited

Wow! I was thinking of something like this recently, but API will be local, for people with internet issues.
Thanks for sharing. Very interesting