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 build
npm start - production server
npm run lint - linting
Setup
npm run create-admin - create admin user
npm 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
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
Migrations
001_initial_schema.sql - Main schema (servers, categories, votes)
002_profiles.sql - User profiles
003_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 key
VPS_HOST - VPS IP or domain
VPS_USER - User (usually root)
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 details
GET /api/categories - List categories
GET /api/servers/test - Test endpoint
Auth Required
GET /api/my-servers - User's servers
POST /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 test
GET /api/debug - Debug info
GET /api/supabase-test - Supabase connection test
Important Files
Documentation
HISTORY.md - MANDATORY - Project change history (iterations, decisions, problems) - UPDATE AFTER EVERY ITERATION
LOCAL_SETUP.md - Local setup instructions for AI assistant
PROJECT_MAP.md - Detailed project documentation (553 lines)
README.md - Main README with setup instructions
Configuration
package.json - Dependencies and scripts
tsconfig.json - TypeScript configuration
tailwind.config.ts - Tailwind CSS configuration
next.config.ts - Next.js configuration
ecosystem.config.js - PM2 configuration
.gitignore - Git ignore rules
Scripts
scripts/create-admin.ts - Create admin user (hardcoded password)
scripts/setup-storage.ts - Storage setup instructions
scripts/fix-storage.ts - Storage fixes
scripts/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.ts for 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
After Deployment
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) or netstat -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
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
1---2name: hytaleservers-workflow3description: Standard workflow for HyTaleServers.tech development4---56# HyTaleServers Workflow78## Project Overview910**Name:** Hytaleservers.tech 11**Description:** Мониторинг и топ-лист серверов Hytale 12**Stack:** Next.js 16 + Supabase + Tailwind CSS + shadcn/ui 13**Status:** Production ready 14**Version:** 0.1.01516## Development Flow17181. Create feature branch: `git checkout -b feature/xxx`192. Make changes203. Test locally: `npm run dev` (port 3000)214. Commit: `git commit -m "feat: xxx"`225. Push: `git push origin feature/xxx`236. Create PR on GitHub247. After merge → auto-deploy to VPS (port 3003)2526## Available Commands2728### Development29- `npm run dev` - dev server (port 3000)30- `npm run build` - production build31- `npm start` - production server32- `npm run lint` - linting3334### Setup35- `npm run create-admin` - create admin user36- `npm run deploy` - deploy to VPS3738## Project Structure3940```41hytaleservers-tech/42├── app/ # Next.js App Router43│ ├── api/ # API routes (11 endpoints)44│ │ ├── servers/ # Servers API45│ │ ├── categories/ # Categories API46│ │ ├── admin/ # Admin API47│ │ └── ... # Other endpoints48│ ├── page.tsx # Main page49│ ├── layout.tsx # Root layout50│ └── globals.css # Global styles51├── components/ # React components52│ ├── server/ # Server components53│ ├── shared/ # Shared components54│ └── ui/ # shadcn/ui components55├── lib/ # Utilities56│ ├── supabase/ # Supabase clients57│ │ ├── client.ts # Browser client58│ │ └── server.ts # Server client59│ └── utils/ # Helper functions60├── supabase/ # Database61│ ├── migrations/ # SQL migrations (001-003)62│ └── seed.sql # Test data63├── scripts/ # Utility scripts64│ ├── create-admin.ts # Create admin65│ ├── setup-storage.ts # Setup storage66│ └── deploy-vps.sh # Deploy script67└── .env # Environment variables (VPS)68```6970## Database7172### Supabase Configuration73- **URL:** https://ncxelqwplkhlhvbmdatf.supabase.co74- **Storage buckets:** server-logos, server-banners75- **Current setup:** Single Supabase project for both local and production7677### Tables78- `servers` - Hytale servers79 - id (UUID, PK)80 - name, slug, ip, port81 - descriptions, logo_url, banner_url82 - owner_email, secret_key83 - status, current_players, max_players84 - rating, uptime_percentage, total_votes8586- `categories` - Server categories87 - id (UUID, PK)88 - name, slug, icon, description8990- `server_categories` - Junction table91 - server_id (FK servers.id)92 - category_id (FK categories.id)9394- `votes` - Votes for servers95 - id (UUID, PK)96 - server_id (FK servers.id)97 - user_id (FK auth.users.id)98 - ip_address, user_agent, voted_at99100- `admin_users` - Admin users101 - email (PK)102 - password_hash103104### Migrations1051. `001_initial_schema.sql` - Main schema (servers, categories, votes)1062. `002_profiles.sql` - User profiles1073. `003_storage.sql` - Storage buckets (logos, banners)108109### Seed Data110- 14 categories (survival, pvp, pve, rpg, creative, minigames, etc.)111- 3 test servers (HyWorld Survival, PvP Arena, Creative Build)112113## Environment Variables114115### Local Development (.env.local)116```bash117# Supabase Configuration118NEXT_PUBLIC_SUPABASE_URL=https://ncxelqwplkhlhvbmdatf.supabase.co119NEXT_PUBLIC_SUPABASE_ANON_KEY=...120NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=sb_publishable_h4MJcTegWY2W93zWfGmkVQ_E2QSDnRH121SUPABASE_SERVICE_ROLE_KEY=...122123# Site Configuration124NEXT_PUBLIC_SITE_URL=http://localhost:3000125126# Analytics (empty for local)127NEXT_PUBLIC_GA_ID=128NEXT_PUBLIC_YANDEX_METRIKA_ID=129130# Optional: Telegram Bot (empty for local)131TELEGRAM_BOT_TOKEN=132TELEGRAM_WEBHOOK_SECRET=133134# Optional: Stripe (empty for local)135NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=136STRIPE_SECRET_KEY=137STRIPE_WEBHOOK_SECRET=138```139140### Production (.env on VPS)141```bash142# Same as local except:143NEXT_PUBLIC_SITE_URL=http://localhost:3003144# (or https://hytaleservers.tech in future)145```146147### Port Configuration148- **Local (dev):** 3000 (Next.js default)149- **VPS (production):** 3003 (PM2 config)150151## Deployment152153### Automatic (GitHub Actions)154Push to `main` branch → auto-deploy to VPS155156**Required GitHub Secrets:**157- `GH_SSH_PRIVATE_KEY` - Private SSH key158- `VPS_HOST` - VPS IP or domain159- `VPS_USER` - User (usually `root`)160- `VPS_PATH` - Project path (`/root/hytaleservers-tech`)161162### Manual163```bash164./scripts/deploy-vps.sh165166# Or manually167git pull origin main168npm install --production169npm run build170pm2 restart hytaleservers171```172173## API Routes174175### Public176- `GET /api/servers` - List servers (with pagination, filters, sorting)177 - Query params: page, limit, sort, category, search, status178- `GET /api/servers/[id]` - Server details179- `GET /api/categories` - List categories180- `GET /api/servers/test` - Test endpoint181182### Auth Required183- `GET /api/my-servers` - User's servers184- `POST /api/upload` - Upload images (logo/banner)185- `GET /api/admin-moderation/[id]` - Moderation queue186187### Admin188- `POST /api/admin/login` - Admin login (sets cookie)189- `POST /api/admin/logout` - Admin logout (clears cookie)190191### Debug192- `GET /api/test` - API test193- `GET /api/debug` - Debug info194- `GET /api/supabase-test` - Supabase connection test195196## Important Files197198### Documentation199- `HISTORY.md` - **MANDATORY** - Project change history (iterations, decisions, problems) - UPDATE AFTER EVERY ITERATION200- `LOCAL_SETUP.md` - Local setup instructions for AI assistant201- `PROJECT_MAP.md` - Detailed project documentation (553 lines)202- `README.md` - Main README with setup instructions203204205### Configuration206- `package.json` - Dependencies and scripts207- `tsconfig.json` - TypeScript configuration208- `tailwind.config.ts` - Tailwind CSS configuration209- `next.config.ts` - Next.js configuration210- `ecosystem.config.js` - PM2 configuration211- `.gitignore` - Git ignore rules212213### Scripts214- `scripts/create-admin.ts` - Create admin user (hardcoded password)215- `scripts/setup-storage.ts` - Storage setup instructions216- `scripts/fix-storage.ts` - Storage fixes217- `scripts/deploy-vps.sh` - Deploy script (bash)218219## Tech Stack Details220221### Frontend222- **Framework:** Next.js 16.1.1 (App Router)223- **UI Library:** React 19.2.3224- **Language:** TypeScript 5225- **Styling:**226 - Tailwind CSS 4227 - shadcn/ui (New York style)228 - Radix UI (Select, Slot)229 - Framer Motion 12.26.2 (animations)230 - class-variance-authority, clsx, tailwind-merge231232### State & Data233- **State Management:** Zustand 5.0.10234- **Data Fetching:** TanStack Query 5.90.17235- **Validation:** Zod 4.3.5236237### Backend & API238- **API Framework:** Next.js API Routes239- **Server-Side Rendering:** Next.js SSR with @supabase/ssr240241### Database242- **Provider:** Supabase (PostgreSQL)243- **Client:** @supabase/supabase-js 2.90.1244- **SSR Client:** @supabase/ssr 0.8.0245246### Deployment247- **Process Manager:** PM2 (production)248- **Port:** 3003 (VPS), 3000 (local)249- **Environment:** Linux (Ubuntu on VPS), Windows (local)250251### Development252- **Package Manager:** npm253- **Build Tool:** Turbopack (Next.js 16)254- **Linting:** ESLint 9 + eslint-config-next255256## Current Status257258### ✅ Working259- Next.js 16 with App Router260- Supabase connection (ANON KEY)261- API endpoints (servers, categories, admin, etc.)262- PM2 production server (port 3003)263- Supabase Skills for OpenCode (5 skills)264- shadcn/ui components265- Tailwind CSS 4266- Middleware for admin routes267- Image upload to Supabase Storage268- Server moderation system269270### ⚠️ Issues271- Service Role KEY needs update (currently using ANON KEY in ecosystem.config.js)272- No tests implemented273- Analytics not configured (GA, Yandex Metrika)274- Telegram Bot not configured275- Stripe not configured276277### ❌ Not Implemented278- Vote system279- Server monitoring (ping)280- Admin panel UI281- Server registration form (public)282- Filters and search on main page283- Pagination284- SEO optimization (sitemap, robots.txt)285286## Development Guidelines287288### Code Style289- Follow existing patterns in components290- Use TypeScript for all new files291- Use shadcn/ui components for UI292- Follow Supabase SSR patterns for server components293294### Database Changes2951. Create migration in `supabase/migrations/XXX_description.sql`2962. Apply migration via Supabase CLI or Dashboard2973. Update TypeScript types if needed2984. Test locally and on production299300### Adding New Features3011. Create feature branch3022. Implement feature3033. Test locally3044. Commit with conventional commits (feat:, fix:, etc.)3055. Push and create PR3066. After merge → auto-deploy307308### Adding New API Routes309- Place in `app/api/[resource]/route.ts`310- Use `lib/supabase/server.ts` for server client311- Return JSON responses312- Add error handling313314### Documentation Management315316**MANDATORY: Update HISTORY.md after every iteration**317318After completing development work (feature, bug fix, refactoring, etc.), you MUST update `HISTORY.md`:319320**When to update:**321- After any iteration of development (not just git commits)322- After debugging sessions323- After architectural decisions324- After testing and fixes325326**How to update:**3271. Add new entry at the top of HISTORY.md with current date3282. Include ALL relevant sections:329 - 📝 Изменения кода - what was changed330 - 💡 Принятые решения - why decisions were made331 - 🐛 Проблемы и решения - issues encountered and fixed332 - ✅ Задачи (TODO) - completed and pending tasks with tags [bug]/[feature]/[refactor] and priority high/medium/low333 - 🔧 Технические заметки - important technical details334 - 🎯 Результат - outcome of the iteration335336**Format:**337```markdown338## [ГГГГ-ММ-ДД] - Итерация N339340### 📝 Изменения кода341- [Description]342343### 💡 Принятые решения344- **[Decision]**: [Description]345 - Почему: [Reason]346 - Альтернативы: [Alternatives]347348### 🐛 Проблемы и решения349- **[Problem]**: [Description]350 - Решение: [How fixed]351 - Время: [Time spent]352353### ✅ Задачи (TODO)354- [x] [Task] - [tag] [priority]355- [ ] [Task] - [tag] [priority]356357### 🔧 Технические заметки358- [Technical details]359360### 🎯 Результат361[Outcome summary]362```363364**CRITICAL RULES:**365- ALWAYS update HISTORY.md before moving to next task366- Include ALL changes, even minor ones367- Tag tasks with [bug]/[feature]/[refactor]368- Mark task priority as high/medium/low369- Document both successes and failures370- Keep entries machine-readable (AI needs to parse them)371372373## Testing Checklist374375### Before Pushing376- [ ] Run `npm run lint` - check for linting errors377- [ ] Test locally with `npm run dev`378- [ ] Test API endpoints379- [ ] Check console for errors380- [ ] Verify Supabase connection381- [ ] **CRITICAL: Update HISTORY.md** with all changes, decisions, and problems382383384### After Deployment385- [ ] Check PM2 status: `pm2 status`386- [ ] Check PM2 logs: `pm2 logs hytaleservers`387- [ ] Test API endpoints on production388- [ ] Check UI in browser389- [ ] Verify Supabase connection390391## Future Features392393### Priority 1 - Critical3941. Update Service Role KEY3952. Implement vote system3963. Implement server monitoring (ping)3974. Add pagination to servers list3985. Add filters and search to main page399400### Priority 2 - Important4016. Implement admin panel UI4027. Implement server registration form (public)4038. Setup analytics (GA, Yandex Metrika)4049. Add tests (Jest/Vitest)40510. Setup CI/CD for staging406407### Priority 3 - Nice to Have40811. Implement Telegram Bot for notifications40912. Implement Stripe for premium features41013. SEO optimization (sitemap, robots.txt)41114. Performance monitoring41215. Error tracking (Sentry, etc.)413414## Useful Commands415416### Development417```bash418npm run dev # Start dev server419npm run build # Build for production420npm start # Start production server421npm run lint # Check linting422```423424### Database425```bash426npm run create-admin # Create admin user427# (Currently hardcoded password in script)428```429430### Deployment431```bash432npm run deploy # Deploy to VPS433# or434./scripts/deploy-vps.sh435```436437### PM2 (on VPS)438```bash439pm2 status # Check status440pm2 logs hytaleservers # View logs441pm2 restart hytaleservers442pm2 stop hytaleservers443pm2 start hytaleservers444```445446### Git447```bash448git checkout -b feature/xxx449git add .450git commit -m "feat: xxx"451git push origin feature/xxx452```453454## Troubleshooting455456### Issue: Dev server not starting457- Check port 3000 is free: `lsof -i :3000` (Mac/Linux) or `netstat -ano | findstr :3000` (Windows)458- Check .env.local exists and is valid459- Check node_modules are installed460461### Issue: Supabase connection error462- Check .env.local has correct Supabase URL and keys463- Check Supabase project is accessible464- Check console for error details465466### Issue: Build fails467- Check for TypeScript errors468- Check for missing dependencies469- Check linting errors470471### Issue: Deploy fails472- Check SSH connection to VPS473- Check PM2 is running on VPS474- Check deploy script permissions475476## Resources477478### Documentation479- [Next.js Docs](https://nextjs.org/docs)480- [Supabase Docs](https://supabase.com/docs)481- [shadcn/ui Docs](https://ui.shadcn.com)482- [Tailwind CSS Docs](https://tailwindcss.com/docs)483484### Project485- Supabase Dashboard: https://supabase.com/dashboard/project/ncxelqwplkhlhvbmdatf486- Local URL: http://localhost:3000487- Production URL: http://localhost:3003 (or https://hytaleservers.tech)488489### External490- GitHub Repository: (to be created)491- Issue Tracker: (GitHub Issues)492- Documentation: (PROJECT_MAP.md, README.md, LOCAL_SETUP.md)493494---495496**Last Updated:** January 17, 2026 497**Maintainer:** AI Assistant (OpenCode) 498**Status:** Active Development