Skip to content

macchant/genshin-inbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Genshin Inbox - Support System

A beautiful player support inbox system for game servers, built with vanilla HTML/CSS/JS and Supabase.

Features

  • 📬 Message Submission - Players can submit support requests
  • 📥 Inbox Checking - Players can check their messages and replies
  • 🔐 Admin Dashboard - Admin can view, reply to, and manage messages
  • 🔔 Telegram Notifications - Get notified of new messages
  • 📊 Statistics Dashboard - Track message stats

Setup

1. Supabase Setup

  1. Go to Supabase and create a new project
  2. Open SQL Editor and run the following:
CREATE TABLE IF NOT EXISTS messages (
    id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
    player_name TEXT NOT NULL,
    uid TEXT NOT NULL,
    message TEXT NOT NULL,
    contact_method TEXT DEFAULT '',
    sender_type TEXT DEFAULT 'web',
    status TEXT DEFAULT 'pending' CHECK (status IN ('pending', 'replied', 'resolved')),
    reply TEXT DEFAULT '',
    replied_by TEXT DEFAULT '',
    replied_at TIMESTAMPTZ,
    created_at TIMESTAMPTZ DEFAULT NOW()
);

CREATE INDEX IF NOT EXISTS idx_messages_uid ON messages(uid);
CREATE INDEX IF NOT EXISTS idx_messages_status ON messages(status);
CREATE INDEX IF NOT EXISTS idx_messages_created_at ON messages(created_at DESC);

ALTER TABLE messages DISABLE ROW LEVEL SECURITY;

2. Vercel Setup

  1. Fork or push this repo to GitHub
  2. Go to Vercel and import the project
  3. Add these Environment Variables in Vercel Settings:
Variable Value
SUPABASE_URL Your Supabase project URL (e.g., https://xxxxx.supabase.co)
SUPABASE_SERVICE_KEY Your Supabase service role key
ADMIN_TOKEN Your admin password (change this!)
TELEGRAM_BOT_TOKEN (Optional) Telegram bot token
TELEGRAM_ADMIN_ID (Optional) Your Telegram chat ID

3. Get Supabase Credentials

  1. Go to Supabase Dashboard → Project SettingsAPI
  2. Find the service_role secret key (not the anon key)
  3. Copy the Project URL and service_role key

4. Deploy

Click Deploy in Vercel!

Troubleshooting

Messages not showing in inbox

  1. Check if SUPABASE_URL and SUPABASE_SERVICE_KEY are set in Vercel
  2. Verify the messages table exists in Supabase
  3. Check Vercel Runtime Logs for errors

Admin dashboard not loading

  1. Make sure you're using the correct ADMIN_TOKEN
  2. Check browser console for errors
  3. Try logging out and logging back in

API errors

Test the API health endpoint:

curl -X POST https://your-domain.vercel.app/api \
  -H "Content-Type: application/json" \
  -d '{"action":"ping"}'

File Structure

├── api/
│   └── index.js          # API endpoints
├── public/
│   ├── index.html        # Landing page
│   ├── index2.html       # Animated mascot page
│   ├── form.html         # Submit message form
│   ├── inbox.html        # Check messages page
│   └── admin.html        # Admin dashboard
├── vercel.json           # Vercel config
└── SUPABASE_SETUP.sql    # Database schema

API Endpoints

Action Description Auth
submit Submit a new message None
get_messages_by_uid Get messages by UID None
get_messages Get all messages Admin
reply Reply to a message Admin
resolve Mark message resolved Admin
get_stats Get message statistics Admin
ping Health check None

Default Admin Password

The default password is: akasa-admin-2026-secure

⚠️ Change this in Vercel Environment Variables!

Customization

Change Branding

Edit the HTML files to change:

  • Title and descriptions
  • Colors (CSS variables in :root)
  • Mascot name "Aquilonia"
  • Contact info

Add File Uploads

To add screenshot uploads, you would need:

  1. Enable Supabase Storage
  2. Upload files to storage
  3. Save URLs in the message

License

MIT - Free to use and modify!

About

Game Support System - Player inbox and support messaging

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors