You are previewing Web Development with Clojure, 2nd Edition.
O'Reilly logo
Web Development with Clojure, 2nd Edition

Book Description

Modern web applications deserve modern tools. Harness the JVM's rich infrastructure while taking advantage of the expressive power and brisk performance of a modern functional language. Exploit Clojure's unique advantages for web development. Step by step, apply the fundamentals of programming in Clojure to build real-world, professional web applications. This edition features new libraries, tools, and best practices, and focuses on developing modern single-page applications.

Table of Contents

  1. <span xmlns="" xmlns:epub="" class="toc-secnum">&#160;</span>AcknowledgmentsAcknowledgments
  2. <span xmlns="" xmlns:epub="" class="toc-secnum">&#160;</span>IntroductionIntroduction
    1. What You Need
    2. Why Clojure?
    3. Why Make Web Apps in Clojure?
  3. <span xmlns="" xmlns:epub="" class="toc-secnum">1. </span>Getting Your Feet WetGetting Your Feet Wet
    1. Set Up Your Environment
    2. Build Your First Web App
    3. Refine Your App
    4. What You’ve Learned
  4. <span xmlns="" xmlns:epub="" class="toc-secnum">2. </span>Luminus Web StackLuminus Web Stack
    1. Route Requests with Ring
    2. Extend Ring
    3. Define the Routes with Compojure
    4. HTML Templating Using Selmer
    5. What You’ve Learned
  5. <span xmlns="" xmlns:epub="" class="toc-secnum">3. </span>Luminus ArchitectureLuminus Architecture
    1. Manage the Project
    2. Think in Terms of Application Components
    3. Managing Stateful Components
    4. What You’ve Learned
  6. <span xmlns="" xmlns:epub="" class="toc-secnum">4. </span>Add ClojureScriptAdd ClojureScript
    1. Understand ClojureScript
    2. Configure ClojureScript
    3. Add ClojureScript Support
    4. Build the UI with Reagent
    5. What You’ve Learned
  7. <span xmlns="" xmlns:epub="" class="toc-secnum">5. </span>Real-Time Messaging with WebSocketsReal-Time Messaging with WebSockets
    1. Set Up WebSockets on the Server
    2. Make WebSockets from ClojureScript
    3. WebSockets Using Sente
    4. What You’ve Learned
  8. <span xmlns="" xmlns:epub="" class="toc-secnum">6. </span>Writing RESTful Web ServicesWriting RESTful Web Services
    1. Use Compojure-api
    2. Creating the API
    3. What You’ve Learned
  9. <span xmlns="" xmlns:epub="" class="toc-secnum">7. </span>Database AccessDatabase Access
    1. Work with Relational Databases
    2. Use HugSQL
    3. Generate Reports
    4. What You’ve Learned
  10. <span xmlns="" xmlns:epub="" class="toc-secnum">8. </span>Picture GalleryPicture Gallery
    1. The Development Process
    2. What’s in a Gallery
    3. Create the Application
    4. Configure the Database
    5. Task A: Account Registration
    6. Task B: Login and Logout
    7. Task C: Uploading Pictures
    8. Task D: Displaying Pictures
    9. Task E: Deleting Pictures
    10. Task F: Account Deletion
    11. Adding Some Color
    12. What You’ve Learned
  11. <span xmlns="" xmlns:epub="" class="toc-secnum">9. </span>Finishing TouchesFinishing Touches
    1. Unit Tests
    2. Package the Application
    3. What You’ve Learned
  12. <span xmlns="" xmlns:epub="" class="toc-secnum">A1. </span>Clojure PrimerClojure Primer
    1. A Functional Perspective
    2. Data Types
    3. Using Functions
    4. Anonymous Functions
    5. Named Functions
    6. Higher-Order Functions
    7. Closures
    8. Threading Expressions
    9. Being Lazy
    10. Structuring the Code
    11. Destructuring Data
    12. Namespaces
    13. Dynamic Variables
    14. Polymorphism
    15. What About Global State?
    16. Writing Code That Writes Code for You
    17. The Read-Evaluate-Print Loop
    18. Calling Out to Java
    19. Calling Methods
    20. Summary
  13. <span xmlns="" xmlns:epub="" class="toc-secnum">A2. </span>Authentication with OAuthAuthentication with OAuth
    1. Why Use OAuth
  14. <span xmlns="" xmlns:epub="" class="toc-secnum">A3. </span>Document-Oriented Database AccessDocument-Oriented Database Access
    1. Picking the Right Database
    2. Using CouchDB
    3. Using MongoDB
  15. <span xmlns="" xmlns:epub="" class="toc-secnum">A4. </span>Writing RESTful Web Services with LiberatorWriting RESTful Web Services with Liberator
    1. Using Liberator
    2. Defining Resources
    3. Putting It All Together
  16. <span xmlns="" xmlns:epub="" class="toc-secnum">A5. </span>Leiningen TemplatesLeiningen Templates
    1. What’s in a Template