{{announcement.body}}
{{announcement.title}}

I Was Told to Not Make a CMS, So I Made a CMS Framework

DZone 's Guide to

I Was Told to Not Make a CMS, So I Made a CMS Framework

Faced with the same problem over and over, this dev sought to make his own software to fix the issue. Then he open sourced it!

· Web Dev Zone ·
Free Resource

Image title

Google can be a cold place, sometimes.

You see, I’m a freelancer and my main focuses are web, mobile, and desktop applications.

Some of the most annoying job requests I get are small businesses with some sort of 'unique' business model. These business models vary and tools like WordPress, Joomla, or some sort of Headless CMS rarely ever cut it. Sometimes I needed it to expose an API, sometimes I needed really custom interactions, sometimes I wanted plugins that actually worked.

The other solution is to build these content management systems from scratch. Making mundane CRUD screens that take up way too much of my time, with me ending up with yet another uninteresting project on my résumé.

This is frustrating because I only freelance part-time (as I am also finishing up my CS degree). And because I essentially live as a student, these jobs are easy and can really help me out month-to-month, as I can find them pretty easily. These jobs suck, but they pay.

So I took another approach.

I Made Elepy, a Headless CMS Framework for Java


A quick image of a custom Elepy UI

I was so fed up with these basic CMS applications that I started to work towards a solution that could streamline the process of making a content management solution so much that I could make Content Management Systems in my sleep.

After months of architecting, designing, implementing, and failing, I did it. I started pumping out websites and apps like it was nobody’s business. And as the requirements per project changed, the feature-set of the framework grew. For example, one client didn’t want MongoDB because he heard PostgreSQL was better, so I had to make it work with SQL. I had to make the framework as extendable, customizable, and replaceable as possible (to keep up with these weird requirements).

But How Is it Different From Any Other Headless CMS?

Well, I’m still programming, not drag-and-dropping. My code defines exactly what I want to do, without the boilerplate. All the layers (database access, business logic, and presentation) are effortlessly generated for you after you define what your domain is. And if you ever want to change any layer (or just a part of one) you can do so pretty easily. Here’s an example of the code for a basic product CMS:

import com.elepy.annotations.*;
import com.elepy.models.TextType;

@RestModel(slug = "/products", name = "Name")
public class Product {

    @Identifier
    private String id;

    @Number(minimum = 0)
    private BigDecimal price;

    @Unique
    @Searchable
    private String name;

    @DateTime(maximumDate = "2050-01-01")
    private Date expirationDate;

    @Text(TextType.TEXTAREA)
    private String shortDescription;

    @Text(TextType.HTML)
    @PrettyName("This is a detailed description of the Product")
    private String longDescription;


    // Getters and setters. I like to use Project Lombok to automate this :D

}

This is what gets generated for me:

This is what gets generated for me:

How it works now is that whenever I have to implement a custom feature that only applies to a specific business model, the framework literally gets out of the way and provides support for writing the custom functionality.

Read more about that here: https://elepy.com/docs/overriding-elepy.

I’m Happy With It!

Another custom UI

It was a success! My personal website, 15+ websites/apps for clients, the Elepy documentation (with GitHub integration), and part of my DevOps automation all run successfully on Elepy. Things that usually take a month now take around a day. I can now say that I focus much more on domain problems than wanting to slam my laptop into the ground because the WordPress plugin that I bought didn’t have a certain feature.

And because it essentially pays for itself in development time, I decided to open source the framework and make it available to all the programmers who were once as frustrated as I was!

Here it Is:

Topics:
headless cms ,kotlin ,web dev ,java web development ,open source tools

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}