Skip to content

About

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

The Piss List

An improved Fork of the Shitty List template, developed by Anticroom for better level management and useablity.

Improvements

  • PostgreSQL Support: Replaced JSON storage with a database for better reliability.
  • Admin Panel: Integrated page to add, edit, and reorder levels.
  • Audit Logging: Staff actions are logged to Discord via webhooks.
  • Staff Management Management page to manage all list editors as owner.

Setup Instructions

1. Supabase Database Setup

  1. Create a new project on Supabase.
  2. Navigate to the SQL Editor in the left sidebar.
  3. Paste the following script and click Run:
CREATE TABLE public.levels (
    id BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
    name TEXT NOT NULL,
    rank INTEGER NOT NULL,
    data JSONB NOT NULL DEFAULT '{}'::jsonb
);

CREATE TABLE public.packs (
    id TEXT PRIMARY KEY,
    name TEXT NOT NULL,
    color TEXT,
    levels TEXT[]
);

CREATE TABLE public.system (
    key TEXT PRIMARY KEY,
    data JSONB NOT NULL
);

INSERT INTO public.system (key, data) VALUES 
('_logins', '{"management": [], "admins": []}'),
('_editors', '[]'),
('rules', '{"level_rules": [], "record_rules": []}');

ALTER TABLE public.levels DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.packs DISABLE ROW LEVEL SECURITY;
ALTER TABLE public.system DISABLE ROW LEVEL SECURITY;

2. Environment Variables

Create a .env file in your root directory. You will need these for local testing and Vercel deployment.

# security (create a random string of characters with www.random.org/strings)
JWT_SECRET=[YOURJWTSTRING]

# database (get this from Supabase: project settings > database > connection string > node.js)
DATABASE_URL=postgresql://postgres.[PROJECTID]@[REGION][.pooler.supabase.com:6543/postgres](https://.pooler.supabase.com:6543/postgres)

# webhooks
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/..
DISCORD_UPDATE_WEBHOOK_URL=https://discord.com/api/webhooks/..
DISCORD_COMPLETION_WEBHOOK_URL=https://discord.com/api/webhooks/..
  • DISCORD_WEBHOOK_URL: Private audit log for staff actions.
  • DISCORD_UPDATE_WEBHOOK_URL: Public channel for level placements/changes.
  • DISCORD_COMPLETION_WEBHOOK_URL: Public channel for new records.

3. Vercel Deployment

  1. Push this code to a GitHub repository.
  2. Go to Vercel and create a New Project.
  3. Import your GitHub repository.
  4. Add Environment Variables:
  • On the "Configure Project" screen, look for Environment Variables.
  • Copy the keys and values from your .env file and add them one by one.
  • Alternatively, after the project is created, go to Settings > Environment Variables and add them there.
  1. Click Deploy.

4. Creating the First Owner Account

To access the admin panel, you must manually seed the first management account in the database:

  1. Go to the Table Editor in Supabase.
  2. Select the system table.
  3. Edit the _logins row and update the management array to include your desired login:
{
  "management": [
    {
      "username": "admin",
      "email": "admin@gmail.com",
      "password": "1234"
    }
  ],
  "admins": []
}

Developed by Anticroom with love and care ❤️

About

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages