Liking cljdoc? Tell your friends :D

parenthesin/components

Clojars Project

Common components used on the Parenthesin's service templates.

Components

config/aero

Reads aero config file on resources/config.edn.
Gets the current profile on enviroment var SYSTEM_ENV

Libraries

db/jdbc-hikari

Depends on config component to read connection info data

Libraries

In addition, you will need to add dependencies for the JDBC drivers you wish to use for whatever databases you are using. For example:

MySQL: com.mysql/mysql-connector-j {:mvn/version "latest-version"}
PostgreSQL: org.postgresql/postgresql {:mvn/version "latest-version"}
Microsoft SQL Server: com.microsoft.sqlserver/mssql-jdbc {:mvn/version "latest-version"}
Sqlite: org.xerial/sqlite-jdbc {:mvn/version "latest-version"}
(always search for latest version)

http/clj-http

Has some mock implementations for tests

Libraries

router/reitit-malli

Has some presets, handlers and configs to use malli as input/output validations for routes

Libraries

router/reitit-schema

Has some presets, handlers and configs to use schema as input/output validations for routes

Libraries

server/reitit-pedestal-jetty

Depends on one of each type of the components [config, db, http, router] and starts a webserver with all components injected in the http context.
Gets the web port from the config file config file or the enviroment var PORT

Libraries

Helpers

helpers/state-flow/server/pedestal

Extract io.pedestal.http/service-fn from state-flow context and calls io.pedestal.test/response-for to simulate and http request on the system server.
Check system integration tests to see how to use this function.

helpers/state-flow/db

Exposes function to direclty execute sql commands on the state-flow context db.
Check db integration tests to see how to use these functions.

helpers/state-flow/http

Exposes functions to set/get http mock state.
Check http integration tests to see how to use these functions.

helpers/logs

Setup function with preset appender and nice macro to log over timbre/log!

helpers/malli

Function to start / stop instrumentation as clojure.test/use-fixtures

helpers/migrations

Wrapper over migratus to create an CLI based API.
Depends on aero and jdbc to read and connect to the database.

Documentation

If you want to know more about the components in general and each component or helper implementation, check the documentation. Contributions and suggestions are welcome.

Contributing

See CONTRIBUTING.md.

Projects using this library

These projects are using the library, they can be used as templates or source of documentation of how use the components.

Features

System

  • schema Types and Schemas
  • malli High-performance Data-Driven Data Specification Library for Clojure/Script.
  • component System Lifecycle and Dependencies
  • pedestal Http Server
  • reitit Http Routes System
  • clj-http Http Client
  • cheshire JSON encoding
  • aero Configuration file and enviroment variables manager
  • timbre Logging library
  • next-jdbc JDBC-based layer to access databases
  • hikaricp A solid, high-performance, JDBC connection pool at last
  • tools.build Clojure builds as Clojure programs
  • deps-deploy A Clojure library to deploy your stuff to clojars

Tests & Checks

License

Copyright © 2024 Parenthesin

This is free and unencumbered software released into the public domain. For more information, please refer to http://unlicense.org

Can you improve this documentation? These fine people already did:
Rafael Delboni & João Augusto Lissoni Lanjoni
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close