DEV Community

Cover image for Developing Backend Made Easy!
Sasidharan
Sasidharan

Posted on β€’ Edited on

54 16

Developing Backend Made Easy!

Are you thinking of creating a content providing backend for your project?

πŸ§‘β€πŸ’» : Yes!

Gonna do it for yourself from scratch?

πŸ§‘β€πŸ’» : Yes. Planned to do so.

Before that let me suggest a guy, strapi.

Strapi is the leading open-source headless CMS. It’s 100% Javascript, fully customizable, and developer-first.

What actually a headless content management system means?

Its a perfectly separated backend application developed from scratch for content delivery through REST APIs. Simply, it is a content repository that comes with an admin panel to add content and it can be displayed in frontend over RESTful APIs.

Why we need headless CMS?

  • Web and mobile applications can be served with your content.
  • Build any website using your familiar technology.
  • Use REST APIs to communicate with your content.
  • Create your content with a pre-built user interface.
  • Now, most of the CMS supports GraphQL queries which can be used to queries your data from Frontend applications such as React, Vue, Angular, etc.

Why Strapi?

  • Open source and free forever.
  • Easy to create, update, and manage content.
  • Supports GraphQL.
  • Select the database of your choice (SQLite, MySql, Postgres, MongoDB).
  • Easy one-click deployment.

Sounds easy right?

πŸ§‘β€πŸ’» : Yep! But how to do that?


Step 1

Package manager of your choice. I am using yarn in this example.

yarn create strapi-app my-project --quickstart
Enter fullscreen mode Exit fullscreen mode

Note: Here, --quickstart flag will create a strapi-app with SQLite database. You can skip the flag if you need to change a specific database.

While creating a project it will expose you to admin panel, else navigate to http://localhost:1337/admin

Alt Text

  • Complete the form to create the first Administrator user.
  • Click Ready to start.

Alt Text

Step 2

That's it. You have created your own backend Node application in minutes.

Now, create your new collection/table in the Content-types builder tab,

Alt Text

with all your required columns/fields.

Alt Text

Step 3

After creating content type with its required fields, the created one will be shown in the sidebar under collections, select and add your content as,

Alt Text

Save it.

Step 4

Navigate to Roles & Permissions -> Public, you can see your APIs created.

Boom!!!

Alt Text

To view it in browser, make it public.

Alt Text

You can also add authentication to your APIs, allow public access, and so on.

Now we have created our headless CMS in just a few steps. You can simply use this REST API in your frontend mobile, web application using HTTP client or GraphQL queries.

Refer Strapi Official Documentation for more - https://strapi.io/documentation/v3.x/getting-started/introduction.html

I created a site called lagandlog using strapi have a look.
Thanks.

SurveyJS custom survey software

Simplify data collection in your JS app with a fully integrated form management platform. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more. Integrates with any backend system, giving you full control over your data and no user limits.

Learn more

Top comments (10)

Collapse
 
thisdotmedia_staff profile image
This Dot Media β€’

Thanks for sharing! πŸ™

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt β€’ β€’ Edited

I still don't get why would I need it, why not just writing a schema directly in a JavaScript file. But then, REST API might not be standardized.

In reality, I used to write my own CMS, but now I go flat file.

My opinion is, I don't really want to design a schema, but headless CMS does allows flexibility of the frontend side, but freedom can also be a burden.

Also, does headless CMS need a GUI? Will the GUI be done right, or will it have learning curve as well? (Who said only coding has learning curve? GUI also has learning curve...)

Collapse
 
webdev_chen profile image
Uchena Miller β€’

If it's a personal project a developer should take their time building their back-end and front-end.. for work if the client doesn't have a good enough budget then what the heck!. Go for it

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt β€’

In my experience, self brew projects always have maintenance costs. Still, it is good for learning.

Collapse
 
sasicodes profile image
Sasidharan β€’

Exactly.

Collapse
 
spidergears profile image
Deepak Singh β€’

Is there a standard plugin to manage data migration and schema? I couldn't find any and that's stopping me from using this in production.

Collapse
 
adeolaonads profile image
adeolaonads β€’

Thanks for sharing

Collapse
 
aadish2020 profile image
Aadish Patodi β€’

It's like a lite version of jhipster

Collapse
 
therohitdas profile image
Rohit Das β€’

I like Strapi but, I am currently using webiny

Collapse
 
sasicodes profile image
Sasidharan β€’

How's your experience on webiny?

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free β†’

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay