An open-source backup solution for websites and apps built with Sanity.

- Create on-demand backups.
- Download previously generated backups.
This open source project is intended to be used locally. If you want to deploy it on the web you will need to add authentication. Convex has first-class support for Clerk and Auth0, as well as their own auth solution Convex Auth.
This project uses Amazon S3 to store the generated backups so you'll need to create an S3 bucket.
- Go to the AWS Console.
- Log in with your credentials.
- In the top search bar, type "S3" and select S3 from the services list.
- This will take you to the Amazon S3 dashboard.
- Click the “Create bucket” button.
- Fill out the bucket details:
- Bucket name: Must be globally unique (e.g. my-app-bucket-2025).
- AWS Region: Choose the region closest to your users or application.
- Click “Create bucket” at the bottom of the page.
To access the S3 bucket from an external application requires access and secret access keys, you can generate these by creating an IAM user.
- Go to the AWS Console.
- Log in with your credentials.
- In the search bar at the top, type "IAM" and select IAM from the dropdown.
- This will take you to the IAM dashboard.
- In the IAM dashboard, click on "Users" in the left sidebar.
- Click the "Create user" button (orange button on the right).
- User name: Enter a descriptive name like
sanity-backup-user
ors3-backup-service
. - Leave "Provide user access to the AWS Management Console" unchecked.
- Click "Next".
- Click "Attach policies directly" and add
AmazonS3FullAccess
. - Click "Next".
- Review your user details then click "Create user".
- In the "Users" table click on your newly created user.
- In the summary section click on "Create access key".
- For "Use case" choose "Application running outside AWS" and then click next.
- Add a description and click "Create access key".
- Copy your access key and secret access key as we need to add them to our project as environment variables.
Clone this repository and open it your code editor.
Create a .env
file in the root directory and add the following environment variables:
AWS_REGION
- The AWS Region you chose when creating your bucket.AWS_ACCESS_KEY_ID
- The access key you created in the previous steps.AWS_SECRET_ACCESS_KEY
- The secret access key you created in the previous steps.S3_BUCKET_NAME
- The name you gave your S3 bucket.
Run this command in your terminal in the root directory:
Command | Action |
---|---|
npm install |
Installs dependencies. |
Navigate to the web directory using cd apps/web
and run the following command to set up a Convex deployment. This will prompt you to log into your Convex account with GitHub, create a project (or select an exisiting one), and save your production and deployment URLs.
Command | Action |
---|---|
npx convex dev |
Sets up a convex dev deployment. |
Navigate to the root directory and start the development servers by running the following command:
Command | Action |
---|---|
npm run dev |
Starts local dev servers at http://localhost:3000 (web) and http://localhost:3001 (api) |
If you have any questions or need help getting set up feel free to send me an email [email protected]
- LinkedIn (@jamesreaco)
- Website (jamesrea.co)
- X (Twitter) (@jamesreaco)