0%

Today, developers are increasingly adopting Clojure as a web-development platform. See for yourself what makes Clojure so desirable, as you create a series of web apps of growing complexity, exploring the full process of web development using a modern functional language. This fully updated third edition reveals the changes in the rapidly evolving Clojure ecosystem and provides a practical, complete walkthrough of the Clojure web-stack.

Stop developing web apps with yesterday's tools. Today, developers are increasingly adopting Clojure as a web-development platform. See for yourself what makes Clojure so desirable, as you work hands-on with Clojure and build a series of web apps of increasing size and scope, culminating in a professional grade web app using all the techniques you've learned along the way.

This fully updated third edition will get you up to speed on the changes in the rapidly evolving Clojure ecosystem - the many new libraries, tools, and best practices. Build a fully featured SPA app with re-frame, a popular front-end framework for ClojureScript supporting a functional style MVC approach for managing the UI state in Single-Page Application-style applications. Gain expertise in the powerful Ring stack using the Luminus framework. Learn how Clojure works with databases and speeds development of RESTful services. See why ClojureScript is rapidly becoming a popular front-end platform, and use ClojureScript with the popular re-frame library to build single-page applications.

Whether you're already familiar with Clojure or completely new to the language, you'll be able to write web applications with Clojure at a professional level.

Table of Contents

  1.  Acknowledgments
  2.  Introduction
    1. What You Need
    2. Why Clojure?
    3. Why Make Web Apps in Clojure?
    4. How to Read This Book
  3. 1. Getting Your Feet Wet
    1. Set Up Your Environment
    2. Managing Projects with Leiningen
    3. Build Your First Web App
    4. Refine Your App
    5. What You’ve Learned
  4. 2. Luminus Web Stack
    1. Route Requests with Ring
    2. Extend Ring
    3. Define the Routes with Reitit
    4. HTML Templating Using Selmer
    5. What You’ve Learned
  5. 3. Luminus Architecture
    1. Manage the Project
    2. Think in Terms of Application Components
    3. Managing Stateful Components
    4. What You’ve Learned
  6. 4. Introducing ClojureScript
    1. Understand ClojureScript
    2. Add ClojureScript Support
    3. Build the UI with Reagent
    4. Managing State with Re-Frame
    5. What You’ve Learned
  7. 5. Setting Up for Success
    1. Services
    2. ClojureScript Development Tools
    3. Embracing Re-Frame
    4. Multi-User with WebSockets
    5. Upgrading to Sente
    6. Events and Effects in Re-Frame
    7. What You’ve Learned
  8. 6. Planning Our Application
    1. What’s in Our MVP?
    2. The Elephant in the Room
    3. Data Modeling
    4. Adding User Management
    5. What You’ve Learned
  9. 7. Account Management
    1. Authorship
    2. Add Author’s Posts Page
    3. Account Customization
    4. Account Settings
    5. What You’ve Learned
  10. 8. Social Interaction
    1. Improving Posts
    2. Curating Posts
    3. What You’ve Learned
  11. 9. Deployment
    1. Unit Tests
    2. Package the Application
    3. What You’ve Learned
  12. 10. Exercises
    1. How to Read This Chapter
    2. Code Quality
    3. Feature Enhancements
    4. What You’ve Learned
  13. A1. Clojure 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. Reader Conditionals
    21. Summary
  14. A2. Editor Configuration
    1. Why Is Editor Integration So Important?
    2. General Configuration Tips
    3. VSCode + Calva
    4. IntelliJ IDEA + Cursive
    5. Emacs + Cider
    6. Vim
  15. A3. Working with EDN and Transit
    1. EDN
    2. Transit
  16. A4. Database Access
    1. Work with Relational Databases
    2. Use HugSQL
    3. Generate Reports
    4. What You’ve Learned
  17. A5. Writing RESTful Web Services with Liberator
    1. Using Liberator
    2. Defining Resources
    3. Putting It All Together
  18. A6. Leiningen Templates
    1. What’s in a Template
18.117.142.128