This repository contains source codes for the Building web applications with Clojure screencast, published by PacktPub.
Please note, that this code is provided for demonstrational purposes only and was written live during short videos. Therefore, it is kind of pointless to use it without commentary provided in the video course itself.
Each video has a separate git tag for version of code available at the end of it, so you can walk through the progress of the tutorials or jump to the one you're currently browsing.
For example, video 2 of section 3, is tagged as SECTION3_VIDEO2, which video 1 of section 5 is tagged as SECTION5_VIDEO1.
Each section and video is described below, so you can easily browse the code and access external links to tools and libraries mentioned in each video.
Feel free to fork and play around with this repo!
In this section, the reader will learn how to create a Leiningen project, configure Ring dependencies and plugins and start the web server from a command line.
Reference links:
Videos:
- Video 1: project setup
- Video 2: lein-ring plugin
- Video 3: simple Ring handler
- Video 4: running Ring server
- Video 5: building web application packages
This section will explain how handlers in Ring work, what do they do and how we can access HTTP request manipulate an HTTP response. We will also see how to dispatch calls to different functions and introduce general mechanisms.
Reference links:
Videos:
- Video 1: Ring handler anatomy
- Video 2: request map
- Video 3: response map
- Video 4: routing
- Video 5: not found and error handling
In this section, I will explain how Ring middleware works. Then, I will implement an example middleware. Finally, use of existing middleware will be shown.
Reference links:
Videos:
- Video 1: introduction
- Video 2: example
- Video 3: altering request and response
- Video 4: using existing middleware
In this section, I will show to handle POST/GET parameters from Clojure web application, generate HTML content from Clojure level, manipulate cookies and manage Ring sessions.
Reference links:
Videos:
- Video 1: Form handling
- Video 2: Generating HTML content
- Video 3: Manipulating cookies
- Video 4: Ring sessions
This section will show how we can easily build a RESTful, JSON-based API with Clojure/Ring.
Reference links:
Videos:
- Video 1: API introduction and routing
- Video 2: Example RESTful API
- Video 3: Handling errors in REST API
In this section, I will showcase how can we integrate a popular databases - PostgreSQL and MongoDB with Clojure web app. For PostgreSQL, popular Clojure ORM framework - Korma, will be introduced.
Reference links:
Videos:
This section will cover how to build basic ClojureScript logic, access JavaScript functions and how to integrate it with Clojure RESTful interface server-side.
Reference links:
Videos:
- Video 1: ClojureScript
- Video 2: Manipulating DOM tree with ClojureScript
- Video 3: Accessing REST API from ClojureScript
In this section, I will show most popular and useful web libraries available for Clojure - Compojure for routing, Hiccup and Enlive for HTML templating and Liberator for building RESTful APIs.
Reference links:
Videos: