KeepAlive for Supabase is an open-source tool designed to prevent Supabase free-tier databases from becoming inactive due to idle time. This tool periodically sends requests to your database to keep it running, ensuring uninterrupted service for development or low-traffic applications.
- Script uses
pnpm
as package manager. Install pnpm - Create a dummy table in you Supabase db. This table will be used by the script to keep your db alive
CREATE TABLE "your_table_name" (
id BIGINT generated BY DEFAULT AS IDENTITY,
name text NULL DEFAULT '':: text,
random uuid NULL DEFAULT gen_random_uuid (),
CONSTRAINT "your_table_name_pkey" PRIMARY key (id)
);
- Clone the Repository
git clone https://github.com/bennytaccardi/supabase-hearth-pulse.git
cd supabase-hearth-pulse
- Install Dependencies
pnpm install
-
Configure Environment Variables Create a .env file in the root directory and add your Supabase project details:
TABLE_NAME=your-keep-alive-table-name #default "keep-alive"
-
Add cron in your OS Add a scheduled cron job to run the script every X hours. Bear in mind that Supabase will stop your DB after 7 days of inactiviy.
This project is licensed under the MIT License. See the LICENSE file for details.
This README provides a clear overview and setup instructions for users interested in your tool.