Web site for string band Ten Cent Teacakes
To save time for CI and not bother to commit if lint / ts checks fail.
cp git-pre-commit .git/hooks/
mv .env_template .env
.env
npm run prisma:init
to add the tables from the prisma schema to your dbReference: https://supabase.com/docs/guides/integrations/prisma
migration
queries
mv .env.local_template .env.local
npx @sentry/wizard -i nextjs
(and follow instructions)SENTRY_DSN
value to .env.local
npm run test:ui
npm run test:db:migrate
npm run test:api
npm run test:db:migrate
npm run cypress:run
For Vercel / Cypress, the following variables are needed as GitHub secrets (repo -> settings -> secrets -> actions -> repository secrets):
VERCEL_TOKEN
(https://vercel.com/account/tokens)CYPRESS_LOCALSTORAGE_KEY
(For more secure Cypress user. Must match the value in Vercel)AUTH0_USERNAME
(some email that exists in Auth0 instance)AUTH0_PASSWORD
(password for the above email)AUTH0_DOMAIN
(example: xyz.us.auth0.com
)AUTH0_CLIENT_ID
(from Auth0 Application settings)AUTH0_CLIENT_SECRET
(from Auth0 Application settings)AUTH0_AUDIENCE
(should match the one in tenant -> settings -> API Authorization Settings)AUTH0_SCOPE
(value should probably be "openid profile email"
)SUPABASE_URL
and SUPABASE_KEY
(from .env.local
)REVALIDATION_SECRET
(Must match value for Vercel and CircleCI)Note: Cypress is run as a Github action instead of through CircleCI so that it can depend on branch deploy success, and use the branch deploy url.
main
branch restrictionsSince anything pushed / merged to main
will be live right away, enact these restrictions
main
that you can't push directly ("Require a pull request before merging").main
that uses CircleCI and Vercel checks as requirement to merge ("Require status checks to pass before merging")npx vercel link
SENTRY_AUTH_TOKEN
(from .sentryclirc
)SENTRY_DSN
(from .env.local
)CYPRESS_LOCALSTORAGE_KEY
(Must match value in GitHub)REVALIDATION_SECRET
(Must match value in GitHub and CircleCI)DATABASE_URL
(from .env
)AUTH0_*
(from .env.local
)SUPABASE_*
(from .env.local
)APP_ENV
(set to test
for preview and development; don't set for production).circleci/config.yml
fileDATABASE_URL
environment variable (https://circleci.com/docs/2.0/env-vars/)DB_BASEURL
environment variable (DB url before port; example: DATABASE_URL="postgres://postgres:<password>@db.<db id>.supabase.co
). Needed because of difference between migration endpoint vs. queries endpoint.CYPRESS_INSTALL_BINARY
environment variable, set to 0 (https://docs.cypress.io/guides/getting-started/installing-cypress#Environment-variables)REVALIDATION_SECRET
(Must match value in GitHub and Vercel)For each preview deploy git branch, before pushing to GitHub:
Update https://manage.auth0.com/dashboard/us/ten-cent-teacakes-dev/applications/<client id>/settings
-> Application URIs -> Allowed Callback URLs
with
https://ten-cent-teacakes-git-<branch name>-bonnie.vercel.app/api/auth/callback
Update https://vercel.com/bonnie/ten-cent-teacakes/settings/environment-variables
AUTH0_BASE_URL (for Preview / Development)
with
https://ten-cent-teacakes-git-<branch name>-bonnie.vercel.app/