{"id":16526480,"url":"https://github.com/jmmv/iii-iv","last_synced_at":"2025-03-21T09:30:56.875Z","repository":{"id":158298475,"uuid":"613120448","full_name":"jmmv/iii-iv","owner":"jmmv","description":"Opinionated framework for web services","archived":false,"fork":false,"pushed_at":"2023-12-03T16:37:37.000Z","size":303,"stargazers_count":30,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-12T17:28:05.240Z","etag":null,"topics":["axum","framework","rust","sqlx","web"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmmv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-12T23:23:56.000Z","updated_at":"2024-09-25T07:22:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"6355cfde-1080-47fb-b7f5-6896cc8eb2af","html_url":"https://github.com/jmmv/iii-iv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmmv%2Fiii-iv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmmv%2Fiii-iv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmmv%2Fiii-iv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmmv%2Fiii-iv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmmv","download_url":"https://codeload.github.com/jmmv/iii-iv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221813482,"owners_count":16884835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axum","framework","rust","sqlx","web"],"created_at":"2024-10-11T17:28:22.118Z","updated_at":"2024-10-28T09:42:55.685Z","avatar_url":"https://github.com/jmmv.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# III-IV: Opinionated framework for web services\n\nIII-IV is a rudimentary and _very_ opinionated framework to build web services\nin Rust.  This framework is a thin layer over other well-known crates such as\n`axum` and `sqlx`.  As such, it mostly provides boilerplate code necessary to\ntie everything together, but it also forces code to be structured in a way\nthat permits fast unit testing.\n\nAt the moment, all of the functionality and structure provided here are geared\ntowards the way **I, @jmmv**, have been building these web services.  The vast\nmajority of the code in this repository comes from those services verbatim and\nis quite ad-hoc.  So... take this as a disclaimer: _I don't think that the\ncode in here will be readily usable for your use case.  This is why there are\nno formal releases nor plans to make them, and there are zero promises about\nbackwards API compatibility: there will be churn._\n\nThat said, if you find this useful for any reason and want to use portions of\nthe code anyway, great!  You will have to pull the code from Git, read the doc\ncomments attached to the various crates and modules, and I strongly recommend\nthat you pin your usage to a specific commit.  I'll be happy to consider\ncontributions if you have any.\n\n## Key characteristics\n\n*   High-level transaction-based database abstraction, which provides a\n    mechanism to implement the exact same service logic against PostgreSQL and\n    SQLite.\n*   Use of PostgreSQL in deployment builds and SQLite during testing, thanks to\n    the prior point.\n*   Proven foundations: `sqlx` for database access, `axum` as the web framework,\n    and `tokio` as the async runtime.\n*   Configuration via environment variables.\n*   Optional deployment to Azure functions.\n\n## What's in the name?\n\nThe name III-IV refers to the number of layers that services using this\nframework need to implement.  The 3 is about the `rest`, `driver`, and `db`\nlayers, and the 4 is about the cross-layer data `model` module.  You can read\nthe name as \"three-four\".\n\n## Installation\n\nAs mentioned in the introduction above, there are no formal releases of this\nframework and there are no plans to make them.  You will have to depend on this\ncode straight from this Git repository.\n\nThe following can get you started.  Make sure to pick the latest commit\navailable in this repository to pin your dependencies to.  Do _not_ rely on\nthe `main` branch.\n\n```toml\n[dependencies.iii-iv-core]\ngit = \"https://github.com/jmmv/iii-iv.git\"\nrev = \"git commit you based your work off\"\nfeatures = [\"postgres\"]\n\n[dev-dependencies.iii-iv-core]\ngit = \"https://github.com/jmmv/iii-iv.git\"\nrev = \"git commit you based your work off\"\nfeatures = [\"sqlite\", \"testutils\"]\n```\n\n## Example\n\nThe `example` directory contains a full application built using this framework.\nThe application implements a simple REST interface for a key/value store.  The\nserver is backed by PostgreSQL in the binary build, but tests are backed by\nSQLite.  This allows tests to run at lightning speeds and with zero setup, which\nis a primary goal of this framework.\n\nThe code of the application is overly verbose: you will notice that there are\nmany small files.  This is to make room for tests at every layer (which you will\nalso find in the template), because the tests tend to grow up very large.\n\nThis example is meant to be usable as a template for new services.  You can\ncopy/paste it into a new crate, delete all of the key/value store logic, and\nadd your own.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmmv%2Fiii-iv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmmv%2Fiii-iv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmmv%2Fiii-iv/lists"}