Pastein - Modern paste tool. Store your text online with Pastein.
- Next.js v14.2.5
- Tailwind CSS
- Supabase
Open
- Run this command :
git clone https://github.com/justikail/Pastein cd Pastein npm i code .
- Login / Register Supabase Account.
- Create a new project with any name & any password.
- Go to Table Editor & click Create a new table with table name "pastein" & unchecklist RLS.
- Add or edit column with this detail:
column | typewidth | other |
---|---|---|
id | int8 | ai, notnull |
title | text | notnull |
content | text | notnull |
type | text | notnull |
endPoint | uuid | genuuid, notnull |
created_at | timestamptz | now, notnull |
expired_at | timestamptz | null |
- Click insert & click insert row.
- Go to SQL Editor.
- Copy and paste this code on textarea field.
CREATE OR REPLACE FUNCTION delete_expired_paste()
RETURNS void LANGUAGE plpgsql AS $$
BEGIN
DELETE FROM pastein
WHERE expired_at < NOW();
END;
$$;
- Then click Run.
- Go to New query, copy and paste this code.
SELECT cron.schedule('*/5 * * * *', 'SELECT delete_expired_paste();');
- Then click Run.
- Go to New query, copy and paste this code.
SELECT * FROM cron.job;
- Then click Run again.
- Go to Project Settings -> API.
- Copy URL on Project URL field, Paste on .env NEXT_SUPABASE_URL.
- Copy Api Key on Project API Keys, Paste on .env NEXT_SUPABASE_KEY.