A global Remix app with localization and translations that uses multi-region CockroachDB and is deployed on Fly.
- Web Framework - 💿 Remix
- Database - 🪳 CockroachDB
- Database ORM - △ Prisma
- Styling - 🍃 Tailwind CSS
- UI Components - 🧱 shadcn/ui and Radix
- Hosting - 🎈 Fly
This application uses Prisma to manage our database.
- Update the
DATABASE_URL
environment variable with your CockroachDB connection string. - Run
npx prisma migrate
to create the database schema.
TBD
If you are starting with a blank database, you can populate it by running the following command
npx prisma db seed
-
From your terminal:
npm run dev
This starts your app in development mode, rebuilding assets on file changes.
-
Open up https://localhost:3000 and you should be ready to go!
This app is set up to deploy to Fly.io and comes with a GitHub Action that handles automatically deploying the app to production.
Prior to your first deployment, you'll need to do a few things:
-
Sign up and log in to Fly
fly auth signup
Note: If you have more than one Fly account, ensure that you are signed into the same account in the Fly CLI as you are in the browser. In your terminal, run
fly auth whoami
and ensure the email matches the Fly account signed into the browser. -
Create a new app on Fly:
fly apps create [YOUR_APP_NAME]
Note: Make sure this name matches the
app
set in yourfly.toml
file. Otherwise, you will not be able to deploy. -
Add a
FLY_API_TOKEN
to your GitHub repo. To do this, go to your user settings on Fly and create a new token, then add it to your repo secrets with the nameFLY_API_TOKEN
. -
Add your environment vacriables to your fly app secrets, to do this you can run the following commands:
fly secrets set DATABASE_URL="postgresql://" [additional secrets] --app [YOUR_APP_NAME]
If you don't have openssl installed, you can also use 1Password to generate a random secret, just replace
$(openssl rand -hex 32)
with the generated secret.
Now that everything is set up you can commit and push your changes to your repo.
Every commit to your main
branch will trigger a deployment to your production
environment.
Copyright © 2023 Cockroach Labs.
This project is MIT licensed.