Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Quite a few of my friends want to have their own personal website to showcase their talents. However, they don't want to deal with such technical things as writing html and managing web server. Neither do I.

It would be nice that we go to our URL and view our pages and we edit and update our information when logging in. So basically the content displayed will be what we provide and at the same time we can choose from some provided templates for page layout and style.

It seems a typical content management system to me. If it is, I'd like to build a simple one myself because I'd like to have the experience of building a simple CMS. Since I have no previous experience for this, I need some help figuring out what is all I need for it. And, what are the most appropriate tools and technologies?

So far, I have html, css, JSP, Tomcat, SQLite in my mind. Is that enough? Are they the best combination?

Also, I have no idea how to approach the authorization and security aspects of building the system.

(PS: I'm not sure what tags are proper for my question. Feel free to edit them for me)

share|improve this question

closed as too broad by GlenH7, MichaelT, Snowman, durron597, Telastyn Apr 9 '15 at 15:24

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

A CMS is not always "simple". They can become quite complex, depending on what you're requirements are. So... do you want to build one yourself just for the experience? Is there a good reason you don't want to customize an existing CMS for your purposes? – FrustratedWithFormsDesigner Jan 5 '12 at 21:34
The tags you added sound fine, but if StackExchange would accept one more tag, I would have added the 'reinventing-the-wheel' tag. There exist lots of very good content management systems out there, for sale and for free, covering all kinds of needs. Hundreds of thousands of man hours have already been invested in this area. Why waste your time with something like that? Just go open up a wordpress blog for your friends. – Mike Nakis Jan 5 '12 at 21:35
@FrustratedWithFormsDesigner Yes, I want the experience. It would be great if someone could help put me on the track. – Terry Li Jan 5 '12 at 21:36
@MikeNakis I'd like to gain some hands-on experience going through this. – Terry Li Jan 5 '12 at 21:39
if you are wanting to create a CMS you need to get way past thinking writing HTML is a technical thing, judging by how you wrote your question i would say you are better off learning to use an existing CMS and trying to add something to it or customize it a bit, not actually build one. – Ryathal Jan 5 '12 at 21:52
up vote 2 down vote accepted

As a fervent Rubyist, I'm biased, but I would suggest Ruby on Rails for learning to build a CMS. The barriers to entry are pretty low, there are great tutorials to get you bootstrapped, adherence to standards such as REST, HTML5, CSS3, etc. is a top priority, the list goes on and on.

One really nice thing about getting started with Rails is Ryan Bates' series Railscasts. You can watch an expert code similar exercises and adapt it to what you're trying t accomplish. In addition, Github is chock full of both build-a-blog-or-cms code-along tutorials, as well as full-fledged, open source Rails-based CMS applications you can go to as examples. One of the best CMSes I've ever played with is Alchemy, which is built on Rails 3.

I'm not insisting that you MUST become a Ruby programmer, or that other languages/frameworks are wrong. But once you try it... this is the framework that skyrocketed to popularity when DHH built a blog engine in 15 minutes, on stage. So even just for rapid prototyping, it's a great tool.

Give it a try... there are excellent gems (OmniAuth, Devise) for handling security and authentication, and many of the hairy issues like CSRF are handled by the framework itself. You can concentrate on the project, rather than the incidental issues. And as it's database-agnostic, you can start with SQLite if you like, and move to PostgreSQL or even Mongo or Couch later if you fancy.

So... yeah. Enjoy. Programming should be fun.

share|improve this answer

The best way to learn to design a content management system is to customize an open source one for your needs. Just getting one installed and running for the first time is a major achievement, then move onto theming and writing your own modules.

Then, and only then, will you have a reasonable idea of what it would take to design your own from scratch. Doing it from scratch from the start isn't as valuable a learning experience as you might think, because you are mostly learning what doesn't work, and what does "work" is designed by a very inexperienced person. There are a gazillion tiny little problems people have already solved that you aren't even aware exist yet.

share|improve this answer
I completely disagree, on a philosphical level. If you just alter existing systems, you never get forced to personally solve all those tiny problems that system creators encounter, greatly reducing the value of the experience. – GrandmasterB Jan 6 '12 at 4:42
@GrandmasterB: you're right: it seems that the OP wants to have this sort of experience of reinventing the wheel: "I'd like to build a simple one myself because I'd like to have the experience of building a simple CMS". Instead, if the OP just wants to use a customized CMS, then grabbing an open source one is definitely a solution. – MainMa Jan 6 '12 at 9:34

A basic CMS is a pretty simple beast to create. There's not a lot to them, conceptually. You generally want some sort of user authorization system, and then the ability to enter and edit web page content, and of course store it all somewhere. Mind you, what you'd make at first will be very bare bones - probably more resembling a 1996-era guest book than WordPress. But it should be usable for basic web sites.

Out of the technologies you cite, HTML is the only one thats required since thats what you ultimately are producing. The languages you use on the back end is just a matter of personal preference (along with any platform/hosting limitations). If you like Java, use Java. Or PHP, or Python, etc. Same with the storage mechanism - sqlite, mysql, nosql, file system - use whichever you find appealing. Or better, code your system in such a way that that storage systems can be switched.

One technology you will likely also need to understand is HTTP itself, as session information (and thus user authorization) is typically tracked in cookies. Understanding how that works will be key to implementing authorization. So if you dont understand how that all works, there's your starting point.

For managing content, take a look at one of the WYSIWYG javascript editors. These will simplify entering content into your system, bypassing the need to use something like bbcode to apply font styles.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.