{"id":19065002,"url":"https://github.com/joist-orm/joist-sample","last_synced_at":"2026-03-08T18:34:54.447Z","repository":{"id":49738999,"uuid":"431267685","full_name":"joist-orm/joist-sample","owner":"joist-orm","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-16T13:05:29.000Z","size":1942,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-09T05:02:59.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/joist-orm.png","metadata":{"files":{"readme":"README.markdown","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":"2021-11-23T22:07:28.000Z","updated_at":"2024-05-16T13:05:33.000Z","dependencies_parsed_at":"2023-01-18T12:45:30.725Z","dependency_job_id":"6a861874-77f8-4a7f-8d8d-dd0e1d086a6d","html_url":"https://github.com/joist-orm/joist-sample","commit_stats":null,"previous_names":["joist-orm/joist-sample"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joist-orm%2Fjoist-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joist-orm%2Fjoist-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joist-orm%2Fjoist-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joist-orm%2Fjoist-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joist-orm","download_url":"https://codeload.github.com/joist-orm/joist-sample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243043263,"owners_count":20226790,"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-09T00:48:10.185Z","updated_at":"2026-03-08T18:34:54.407Z","avatar_url":"https://github.com/joist-orm.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Joist Sample App\n\nThis is a bare minimum sample app using Joist as an ORM.\n\nThere are two domain objects, `Author` and `Book`, and a single test, `Author.test.ts`.\n\nThere are no examples of business logic or Joist's various features; for those see the docs.\n\n## Setup\n\n- `yarn`\n- `yarn db`\n- `yarn test`\n\n## Example Workflow\n\nA typical workflow for adding a new entity looks like:\n\n- Run `yarn pg-new-migration \"add publisher\"`\n- Edit the `migrations/...add-publisher.ts` file and add\n  ```typescript\n  createEntityTable(pgm, \"publishers\", {\n    name: { type: \"text\", notNull: true },\n  });\n  ```\n- Run `yarn joist-migrate`\n  - If you change your migration, and want to re-apply it from scratch, run `docker-compose exec db ./reset.sh`\n- Run `yarn joist-codegen`\n- Copy/paste the `Author.test.ts` and write a test for `Publisher`\n\n## Steps Taken to Setup This Repo\n\nTODO: Automate this with more, probably with mrm.\n\n- Install basic prettier/TypeScript/jest.\n\n  ```shell\n  npm install -g mrm\n  npm install -g \\\n    @homebound/mrm-tasks-prettier \\\n    @homebound/mrm-tasks-gitignore \\\n    @homebound/mrm-tasks-typescript\n  mrm @homebound/mrm-tasks-prettier \\\n    @homebound/mrm-tasks-gitignore \\\n    @homebound/mrm-tasks-typescript\n  ```\n\n- Copy/paste `migrations/...author.ts`\n- Add `joist-orm`, `joist-migration-utils`, `joist-codegen` to `package.json`\n- Copy/paste `run.sh`\n- Copy/paste `env/local.env`, changed port\n- Add `ts-node` to `package.json`\n  - Should come from `mrm`?\n- Add `joist-migrate` script, run it\n- Add `joist-codegen` script, run it\n- Add `Author.test.ts`\n- Add `env-cmd` to `package.json`\n- Add `pg-migration` to `package.json`\n- Add `.gitattributes` to suppress diffs on generated files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoist-orm%2Fjoist-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoist-orm%2Fjoist-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoist-orm%2Fjoist-sample/lists"}