Files
2026-04-25 09:58:43 +02:00

5.4 KiB

LA2 Eternal - Project Running Successfully

Status: RUNNING IN DOCKER 🚀

All Services Running

Service Container Port Status
API Server la2_portal_api 3001 Running (SQLite embedded)
Frontend la2_portal_fe 5173 Running

🌐 Access Points

Completed Implementation

Backend API (Node.js + Express + TypeScript)

  • Express server with CORS
  • JWT authentication (jsonwebtoken)
  • Password hashing (bcryptjs)
  • Input validation (zod)
  • MSSQL game server integration (mssql package)
  • Direct SQL queries to lin2db.dbo.user_data for character management
  • Direct SQL queries to lin2world.dbo.builder_account
  • User account creation in game server (ssn, user_account, user_info, user_auth)
  • Auth routes: /api/auth/register, /api/auth/login
  • Character routes: /api/users/me/characters (CRUD via MSSQL)
  • Admin routes: /api/admin/*
  • Error handling middleware
  • Protected route middleware

Game Server Integration (MSSQL)

  • Configurable remote server IP via .env (GAME_SERVER_HOST, GAME_WORLD_HOST)
  • Connection pooling for both lin2db and lin2world databases
  • Character create/delete using x_self.sql patterns
  • User account creation following x_self.sql schema
  • Server info configurable (SERVER_ID, SERVER_NAME, SERVER_IP, SERVER_PORT)

Frontend (React + Vite + TypeScript)

  • Full HD wide-screen UI (1920x1080 optimized)
  • React Router with protected routes
  • Landing page (hero, news, download, server info)
  • Login page with form
  • Registration page with validation
  • Dashboard with character list
  • Add character modal/form
  • CharacterCard component with stats display
  • Zustand state management
  • Axios HTTP client with auth interceptor
  • Dark fantasy CSS theme
  • Responsive breakpoints (1400px, 1024px, 768px)

Database

  • SQLite for portal users and data (file-based, no external service needed)
  • MSSQL for game server characters (direct SQL)
  • Database file (dev.db) persisted via Docker volume

Docker Infrastructure

  • docker-compose.yml with 3 services
  • API Dockerfile (node:18-slim + OpenSSL + MSSQL)
  • React Dockerfile (multi-stage build with nginx)
  • Nginx reverse proxy config
  • Health checks for PostgreSQL
  • Service dependencies ordering

📁 Project Structure

/home/user/Documents/LA2NodeJS/
├── docker-compose.yml
├── Dockerfile.api
├── Dockerfile.react
├── .env                          # Game server config here
├── nginx/default.conf
├── SQL/
│   └── x_self.sql               # Reference SQL patterns
├── api/
│   ├── package.json
│   ├── prisma/schema.prisma
│   └── src/
│       ├── index.ts
│       ├── config/
│       │   └── gameServer.ts     # MSSQL server config
│       ├── controllers/
│       │   └── auth.controller.ts
│       ├── middleware/
│       │   └── auth.ts
│       ├── services/
│       │   └── gameServerService.ts  # MSSQL queries
│       ├── routes/
│       │   ├── auth.routes.ts
│       │   ├── user.routes.ts
│       │   └── admin.routes.ts
│       └── utils/
│           └── errorHandler.ts
└── react-client/
    ├── package.json
    ├── vite.config.ts
    ├── tsconfig.json
    ├── index.html
    └── src/
        ├── App.tsx
        ├── main.tsx
        ├── index.css              # Full HD wide-screen styles
        ├── pages/
        │   ├── LandingPage.tsx
        │   ├── LoginPage.tsx
        │   ├── RegisterPage.tsx
        │   └── DashboardPage.tsx
        ├── components/
        │   └── CharacterCard.tsx
        ├── hooks/
        │   ├── useAuth.ts
        │   └── useCharacters.ts
        ├── utils/
        │   └── api.ts
        └── types/
            └── character.ts

⚙️ Configuration

Game Server Settings (.env)

# Game Server Database (MSSQL)
GAME_SERVER_HOST=192.168.1.100
GAME_SERVER_PORT=1433
GAME_SERVER_USER=sa
GAME_SERVER_PASSWORD=your_game_server_password
GAME_SERVER_DATABASE=lin2db

# Game World Database (MSSQL)
GAME_WORLD_HOST=192.168.1.100
GAME_WORLD_PORT=1433
GAME_WORLD_USER=sa
GAME_WORLD_PASSWORD=your_game_server_password
GAME_WORLD_DATABASE=lin2world

# Server Info
SERVER_ID=1
SERVER_NAME=Test
SERVER_IP=192.168.1.100
SERVER_PORT=7777

🔧 Docker Commands

# View running containers
docker compose ps

# View logs
docker compose logs -f api
docker compose logs -f react

# Stop all services
docker compose down

# Rebuild and restart
docker compose build && docker compose up -d

📊 Character Management Flow

  1. User enters game server account name in dashboard
  2. Frontend calls GET /api/users/me/characters → MSSQL query to lin2db.dbo.user_data
  3. User creates character → POST /api/users/me/characters → INSERT into user_data + builder_account
  4. User deletes character → DELETE /api/users/me/characters/:name → DELETE from both tables

Project is running successfully! 🎉