
hytaleservers-workflow
by ragastar
hytale servers
SKILL.md
name: hytaleservers-workflow description: "Standard workflow for HyTaleServers.tech development"
HyTaleServers Workflow
Project Overview
Name: Hytaleservers.tech
Description: Мониторинг и топ-лист серверов Hytale
Stack: Next.js 16 + Supabase + Tailwind CSS + shadcn/ui
Status: Production ready
Version: 0.1.0
Development Flow
- Create feature branch:
git checkout -b feature/xxx - Make changes
- Test locally:
npm run dev(port 3000) - Commit:
git commit -m "feat: xxx" - Push:
git push origin feature/xxx - Create PR on GitHub
- After merge → auto-deploy to VPS (port 3003)
Available Commands
Development
npm run dev- dev server (port 3000)npm run build- production buildnpm start- production servernpm run lint- linting
Setup
npm run create-admin- create admin usernpm run deploy- deploy to VPS
Project Structure
hytaleservers-tech/
├── app/ # Next.js App Router
│ ├── api/ # API routes (11 endpoints)
│ │ ├── servers/ # Servers API
│ │ ├── categories/ # Categories API
│ │ ├── admin/ # Admin API
│ │ └── ... # Other endpoints
│ ├── page.tsx # Main page
│ ├── layout.tsx # Root layout
│ └── globals.css # Global styles
├── components/ # React components
│ ├── server/ # Server components
│ ├── shared/ # Shared components
│ └── ui/ # shadcn/ui components
├── lib/ # Utilities
│ ├── supabase/ # Supabase clients
│ │ ├── client.ts # Browser client
│ │ └── server.ts # Server client
│ └── utils/ # Helper functions
├── supabase/ # Database
│ ├── migrations/ # SQL migrations (001-003)
│ └── seed.sql # Test data
├── scripts/ # Utility scripts
│ ├── create-admin.ts # Create admin
│ ├── setup-storage.ts # Setup storage
│ └── deploy-vps.sh # Deploy script
└── .env # Environment variables (VPS)
Database
Supabase Configuration
- URL: https://ncxelqwplkhlhvbmdatf.supabase.co
- Storage buckets: server-logos, server-banners
- Current setup: Single Supabase project for both local and production
Tables
-
servers- Hytale servers- id (UUID, PK)
- name, slug, ip, port
- descriptions, logo_url, banner_url
- owner_email, secret_key
- status, current_players, max_players
- rating, uptime_percentage, total_votes
-
categories- Server categories- id (UUID, PK)
- name, slug, icon, description
-
server_categories- Junction table- server_id (FK servers.id)
- category_id (FK categories.id)
-
votes- Votes for servers- id (UUID, PK)
- server_id (FK servers.id)
- user_id (FK auth.users.id)
- ip_address, user_agent, voted_at
-
admin_users- Admin users- email (PK)
- password_hash
Migrations
001_initial_schema.sql- Main schema (servers, categories, votes)002_profiles.sql- User profiles003_storage.sql- Storage buckets (logos, banners)
Seed Data
- 14 categories (survival, pvp, pve, rpg, creative, minigames, etc.)
- 3 test servers (HyWorld Survival, PvP Arena, Creative Build)
Environment Variables
Local Development (.env.local)
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=https://ncxelqwplkhlhvbmdatf.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=...
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=sb_publishable_h4MJcTegWY2W93zWfGmkVQ_E2QSDnRH
SUPABASE_SERVICE_ROLE_KEY=...
# Site Configuration
NEXT_PUBLIC_SITE_URL=http://localhost:3000
# Analytics (empty for local)
NEXT_PUBLIC_GA_ID=
NEXT_PUBLIC_YANDEX_METRIKA_ID=
# Optional: Telegram Bot (empty for local)
TELEGRAM_BOT_TOKEN=
TELEGRAM_WEBHOOK_SECRET=
# Optional: Stripe (empty for local)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
Production (.env on VPS)
# Same as local except:
NEXT_PUBLIC_SITE_URL=http://localhost:3003
# (or https://hytaleservers.tech in future)
Port Configuration
- Local (dev): 3000 (Next.js default)
- VPS (production): 3003 (PM2 config)
Deployment
Automatic (GitHub Actions)
Push to main branch → auto-deploy to VPS
Required GitHub Secrets:
GH_SSH_PRIVATE_KEY- Private SSH keyVPS_HOST- VPS IP or domainVPS_USER- User (usuallyroot)VPS_PATH- Project path (/root/hytaleservers-tech)
Manual
./scripts/deploy-vps.sh
# Or manually
git pull origin main
npm install --production
npm run build
pm2 restart hytaleservers
API Routes
Public
GET /api/servers- List servers (with pagination, filters, sorting)- Query params: page, limit, sort, category, search, status
GET /api/servers/[id]- Server detailsGET /api/categories- List categoriesGET /api/servers/test- Test endpoint
Auth Required
GET /api/my-servers- User's serversPOST /api/upload- Upload images (logo/banner)GET /api/admin-moderation/[id]- Moderation queue
Admin
POST /api/admin/login- Admin login (sets cookie)POST /api/admin/logout- Admin logout (clears cookie)
Debug
GET /api/test- API testGET /api/debug- Debug infoGET /api/supabase-test- Supabase connection test
Important Files
Documentation
HISTORY.md- MANDATORY - Project change history (iterations, decisions, problems) - UPDATE AFTER EVERY ITERATIONLOCAL_SETUP.md- Local setup instructions for AI assistantPROJECT_MAP.md- Detailed project documentation (553 lines)README.md- Main README with setup instructions
Configuration
package.json- Dependencies and scriptstsconfig.json- TypeScript configurationtailwind.config.ts- Tailwind CSS configurationnext.config.ts- Next.js configurationecosystem.config.js- PM2 configuration.gitignore- Git ignore rules
Scripts
scripts/create-admin.ts- Create admin user (hardcoded password)scripts/setup-storage.ts- Storage setup instructionsscripts/fix-storage.ts- Storage fixesscripts/deploy-vps.sh- Deploy script (bash)
Tech Stack Details
Frontend
- Framework: Next.js 16.1.1 (App Router)
- UI Library: React 19.2.3
- Language: TypeScript 5
- Styling:
- Tailwind CSS 4
- shadcn/ui (New York style)
- Radix UI (Select, Slot)
- Framer Motion 12.26.2 (animations)
- class-variance-authority, clsx, tailwind-merge
State & Data
- State Management: Zustand 5.0.10
- Data Fetching: TanStack Query 5.90.17
- Validation: Zod 4.3.5
Backend & API
- API Framework: Next.js API Routes
- Server-Side Rendering: Next.js SSR with @supabase/ssr
Database
- Provider: Supabase (PostgreSQL)
- Client: @supabase/supabase-js 2.90.1
- SSR Client: @supabase/ssr 0.8.0
Deployment
- Process Manager: PM2 (production)
- Port: 3003 (VPS), 3000 (local)
- Environment: Linux (Ubuntu on VPS), Windows (local)
Development
- Package Manager: npm
- Build Tool: Turbopack (Next.js 16)
- Linting: ESLint 9 + eslint-config-next
Current Status
✅ Working
- Next.js 16 with App Router
- Supabase connection (ANON KEY)
- API endpoints (servers, categories, admin, etc.)
- PM2 production server (port 3003)
- Supabase Skills for OpenCode (5 skills)
- shadcn/ui components
- Tailwind CSS 4
- Middleware for admin routes
- Image upload to Supabase Storage
- Server moderation system
⚠️ Issues
- Service Role KEY needs update (currently using ANON KEY in ecosystem.config.js)
- No tests implemented
- Analytics not configured (GA, Yandex Metrika)
- Telegram Bot not configured
- Stripe not configured
❌ Not Implemented
- Vote system
- Server monitoring (ping)
- Admin panel UI
- Server registration form (public)
- Filters and search on main page
- Pagination
- SEO optimization (sitemap, robots.txt)
Development Guidelines
Code Style
- Follow existing patterns in components
- Use TypeScript for all new files
- Use shadcn/ui components for UI
- Follow Supabase SSR patterns for server components
Database Changes
- Create migration in
supabase/migrations/XXX_description.sql - Apply migration via Supabase CLI or Dashboard
- Update TypeScript types if needed
- Test locally and on production
Adding New Features
- Create feature branch
- Implement feature
- Test locally
- Commit with conventional commits (feat:, fix:, etc.)
- Push and create PR
- After merge → auto-deploy
Adding New API Routes
- Place in
app/api/[resource]/route.ts - Use
lib/supabase/server.tsfor server client - Return JSON responses
- Add error handling
Documentation Management
MANDATORY: Update HISTORY.md after every iteration
After completing development work (feature, bug fix, refactoring, etc.), you MUST update HISTORY.md:
When to update:
- After any iteration of development (not just git commits)
- After debugging sessions
- After architectural decisions
- After testing and fixes
How to update:
- Add new entry at the top of HISTORY.md with current date
- Include ALL relevant sections:
- 📝 Изменения кода - what was changed
- 💡 Принятые решения - why decisions were made
- 🐛 Проблемы и решения - issues encountered and fixed
- ✅ Задачи (TODO) - completed and pending tasks with tags [bug]/[feature]/[refactor] and priority high/medium/low
- 🔧 Технические заметки - important technical details
- 🎯 Результат - outcome of the iteration
Format:
## [ГГГГ-ММ-ДД] - Итерация N
### 📝 Изменения кода
- [Description]
### 💡 Принятые решения
- **[Decision]**: [Description]
- Почему: [Reason]
- Альтернативы: [Alternatives]
### 🐛 Проблемы и решения
- **[Problem]**: [Description]
- Решение: [How fixed]
- Время: [Time spent]
### ✅ Задачи (TODO)
- [x] [Task] - [tag] [priority]
- [ ] [Task] - [tag] [priority]
### 🔧 Технические заметки
- [Technical details]
### 🎯 Результат
[Outcome summary]
CRITICAL RULES:
- ALWAYS update HISTORY.md before moving to next task
- Include ALL changes, even minor ones
- Tag tasks with [bug]/[feature]/[refactor]
- Mark task priority as high/medium/low
- Document both successes and failures
- Keep entries machine-readable (AI needs to parse them)
Testing Checklist
Before Pushing
- Run
npm run lint- check for linting errors - Test locally with
npm run dev - Test API endpoints
- Check console for errors
- Verify Supabase connection
- CRITICAL: Update HISTORY.md with all changes, decisions, and problems
After Deployment
- Check PM2 status:
pm2 status - Check PM2 logs:
pm2 logs hytaleservers - Test API endpoints on production
- Check UI in browser
- Verify Supabase connection
Future Features
Priority 1 - Critical
- Update Service Role KEY
- Implement vote system
- Implement server monitoring (ping)
- Add pagination to servers list
- Add filters and search to main page
Priority 2 - Important
- Implement admin panel UI
- Implement server registration form (public)
- Setup analytics (GA, Yandex Metrika)
- Add tests (Jest/Vitest)
- Setup CI/CD for staging
Priority 3 - Nice to Have
- Implement Telegram Bot for notifications
- Implement Stripe for premium features
- SEO optimization (sitemap, robots.txt)
- Performance monitoring
- Error tracking (Sentry, etc.)
Useful Commands
Development
npm run dev # Start dev server
npm run build # Build for production
npm start # Start production server
npm run lint # Check linting
Database
npm run create-admin # Create admin user
# (Currently hardcoded password in script)
Deployment
npm run deploy # Deploy to VPS
# or
./scripts/deploy-vps.sh
PM2 (on VPS)
pm2 status # Check status
pm2 logs hytaleservers # View logs
pm2 restart hytaleservers
pm2 stop hytaleservers
pm2 start hytaleservers
Git
git checkout -b feature/xxx
git add .
git commit -m "feat: xxx"
git push origin feature/xxx
Troubleshooting
Issue: Dev server not starting
- Check port 3000 is free:
lsof -i :3000(Mac/Linux) ornetstat -ano | findstr :3000(Windows) - Check .env.local exists and is valid
- Check node_modules are installed
Issue: Supabase connection error
- Check .env.local has correct Supabase URL and keys
- Check Supabase project is accessible
- Check console for error details
Issue: Build fails
- Check for TypeScript errors
- Check for missing dependencies
- Check linting errors
Issue: Deploy fails
- Check SSH connection to VPS
- Check PM2 is running on VPS
- Check deploy script permissions
Resources
Documentation
Project
- Supabase Dashboard: https://supabase.com/dashboard/project/ncxelqwplkhlhvbmdatf
- Local URL: http://localhost:3000
- Production URL: http://localhost:3003 (or https://hytaleservers.tech)
External
- GitHub Repository: (to be created)
- Issue Tracker: (GitHub Issues)
- Documentation: (PROJECT_MAP.md, README.md, LOCAL_SETUP.md)
Last Updated: January 17, 2026
Maintainer: AI Assistant (OpenCode)
Status: Active Development
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です