{"id":19360516,"url":"https://github.com/uber5/u5-domain","last_synced_at":"2025-10-23T18:34:04.690Z","repository":{"id":75621646,"uuid":"62668733","full_name":"Uber5/u5-domain","owner":"Uber5","description":null,"archived":false,"fork":false,"pushed_at":"2016-07-15T15:52:33.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T19:19:38.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Uber5.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}},"created_at":"2016-07-05T20:49:36.000Z","updated_at":"2016-07-06T12:34:29.000Z","dependencies_parsed_at":"2023-06-07T03:45:15.467Z","dependency_job_id":null,"html_url":"https://github.com/Uber5/u5-domain","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uber5%2Fu5-domain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uber5%2Fu5-domain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uber5%2Fu5-domain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uber5%2Fu5-domain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Uber5","download_url":"https://codeload.github.com/Uber5/u5-domain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240475239,"owners_count":19807292,"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":[],"created_at":"2024-11-10T07:18:26.656Z","updated_at":"2025-10-23T18:33:59.654Z","avatar_url":"https://github.com/Uber5.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What?\n\nThe idea is to describe a domain (classes, their properties and relationships)\nfor a business application, so that other artefacts can be deduced from it.\n\nThis is probably not going to be a generic tool, but may be useful in our\ncontext / on our stack.\n\nThe aspects we try to cover here:\n\n- persistence\n- API\n- validation\n\n# Example\n\nSay, we need orders and order items in our domain model. We may describe the\ndomain model as follows:\n\n```\nconst orderType = new DomainType({\n  name: 'Order',\n  fields: {\n    id: DomainID,\n    orderedByName: { type: DomainString, required: true },\n    orderedByEmail: {\n      type: DomainString,\n      validate: v =\u003e /\\S+@\\S+\\.\\S+/.test(v) // TODO: don't validate email addresses like this in real life\n    }\n    tipInCents: DomainInt\n  },\n  belongsTo: {\n    shop: 'Shop'\n  }\n})\n\n// TODO: complete the example\n\nconst domainSchema = new DomainSchema([ orderType, shopType ])\nimport * as graphql from 'graphql'\nconst graphQLOrderType = domain.toGraphQLSchema(graphql, domainSchema)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuber5%2Fu5-domain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuber5%2Fu5-domain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuber5%2Fu5-domain/lists"}