html, [ruby], blog, security, [code], sysadmin, productivity, sql, css, commandline, functional
When you’ve done everything you can with Ruby On Rails….
When you’ve reached the limits of Haskell on a Horse…
If FubuMVC is not for you…
It’s time to meet the MVC web framework to end all MVC Web frameworks.
DOS on DOPE is the modern MVC framework built on the awesome power of Batch scripts.
All of the controllers in DoD are batch files.
All of the views are batch files.
The model is based on batch files. The helper functions are… you guessed it! Beautiful batch files!
The complete source code and tutorials are available at github
With DosOnDope, it’s this simple:
open a cmd window, and write:
dope site Blog
You just built a website, called ‘blog’. Here it is:
Oops. It moves too fast, I can’t keep up.
Here’s all the folders that have been created for us…
C:tempblog>dir /s/a:d/b C:tempblogContent C:tempblogControllers C:tempblogh C:tempblogModels C:tempblogScripts C:tempblogViews C:tempblogControllersHome C:tempblogViewsShared
And all the files…
C:tempblog>dir /s/a:-d/b C:tempblogDefault.aspx C:tempblogfavicon.ico C:tempblogGlobal.asax C:tempblogweb.config C:tempblogContentSite.css C:tempblogContentli.png C:tempblogContentLogo.png C:tempblogControllers_actionMissing.bat C:tempblogControllers_controllerMissing.bat C:tempblogControllersHomeIndex.bat C:tempblogha.bat C:tempbloghh1.bat C:tempbloghh2.bat C:tempbloghh3.bat C:tempbloghp.bat C:tempblogModelssplit.vbs C:tempblogViewsShared_header.bat
Let’s create a new controller action, and see how it looks.
Let’s improve the look of that page. You type a little…
…hit refresh and see what changed.
Notice the use of html helper methods like ‘
p.bat‘ and use of the partial, ‘
_header.bat‘ to give styling and a title to the page.
But websites don’t live in a vacuum. We need some data to bring this thing to life.
In DoD we embrace the NoSQL movement and jump straight to the data-store of the future: a CSV file.
C:temp>CD BlogModels C:tempBlogModels>copy con Posts.csv ID`Title`Article ^Z
Posts.csv is both the model that describes our data, and the store which will contain the data itself.
Let’s generate actions for administering our Posts:
C:tempblogModels>dope gen Post Generating actions for MODEL Post in Controller Home...
Check in a browser…
The generator has created a nice page for us, with a name and textbox for every field, so we can create new posts.
Once we’ve added a few articles, let’s see what the index looks like:
If we look inside the posts.csv file, we see the data:
C:tempblogModels>type Posts.csv ID`Title`Article 1`Hello Brazil!`Yes, yes, hello indeed! 2`Let's add a second for good measure`Oh yeah
Frequently Asked Questions
What about security?
If you can’t trust public visitors from the internet, who can you trust? Executing user input as commands inside the operating system is the most direct way to get things done, and that’s what matters most.
Does it scale?
So far I haven’t run into any performance problems. Whenever I’ve opened up a DoD website to several users, my hard drive tends to get wiped long before I discover performance issues.
Well, that’s about it. Source code and tutorials available at github / dos on dope
A full-featured web development framework with the smallest possible concept count.
My book “Choose Your First Product” is available now.
It gives you 4 easy steps to find and validate a humble product idea.