Giter VIP home page Giter VIP logo

components's Introduction

parenthesin/components

Clojars Project

Common components used on the Parenthesin's service templates.

Components

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

Libraries

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)

Has some mock implementations for tests

Libraries

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

Libraries

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

Libraries

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

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

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

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

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

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

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

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.

Contributing

Tests

To run unit tests inside ./test/unit

clj -M:test :unit

To run integration tests inside ./test/integration

clj -M:test :integration

To run all tests inside ./test

clj -M:test

To generate a coverage report

clj -M:test --plugin kaocha.plugin/cloverage

Lint and format

clj -M:clojure-lsp format
clj -M:clojure-lsp clean-ns
clj -M:clojure-lsp diagnostics

Build / Deploy

  # Build
  clojure -T:build jar :version '"0.1.0"'
  # Deploy
  env CLOJARS_USERNAME=username CLOJARS_PASSWORD=clojars-token clojure -T:build deploy :version '"0.1.0"'

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 © 2023 Parenthesin

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

components's People

Contributors

rafaeldelboni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

wilsilva vloth

components's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.