Firstly you should know what is a CMS in technical terms:
A ”’web content management system”””(WCMS) is a software system that provides website authoring, collaboration, and administration tools designed to allow users with little knowledge of web programming languages or markup languages to create and manage website content with relative ease. A robust WCMS provides the foundation for collaboration, offering users the ability to manage documents and output for multiple author editing and participation. by Wikipedi
Now the next part is to decide you platform in front-end & back-end, choose this wisely. The most famous language in developing CMS is PHP today as it is easy to implement, finding solutions to the issues you might face can be really easy as there are n no of support forums. Back-end used alongside with PHP is MySQL as there is simple collaboration of both PHP and MySQL.
Note that the css of a cms has to be made really well as based on the css the look of the website can be edited.
Now you need work on the hard-core coding aspect which includes the middle tier i.e. the business logic and the back-end structure and design
Design your back-end with all the necessary tables and inter-linking of the tables, like for instance an inventory table will have various parts like inventory_master, inventory_related_products,inventory_discount and so on.
There should a proper segregation of the admin functionality and content management for ease in editing each module.
Before you step into the making of the a CMS you should understand the current CMS in market and find the functionalities that are missing and try to fill in for those to make your CMS stand out. Also that would give you a better idea in-terms of coding your own, like for eg. Opencart uses the MVC framework which simple to understand because there a systematic segregation of work but the drawback of opencart is that it is not as flexible as it look, like if I need to add a module where-in I need to add certain types of discount schemes for “buy 1 get 1 free of a lesser value”, that would involves changes in a lot of segments of code, also it would get a bit complex in certain areas.
But if you have your own CMS, it would be much more easier to add/delete/edit any module of your website.
So plan it out clearly with all the aspects decided before hand & work accordingly.