Skip to content

BearStudio/cowat

Repository files navigation

Create T3 App

This is a T3 Stack project bootstrapped with create-t3-app.

Dependencies installation

pnpm install

Usage with Slack

  1. Update .env file with the SLACK_CLIENT_ID and SLACK_CLIENT_SECRET values form the Slack App Credentials page

Note You should be a collaborator of the application to get the Slack id and secret. Ask @yoannfleurydev for access if you haven't one yet.

Note Following commands are required only one time or when the certificate expires.

  1. Install mkcert brew install mkcert
  2. If you use Firefox brew install nss
  3. mkcert -install
  4. pnpm ssl:generate (will generate certificate that are .gitignored)
  5. pnpm dev
  6. Open https://localhost:3001 and enjoy HTTPS for localhost

Connect to local database

Connection

To connect to the local database, you should change the following environment variables:

  • DOCKER_DATABASE_PORT : postgres docker port.
  • DOCKER_DATABASE_NAME : name of the postgres db.
  • DOCKER_DATABASE_USERNAME : username to connect to the postgres db.
  • DOCKER_DATABASE_PASSWORD : password to connect to the postgres db.
  • DOCKER_DATABASE_IP : local IP address of the host.

If you're creating your own database (following instructions in the next section), you can choose all variables as they will be used both to create the docker container and to connect to it.

If you're connecting to someone else database, write down the same variables as the host.

Creation

If you want to use your own local database, you should first write down the environment variables (cf. Connection section)

Prerequisites:

Then, launch the postgres image with:

# if it's your first time you'll have to initialize it with
pnpm dk:init
# else you can just use
pnpm dk:start

(you can check quickly if the container is running with: docker ps)

Connect with several accounts in dev

To connect with a second account in dev mode, you can update your GOOGLE_AUTHORIZED_DOMAIN environment variable by simply adding to the string the domain of your personal email.

For exemple, you could have '@bearstudio.fr,@gmail.com'.

You also have to update your GOOGLE_CLIENT_ID and your GOOGLE_CLIENT_SECRET, replace them with the value of the Google Cloud Cowat-dev project credentials.

What's next? How do I make an app with this?

We try to keep this project as simple as possible, so you can start with just the scaffolding we set up for you, and add additional things later when they become necessary.

If you are not familiar with the different technologies used in this project, please refer to the respective docs. If you still are in the wind, please join our Discord and ask for help.

Learn More

To learn more about the T3 Stack, take a look at the following resources:

You can check out the create-t3-app GitHub repository — your feedback and contributions are welcome!

How do I deploy this?

  1. Switch to the develop branch
  2. Check for migrations (from Neon)
  3. Create Snapshot to back up the schema in case of problems
  4. Install dependency (pnpm install)
  5. Put the production URL in your .env
  6. Migrate database to production (db:migrate:deploy)
  7. Go to the main branch
  8. Do a rebase on develop
  9. Copy the link into OnePassword (“🚨 DEPLOY COWAT TO PRODUCTION 🚨”) and open it in your browser
  10. Otherwise, go to Vercel, then to settings > git > deploy hooks to get the link
  11. Check the build on the link and the deployment (make sure everything is going smoothly).
  12. Verify that everything is functioning on production.

About

Resources

Contributing

Stars

Watchers

Forks

Contributors