6.1 KiB
6.1 KiB
LA2 Eternal Development Plan
Project Overview
Dark fantasy themed website for Lineage 2 server with:
- Landing/home page with server info, news, game download
- Members portal with user authentication
- Character management dashboard
- Admin panel for user management
- PostgreSQL database with Docker
Technology Stack
- Frontend: React 18 + Vite + TypeScript + Tailwind CSS
- Backend: Node.js + Express + TypeScript
- Database: SQLite 3 (embedded file-based database for portal accounts)
- Game Server Database: MSSQL (direct SQL queries to lin2db/lin2world)
- ORM: Prisma
- Auth: JWT (jsonwebtoken) + bcrypt
- Docker: Docker Compose for API and Frontend containerization
Project Structure
/la2-portal
├── docker-compose.yml
├── Makefile
├── AGENTS.md
├── plan.md
├── public/
│ └── assets/
├── src/
│ ├── api/
│ │ ├── index.ts # Express server entry
│ │ ├── database.ts # Prisma connection
│ │ ├── auth/ # Auth routes & middleware
│ │ └── admin/ # Admin routes
│ └── pages/
│ ├── LandingPage.tsx
│ ├── LoginPage.tsx
│ ├── RegisterPage.tsx
│ ├── DashboardPage.tsx
│ └── AdminPage.tsx
├── docker-compose.yml
└── docker/
└── postgresql/
└── init.sql
Implementation Phases
Phase 1: Setup (30 min)
- Initialize Vite React project
- Initialize Express API project
- Configure Docker Compose
- Set up Tailwind CSS
- Configure TypeScript
- Add ESLint/Prettier
Phase 2: Database & Backend Auth (2 hours)
- Create Prisma schema
- Implement migration setup
- Build user registration endpoint
- Build login endpoint
- Implement JWT token handling
- Add session/token helpers
- Create middleware for auth
Phase 3: Landing Page (1.5 hours)
- Hero section with server info
- Latest news section
- Game download buttons
- Navigation bar
- Footer
Phase 4: Members Portal (2 hours)
- Protected route middleware
- Dashboard layout
- User profile display
- Character list (show/create/delete)
- Add character form
- Edit character form
Phase 5: Admin Panel (1 hour)
- Admin user authentication
- View all users
- List all characters
- Add characters per user
- Delete characters per user
- Set max characters per user
- Dashboard for admin
Phase 6: Polish & Optimize (1 hour)
- Apply dark fantasy theme
- Add responsive design
- Implement loading states
- Error handling
- Performance optimization
- Security audit
Dark Fantasy Theme
- Background: Dark charcoal (#1a1a2e)
- Cards/Panels: Deep purple (#16213e)
- Accent: Gold (#ffd700)
- Text: Off-white (#e8e8e8)
- Borders: Dark gray (#333)
Database Schema
Portal Database (SQLite)
model WebsiteAccount {
id Int @id @default(autoincrement())
username String @unique
email String @unique
password String // bcrypt hashed
role Role @default(USER)
isAdmin Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
gameAccounts GameAccount[]
}
model GameAccount {
id Int @id @default(autoincrement())
accountName String @unique // Game server account name
ssn Int @unique // Game server SSN
websiteUserId Int
websiteUser WebsiteAccount @relation(fields: [websiteUserId], references: [id], onDelete: Cascade)
characters GameCharacter[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model GameCharacter {
id Int @id @default(autoincrement())
charName String @unique
gameAccountId Int
level Int @default(1)
exp Int @default(0)
// ... other stats
gameAccount GameAccount @relation(fields: [gameAccountId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
Game Server Database (MSSQL - Direct SQL)
lin2db.dbo.user_account- Game accountslin2db.dbo.user_info- Account info with SSNlin2db.dbo.user_auth- Password storagelin2db.dbo.user_data- Character datalin2world.dbo.builder_account- Builder permissions
Features
- ✅ JWT-based authentication
- ✅ Password hashing with bcrypt
- ✅ Session management
- ✅ Protected routes
- ✅ Character CRUD operations
- ✅ Admin user management
- ✅ User limits for characters
- ✅ Responsive design
- ✅ Dark fantasy aesthetics
Security
- Environment variables for secrets
- JWT token validation
- CSRF protection
- Input validation
- Rate limiting
- SQL injection prevention (via Prisma)
API Endpoints
Public Routes
POST /api/register- User registrationPOST /api/login- User loginGET /api/user-info- Get current user data
Protected Routes
GET /api/characters- List user's charactersGET /api/characters/:id- Get character detailsPOST /api/characters- Create new characterDELETE /api/characters/:id- Delete characterPATCH /api/characters/:id- Update characterPOST /api/claim-character/:id- Claim another user's character
Admin Routes (Admin JWT only)
GET /api/admin/users- List all usersPOST /api/admin/users/:id- Create userGET /api/admin/characters- All charactersPOST /api/admin/characters- Add character to userDELETE /api/admin/characters/:id- Delete characterPATCH /api/admin/users/:id- Update user limits
Testing Strategy
- Unit tests for API endpoints
- Integration tests for auth flow
- E2E tests for critical paths
- Test with different browsers
- Mobile responsive testing
Deployment
- Docker Compose for easy deployment
- Environment variable configuration
- SSL/TLS support
- Database backups
- Health checks
Next Actions
- Initialize the React frontend
- Initialize the Node.js API
- Set up Docker Compose
- Implement in order of phases above