{"id":18895904,"url":"https://github.com/echobind/bisonapp-versions","last_synced_at":"2026-02-28T02:30:13.680Z","repository":{"id":98471878,"uuid":"304125524","full_name":"echobind/bisonapp-versions","owner":"echobind","description":"A repo that contains unaltered code from a newly generated Bison app. Tagged by version.","archived":false,"fork":false,"pushed_at":"2020-10-22T19:08:23.000Z","size":314,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-16T12:13:56.107Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/echobind.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-14T20:16:29.000Z","updated_at":"2020-10-22T19:07:27.000Z","dependencies_parsed_at":"2023-06-01T21:45:33.353Z","dependency_job_id":null,"html_url":"https://github.com/echobind/bisonapp-versions","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/echobind%2Fbisonapp-versions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echobind%2Fbisonapp-versions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echobind%2Fbisonapp-versions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echobind%2Fbisonapp-versions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/echobind","download_url":"https://codeload.github.com/echobind/bisonapp-versions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239870520,"owners_count":19710737,"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-08T08:31:10.714Z","updated_at":"2026-02-28T02:30:13.613Z","avatar_url":"https://github.com/echobind.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" style=\"text-align:center\"\u003e\n  \u003cimg alt=\"Bison Logo\" src=\"https://user-images.githubusercontent.com/14339/89243835-f47e7c80-d5d2-11ea-8d8d-36202227d0ec.png\" /\u003e\n  \u003ch1\u003eBisonVersions\u003c/h1\u003e\n  \u003cp\u003e\u003cimg alt=\"CI STATUS\" src=\"https://github.com/\u003cOWNER\u003e/\u003cREPOSITORY\u003e/workflows/main/badge.svg\"/\u003e\u003c/p\u003e\n\u003c/p\u003e\n\n## Conventions\n\n- Don't copy/paste files, use generators and Hygen templates.\n- Use a single command to run Next, generate Nexus types, and GraphQL types for the frontend.\n- Don't manually type GraphQL responses... use the generated query hooks from GraphQL Codegen.\n- All frontend pages are static by default. If you need something server rendered, just add `getServerSideProps` like you would in a any Next app.\n\n## Tradeoffs\n\n- To reduce complexity, Bison avoids yarn workspaces and separate top-level folders. Think of your app more like a traditional monolith, but with a separate frontend and API. This means that folders may be a little more \"intermingled\" than your used to.\n\n---\n\n# Getting Started\n\nClone this repo.\n\n## Configure Vercel\n\nMake sure you have a Vercel account.\n\nTo run the app locally:\n\n1. Run `vercel` or `vc`\n1. Choose the appropriate scope / organization. If you don't see the organization, ask someone to invite you.\n1. If this is a new project, keep all the build defaults. If this is an existing project, choose \"link to an existing project\" when prompted.\n1. If setting up an existing project, run `vc env pull`. This will sync your dev env vars and save them to .env.\n\n## Setup the database\n\n1. Setup your local database with `yarn db:setup`. You'll be prompted to create it if it doesn't already exist:\n\n![Prisma DB Create Prompt](https://user-images.githubusercontent.com/14339/88480536-7e1fb180-cf24-11ea-85c9-9bed43c9dfe4.png)\n\nIf you'd like to change the database name or schema, change the DATABASE_URL in `prisma/.env`.\n\n# Run the app\n\nFrom the root, run `yarn dev`. This:\n\n- runs `next dev` to run the frontend and serverless functions locally\n- starts a watcher to generate the Prisma client on schema changes\n- starts a watcher to generate TypeScript types for GraphQL files\n\n# Recommended Dev Workflow\n\nYou're not required to follow this exact workflow, but we've found it gives a good developer experience.\n\n## API\n\n1. Generate a new GraphQL module using `yarn g:graphql`.\n1. Write a type, query, input, or mutation using [Nexus](https://nexusjs.org/guides/schema)\n1. Create a new request test using `yarn g:test:request`\n1. Run `yarn test` to start the test watcher\n1. Add tests cases and update schema code accordingly\n1. The GraphQL playground (localhost:3000/api/graphql) can be helpful to form the proper queries to use in tests.\n1. `types.ts` and `api.graphql` should update automatically as you change files. Sometimes it's helpful to open these as a sanity check before moving on to the frontend code.\n\n## Frontend\n\n1. Generate a new page using `yarn g:page`\n1. Generate a new component using `yarn g:component`\n1. If you need to fetch data in your component, use a cell. Generate one using `yarn g:cell` (TODO)\n1. To generate a typed GraphQL query, simply add it to the component or page:\n\n```ts\nexport const SIGNUP_MUTATION = gql`\n  mutation signup($data: SignupInput!) {\n    signup(data: $data) {\n      token\n      user {\n        id\n      }\n    }\n  }\n`;\n```\n\n5. Use the newly generated types from codegen instead of the typical `useQuery` or `useMutation` hook. For the example above, that would be `useSignupMutation`. You'll now have a fully typed response to work with!\n\n```tsx\nimport { User, useMeQuery } from './types';\n\n// adding this will auto-generate a custom hook in ./types\nexport const ME_QUERY = gql`\n  query me {\n    me {\n      id\n      email\n    }\n  }\n`;\n\n// an example of taking a user as an argument with optional attributes\nfunction noIdea(user: Partial\u003cUser\u003e) {\n  console.log(user.email);\n}\n\nfunction fakeComponent() {\n  // use the generated hook\n  const { data, loading, error } = useMeQuery();\n\n  if (loading) return \u003cLoading /\u003e;\n\n  // data.user will be fully typed\n  return \u003cSuccess user={data.user}\u003e\n}\n```\n\n# Set up CI\n\nThis project uses GitHub actions for CI.\n\nTo ensure your project can run on CI for E2E tests, you need to add a few ENV vars to GitHub Secrets.\n\n![ENV Vars](https://user-images.githubusercontent.com/14339/89292945-228fab00-d62b-11ea-90c2-4198dfcf30f1.png)\n\nThe Vercel project and org id, can be copied from `.vercel/project.json`. You can generate a token from https://vercel.com/account/tokens.\n\n# Setup Preview / Production Deployments\n\nAfter tests pass, the app will deploy to Vercel. By default, every push creates a preview deployment. Merging to the main branch will deploy to staging, and pushing to the production branch will deploy to production. To configure deployments:\n\n- Make sure you've set the variables above\n- Configure the branches in the workflow:\n  ```\n  ## For a typical JAMstack flow, this should be your default branch.\n  ## For a traditional flow that auto-deploys staging and deploys prod is as needed, keep as is\n  if: github.ref != 'refs/heads/production' # every branch EXCEPT production\n  ```\n\n# FAQ\n\n## Where are the generated types?\n\nTypeScript Types for GraphQL types, queries, and mutations are generated automatically and placed in `./types.ts`. To use these in your code, import like so:\n\n## My types aren't working, even though they are in ./types.ts\n\nTry reopening VSCode.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechobind%2Fbisonapp-versions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fechobind%2Fbisonapp-versions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fechobind%2Fbisonapp-versions/lists"}