Skip to content

Instantly share code, notes, and snippets.

@briandfoy
Last active May 19, 2020 02:25
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briandfoy/6f21a8c0228e109ef48904c26422cb2d to your computer and use it in GitHub Desktop.
Save briandfoy/6f21a8c0228e109ef48904c26422cb2d to your computer and use it in GitHub Desktop.
Mojolicious Web Applications book outline
I'm not committing to the book just yet, but I'm thinking about what the outline would be.
I'm thinking about running another Kickstarter if I can find a major sponsor like I did
last time. Email me if you might be that person.
The basic idea is a tutorial book on writing that would start from scratch and build up.
This is specifically not a reference book that covers every aspect of Mojolicious. The
trick is to figure out all the topics that should be in the book and how to introduce them
gradually. Most topics should be relevant to most of the audience, while uncommon tasks
or lightly used features might not show up at all.
The User-Agent stuff is already in Mojolicious Web Clients. (https://amzn.to/2P5hkmP or https://leanpub.com/mojo_web_clients)
And, I have an eye on a separate websockets book.
* Random stuff that needs a home
+ web security (CSRF, etc)
+ javascript thingies (React, whatever)
+ Single page applications
* Introduction
+ Installing
* Hello World
+ using mojo to create an app
+ Mojo Lite
+ testing
* Writing a simple static file server
+ docker?
+ logging
+ more testing
* Templated files
+ MVC stuff
+ more stuff about rendering
+ wrappers, headers, footers, whatever
+ more testing
* Form handling routes
+ handling get
+ handling post
+ more testing
* Mojo not lite
+ where do you make the switch
* Database things
+ Basic crud stuff
+ Mojo::Pg
+ more testing
* REST (-like) interactive interfaces
+ handling routes based on the URL
+ cookies
+ sessions
+ multiple controllers
+ different return types (json, html, etc)
* Writing a simple web service
+ get and post
+ API publishing thingys
* Writing a complex web service
+ put
+ delete
+ other such things
* Chat server (websockets?)
+ shared message queue, etc
* Plugins and the like
* Advanced Rendering tricks
* Misc Advanced topics
* Production Servers
+ deployment
+ hypnotoad
+ proxied behind apache
+ proxied behind nginx
+ cloudflare
+ aws
* Appendices
+ What we didn't cover
----
Similar books:
* Flask Web Development
* https://django-book.readthedocs.io/en/latest/
* https://www.railstutorial.org/book
* https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world
@preaction
Copy link

Some ideas for the advanced rendering tricks chapter:

  • include w/ custom stash arguments (or even just inheriting the stash from the parent)
  • extends is massively useful, but it took me quite a bit of playing around to figure out how useful (something a book would be perfect to shortcut)

Another possible idea that might be its own book:

  • Overriding Mojolicious's behavior with_roles: In Mojolicious, nearly every method can be a hook to custom behavior by doing $app->$THING->with_roles( 'My::Role' ). Not that the existing hooks aren't powerful enough (the around dispatch hook can do literally anything)

@alaurie
Copy link

alaurie commented Feb 6, 2020

I think a companion video course along with the book would be a great idea. This is probably biased in the fact that I personally don't find technical books deeply engaging. Usually get part way through and never finish. I think there is a market there and is easier to keep updated and tweak than a published book (unless self publishing). Examples below are well regarded video courses.

Course Examples:
https://courses.miguelgrinberg.com/p/flask-mega-tutorial
https://training.talkpython.fm/
https://realpython.com/courses/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment