{"id":19988529,"url":"https://github.com/bespoyasov/rule-based-data-validation","last_synced_at":"2026-03-06T22:02:18.796Z","repository":{"id":83274783,"uuid":"446576232","full_name":"bespoyasov/rule-based-data-validation","owner":"bespoyasov","description":"Declarative data validation made with rule-based approach and functional programming.","archived":false,"fork":false,"pushed_at":"2025-01-25T14:15:25.000Z","size":17,"stargazers_count":17,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-28T23:48:41.403Z","etag":null,"topics":["declarative","domain-driven-design","functional-programming","rule-based","typescript","validation"],"latest_commit_sha":null,"homepage":"https://bespoyasov.ru/showcase/declarative-validation/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bespoyasov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-01-10T20:45:00.000Z","updated_at":"2025-06-19T22:33:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"5c2f95d9-5451-4692-9603-ff1bf9df6d29","html_url":"https://github.com/bespoyasov/rule-based-data-validation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bespoyasov/rule-based-data-validation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bespoyasov%2Frule-based-data-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bespoyasov%2Frule-based-data-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bespoyasov%2Frule-based-data-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bespoyasov%2Frule-based-data-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bespoyasov","download_url":"https://codeload.github.com/bespoyasov/rule-based-data-validation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bespoyasov%2Frule-based-data-validation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30200756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["declarative","domain-driven-design","functional-programming","rule-based","typescript","validation"],"created_at":"2024-11-13T04:43:19.582Z","updated_at":"2026-03-06T22:02:18.763Z","avatar_url":"https://github.com/bespoyasov.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Declarative validation in rule-based approach and functional programming\n\n[Sample frontend app](https://bespoyasov.ru/showcase/declarative-validation/) with HTML-form data validation made using a rule-based approach, written in TypeScript and (almost pure) functional programming paradigm.\n\n## About Project\n\nClient data validation is complicated. It requires different types of logic to work together, and sometimes difficult to distinguish those types properly. This can result in a messy code.\n\nThe rule-based approach helps to separate domain, UI, and infrastructure logic. It makes the validation rules independent from the other code and reusable in different projects.\n\nRead more about this approach in my posts:\n\n- 🇬🇧 [Declarative validation in rule-based approach](https://dev.to/bespoyasov/declarative-data-validation-with-functional-programming-and-rule-based-approach-22a4)\n- 🇷🇺 [Декларативная валидация данных в rule-based стиле](http://bespoyasov.ru/blog/declarative-rule-based-validation/)\n\n## App Example\n\nFor this post, I created a sample app—Mars colonizer application form.\n\nThis form contains fields with different data types (name, date, email, phone, password), different sets of rules and relationships, and even interdependent rules.\n\n[Check out the form](https://bespoyasov.ru/showcase/declarative-validation/) yourself to see how it's working!\n\n## Source Code\n\nAlthough the main idea is explained in the posts, I left some comments in the source code. Check out the [validation rules](https://github.com/bespoyasov/rule-based-data-validation/blob/main/src/application/validation.ts) and the [validation infrastructure code](https://github.com/bespoyasov/rule-based-data-validation/blob/main/src/services/validation.ts) to feel the idea behind the rule-based validation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbespoyasov%2Frule-based-data-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbespoyasov%2Frule-based-data-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbespoyasov%2Frule-based-data-validation/lists"}