Skip to main content

Snitch Artifacts

Snitch is modular by design, providing several artifacts that can be used independently based on your needs. All artifacts are published to Maven Central.

Core Artifacts

snitch-bootstrap

implementation("io.github.memoizr:snitch-bootstrap:4.0.1")

This is the main artifact most users should depend on. It includes everything needed to create a complete web service using Snitch with Undertow as the server and Gson for JSON parsing.

Dependencies: Includes core, gsonparser, and undertow modules.

snitch-core

implementation("io.github.memoizr:snitch-core:4.0.1")

The core module contains the essential building blocks of Snitch:

  • DSL for defining routes and handlers
  • Parameter definition and validation framework
  • Middleware and conditions system
  • Documentation generation engine

This module is server-agnostic and doesn't include any specific JSON parsing implementation.

snitch-types

implementation("io.github.memoizr:snitch-types:4.0.1")

A lightweight module containing the basic types and interfaces used across the Snitch ecosystem. This module has minimal dependencies and can be used in your domain model to avoid pulling in the entire Snitch framework.

Extensions and Implementations

snitch-undertow

implementation("io.github.memoizr:snitch-undertow:4.0.1")

Provides Undertow server integration for Snitch. Undertow is a flexible, high-performance web server by JBoss that serves as the default server implementation for Snitch.

snitch-gsonparser

implementation("io.github.memoizr:snitch-gsonparser:4.0.1")

Implements JSON parsing and serialization using Google's Gson library. This module allows Snitch to convert between JSON and Kotlin objects.

snitch-coroutines

implementation("io.github.memoizr:snitch-coroutines:4.0.1")

Adds Kotlin Coroutines support to Snitch, allowing you to define suspending handlers and use the full power of Kotlin's asynchronous programming features.

Requires the -Xcontext-receivers compiler flag:

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + "-Xcontext-receivers"
}
}

snitch-auth

implementation("io.github.memoizr:snitch-auth:4.0.1")

Provides authentication and authorization capabilities for Snitch applications, including support for JWT tokens, role-based access control, and security middleware.

snitch-validation

implementation("io.github.memoizr:snitch-validation:4.0.1")

Provides integration with Hibernate Validator (Jakarta Bean Validation), allowing you to use standard validation annotations in your request/response models.

snitch-tests

testImplementation("io.github.memoizr:snitch-tests:4.0.1")

Contains testing utilities and a fluent DSL for writing integration tests for Snitch services. Includes assertion helpers and logging configuration for tests.

snitch-shank

implementation("io.github.memoizr:snitch-shank:4.0.1")

Integrates the Shank dependency injection library with Snitch, providing a lightweight, code-generated DI solution for your applications.

snitch-exposed

implementation("io.github.memoizr:snitch-exposed:4.0.1")

Integrates the Exposed SQL library with Snitch, providing type-safe database access with automatic object mapping and transaction management.

snitch-exposed-h2

implementation("io.github.memoizr:snitch-exposed-h2:4.0.1")

Provides specialized support for H2 databases with Snitch and Exposed, ideal for development and testing environments.

snitch-exposed-postgres

implementation("io.github.memoizr:snitch-exposed-postgres:4.0.1")

Provides specialized support for PostgreSQL databases with Snitch and Exposed, suitable for production environments.

snitch-kofix

testImplementation("io.github.memoizr:snitch-kofix:4.0.1")

Testing utilities for property-based testing and mocking in Snitch applications.

Choosing the Right Dependencies

For most applications, the bootstrap module is sufficient:

dependencies {
implementation("io.github.memoizr:snitch-bootstrap:4.0.1")
}

For applications requiring coroutines:

dependencies {
implementation("io.github.memoizr:snitch-bootstrap:4.0.1")
implementation("io.github.memoizr:snitch-coroutines:4.0.1")
}

For applications with database access:

dependencies {
implementation("io.github.memoizr:snitch-bootstrap:4.0.1")
implementation("io.github.memoizr:snitch-exposed:4.0.1")
implementation("io.github.memoizr:snitch-exposed-postgres:4.0.1") // For production
implementation("io.github.memoizr:snitch-exposed-h2:4.0.1") // For testing
}

For applications requiring authentication:

dependencies {
implementation("io.github.memoizr:snitch-bootstrap:4.0.1")
implementation("io.github.memoizr:snitch-auth:4.0.1")
}

For a more customized setup using a different JSON library or web server, you can use just the core module and add your own implementations:

dependencies {
implementation("io.github.memoizr:snitch-core:4.0.1")
// Add your preferred JSON parser and server
}

Artifact Breakdown

ArtifactPurposeKey Features
snitch-bootstrapComplete starter packageAll-in-one solution for getting started quickly
snitch-coreCore frameworkRoute definitions, handlers, parameter validation, middleware
snitch-typesCommon typesBasic types used throughout the framework
snitch-undertowServer implementationIntegrates with Undertow web server
snitch-gsonparserJSON parsingHandles JSON serialization/deserialization with Gson
snitch-coroutinesAsync supportKotlin Coroutines integration for asynchronous handlers
snitch-authAuthenticationAuthentication and authorization support
snitch-validationEnhanced validationHibernate Validator integration
snitch-testsTesting utilitiesTesting DSL and assertion helpers
snitch-shankDependency injectionLightweight DI integration
snitch-exposedDatabase accessCore database integration with Exposed
snitch-exposed-h2H2 databaseH2 database support for development and testing
snitch-exposed-postgresPostgreSQL databasePostgreSQL support for production use
snitch-kofixTesting utilitiesProperty-based testing and mocking