Tackle is an opinionated task management app, which helps Jay tackle all the stuff he has to do, elegantly and efficiently.
- import this repo to clone it (click on the + sign at the top right side of the page)
- duplicate .env.glue and rename to .env
Add glue remote
git remote add glue https://github.com/jay-joo-code/glue-root.git
git fetch --all
git switch -c glue-master glue/master
Pushing specific commits to Glue root
$ git checkout glue-master
$ git cherry-pick <commit-hash>
$ git push
Setting upstream to glue/master
$ git branch -u glue/master
Push to glue/master
git push glue glue-master:master
- Create a new Prisma Data Platform project
- Follow the steps to create a new project.
- Copy paste the connection strings:
DATABASE_URL=postgres://...?connection_limit=10&connect_timeout=30&pool_timeout=30&socket_timeout=30
DATABASE_URL_PROD=prisma://...
- Go to Google Cloud Console
- Create a new project
- Configure OAuth Consent Screen
- no scopes necessary for basic authentication
- Create an OAuth Client ID
https://console.cloud.google.com/apis/credentials
- Authorized JavaScript origins
- http://localhost:3000
- https://(app-name).vercel.app
- https://proddomain.com
- https://www.proddomain.com
- Authorized redirect URIs
- http://localhost:3000/api/auth/callback/google
- https://(app-name).vercel.app/api/auth/callback/google
- https://proddomain.com/api/auth/callback/google
- https://www.proddomain.com/api/auth/callback/google
- Glue components track usage by default (button click, input focus, debounced input value, etc)
- Setting the
NEXT_PUBLIC_GA_ID
env variable is required (usage tracking is enforced for Glue apps) - If GA reports don't show up, give it 2 days. It takes time for the usage report data to show up.
- Create a new Sentry project 2. Create a new project under Jay Joo Org (do not create a new org or Sentry account) 3. Select Next.js 4. Select alert me on every issue for Issue Alerts 5. Select all for Performance Alerts 6. Update project name 7. Add
NEXT_PUBLIC_SENTRY_DSN
to env variable (only required in production)
Notes
- Errors will only be sent to Sentry if env variable
BUILD_ENV
is set toproduction
- I should not create a new Sentry account or org, because the [email protected] Vercel account won't be able to integrate with a different Sentry account or org
- I also can't create multiple Vercel accounts to bypass this issue, because their phone number verification only allows for 1 account per phone number
- I could bypassing it by creating a new Github account and sign up a new Vercel account with that Github account, but honestly it's way too much work
- Make sure I have a Sentry project set up
- Create a new Vercel account with the project email
- Creating a new project in the same account leads to a sentry integration bug.
- Create a new Vercel project
- Make sure to add all environment variables
DATABASE_URL_PROD
should be saved asDATABASE_URL
. All other env vars have the same name as the local env vars.- Add
?schema=public&connection_limit=1
at the end of theDATABASE_URL
env variable to prevent the too many database connections error. - Add
&schema=public&connection_limit=1
instead if it's not the first url query.
- Vercel project > Settings > Integrations > Browse Marketplace > Add Sentry integration (follow through the steps in the popup window)
- Check that Sentry env variables were automatically added.
- Redeploy (build should succeed)
- (If you haven't yet) Add Vercel production endpoint to OAuth providers' redirect URLs.
Notes
- If the too many database connections error keeps coming up, just wait 30-60 minutes. The error should go away.
- a limitation of serverless functions is that they are super slow if the function hasn't been used in a while. this is known as a cold start
- too keep the load speeds of important pages low, we need to keep the lambda functions for those pages "warm"
- Better Uptime is used to periodically ping the page to keep the corresponding lambda function warm
- Create a Better Uptime account with the project email
- Add the pages that are important to the web app, such as frequently visited pages or conversion pages