Skip to content

Instantly share code, notes, and snippets.

@kwrooijen
Created March 23, 2020 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwrooijen/fa52c9f9fa1c582e06321f3198db7397 to your computer and use it in GitHub Desktop.
Save kwrooijen/fa52c9f9fa1c582e06321f3198db7397 to your computer and use it in GitHub Desktop.

Duct

Introduction

Overview

Some info on what Duct is, what it tries to solve, high level how it solves it. Purpose of Duct. Other "high level overview" information. Mention Integrant here.

Installation

Install Lein, run lein new duct my-app. Show available options (in a table?). Other necessary explanations.

Community

A link to #Clojurians Slack #Duct


Concepts

Clojure Keywords

Explain how Keywords, Namespacing, Inheritance, Hierarchy, Multimethods work.

Integrant

When I started Duct I had no idea about Integrant, I thought Duct was its own thing. Of course I was extremely new to Clojure at the time so it's most likely mostly my own fault. But we should make it clear that the reader must learn Integrant, and understand its concepts.

Profile System

Explain how the profile system works. Why it's useful. How to use it. Base profile is the core of your system.

Module System

Explain how the module system works. How it differs from the keys inside base profile. Examples of what modules could do (reference an existing duct module and it's purpose).

Duct Hierarchy

Explain Duct hierarchy. The :duct/daemon and other keys. How you can use duct_hierarchy.edn.

Boundaries

I'm not too familiar with this concept. But we'd probably want to write something up. As well as a working example of how you would, for example, create a DB boundary and test it.

Duct readers

Show all available readers and explain them.

#duct/env #duct/include #duct/resource #duct/displace #duct/replace #ig/ref #ig/refset


Getting Started

Prerequisite

Check installation section, setup postgres.

Setup

lein duct new, (dev) (go), explain what you can do in the dev environemnt. access config and system, call (restart) and (auto-restart) etc

Ring Handler

Create a simple ring handler using ataraxy. Just returns static data for now

Migrations

Create a database connection and add a migration. Explain how lein run works, and how it connects to the keyword hierarchy.

lein run :duct/migrator

Boundary

Create a Boundary to Query something (users? different topic?)

Handler SQL Interface

Add querying to a handler, handler references the db.

Testing

Write some tests, how to start the Duct system for testing.

Frontend

Write setting up a frontend app. Maybe we should have a opinionated default for the +cljs option? re-frame for example? I also prefer shadow-cljs over figwheel personally.

Create a release

Create an uberjar with lein and run it

Advanced

Creating a Profile

Short guide to create a custom profile.

Creating a Module

Short guide to create a custom module. Maybe something to generate routes with?


Modules

List of all available modules and their purpose (e.g. module-sql adds HikariCP + Ragtime, for SQL connection and migrations)

--- Question: Maybe these modules should have their own guide page on cljdoc? The main Duct cljdoc could link to them. (But there should be a short description here at the very least)

module-cljs module-logging module-sql module-web

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