Rebrand README to EpicNext-CMS with professional English rewrite

This commit is contained in:
openhands committed 2026-07-10 19:25:20 +02:00
1 parent 9255788b06
commit 4ae9cbad13
1 file changed
+77 -69
+77 -69
View File
@@ -1,7 +1,8 @@
# AtomCMS — Next.js # EpicNext-CMS
AtomCMS (originally Laravel) converted to **Next.js 16** (App Router) with **Prisma 7** against the same Arcturus Morningstar MySQL/MariaDB database. A modern, high-performance content management system for Habbo hotel emulators, built on **Next.js 16** (App Router) with **Prisma 7**. Designed to integrate seamlessly with the Arcturus Morningstar MySQL/MariaDB database.
NextAuth for authentication (argon2id/bcrypt + md5→argon2id upgrade), RCON to the emulator, full public site + admin panel.
Features full public-facing website, administrative panel, NextAuth authentication (argon2id/bcrypt with MD5-to-argon2id upgrade path), real-time RCON communication with the emulator, and extensive extensibility.
--- ---
@@ -12,32 +13,31 @@ NextAuth for authentication (argon2id/bcrypt + md5→argon2id upgrade), RCON to
| Node.js | >= 22 | | Node.js | >= 22 |
| pnpm | >= 10.33.4 | | pnpm | >= 10.33.4 |
| MySQL / MariaDB | 8.0+ / 10.6+ | | MySQL / MariaDB | 8.0+ / 10.6+ |
| Redis | optional (caching / rate limiting) | | Redis | Optional (caching / rate limiting) |
--- ---
## 1. Database Setup ## 1. Database Setup
This CMS **shares** the database with the Arcturus Morningstar emulator. EpicNext-CMS shares a database with the Arcturus Morningstar emulator. You may use an existing or empty database.
You need an existing (or empty) database.
**Create a new database:** **Create a new database:**
```sql ```sql
CREATE DATABASE IF NOT EXISTS atomcms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE DATABASE IF NOT EXISTS epicnext_cms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
``` ```
**Use an existing emulator database:** **Use an existing emulator database:**
Point `DATABASE_URL` to your existing database — the CMS reads the emulator tables (`users`, `users_currency`, `bans`, etc.) directly. Point `DATABASE_URL` to your existing database — the CMS reads emulator tables (`users`, `users_currency`, `bans`, etc.) directly.
**Create CMS tables:** **Create CMS tables:**
After configuring `.env`, run the migration script (step 5). This only creates CMS-owned tables (`website_*`, `radio_*`, etc.). After configuring `.env`, run the migration script (step 5). This creates only CMS-owned tables (`website_*`, `radio_*`, etc.), leaving the emulator schema untouched.
--- ---
## 2. Environment Variables ## 2. Environment Variables
Copy `.env.example` to `.env` and fill in: Copy `.env.example` to `.env` and configure:
```bash ```bash
cp .env.example .env cp .env.example .env
@@ -46,13 +46,13 @@ cp .env.example .env
### Required ### Required
```dotenv ```dotenv
DATABASE_URL=mysql://user:[email protected]:3306/atomcms DATABASE_URL=mysql://user:[email protected]:3306/epicnext_cms
AUTH_SECRET= # at least 32 chars, random string AUTH_SECRET= # minimum 32 characters, random
HOTEL_NAME=YourHotel HOTEL_NAME=YourHotel
APP_URL=http://localhost:3000 APP_URL=http://localhost:3000
``` ```
### Database pool (tunable) ### Database Pool (Tunable)
```dotenv ```dotenv
DATABASE_POOL_SIZE=40 DATABASE_POOL_SIZE=40
@@ -60,39 +60,39 @@ DATABASE_IDLE_TIMEOUT_MS=300000
DATABASE_CONNECT_TIMEOUT_MS=10000 DATABASE_CONNECT_TIMEOUT_MS=10000
``` ```
### Password settings ### Password Settings
```dotenv ```dotenv
CONVERT_PASSWORDS=false # set to true to upgrade old md5 hashes to argon2id on login CONVERT_PASSWORDS=false # enable to upgrade legacy MD5 hashes to argon2id on login
PASSWORD_HASH=bcrypt # bcrypt (default) or argon2id PASSWORD_HASH=bcrypt # bcrypt (default) or argon2id
``` ```
### Laravel APP_KEY (for 2FA) ### Laravel APP_KEY (2FA Migration)
Only needed to read existing **Laravel-encrypted 2FA secrets**: Required only for reading existing Laravel-encrypted 2FA secrets:
```dotenv ```dotenv
APP_KEY=base64:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx== APP_KEY=base64:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx==
``` ```
### RCON (emulator link) ### RCON (Emulator Bridge)
For live credits, badges, motto changes, rank changes, kick/ban: Enables live credits, badges, motto changes, rank changes, kick/ban:
```dotenv ```dotenv
RCON_HOST=127.0.0.1 RCON_HOST=127.0.0.1
RCON_PORT=3001 RCON_PORT=3001
``` ```
### Badge upload (emulator directory) ### Badge Upload (Emulator Directory)
```dotenv ```dotenv
BADGE_UPLOAD_DIR=/path/to/emulator/assets/c_images/album1584 BADGE_UPLOAD_DIR=/path/to/emulator/assets/c_images/album1584
``` ```
### Email (password reset / notifications) ### Email (Password Reset / Notifications)
Two options — **Resend** (recommended, simple) or **SMTP**: Two options — **Resend** (recommended) or **SMTP**:
```dotenv ```dotenv
# Resend (preferred) # Resend (preferred)
@@ -115,27 +115,27 @@ GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET= GOOGLE_CLIENT_SECRET=
``` ```
### PayPal (credit purchases) ### PayPal (Credit Purchases)
```dotenv ```dotenv
PAYPAL_CLIENT_ID= PAYPAL_CLIENT_ID=
PAYPAL_SECRET= PAYPAL_SECRET=
PAYPAL_API=https://api-m.sandbox.paypal.com # sandbox = test, live = https://api-m.paypal.com PAYPAL_API=https://api-m.sandbox.paypal.com # sandbox for testing; live: https://api-m.paypal.com
``` ```
### Redis (caching / rate limiting) ### Redis (Caching / Rate Limiting)
```dotenv ```dotenv
REDIS_URL=redis://127.0.0.1:6379 REDIS_URL=redis://127.0.0.1:6379
``` ```
### AI content moderation (Comments / Guestbook) ### AI Content Moderation (Comments / Guestbook)
```dotenv ```dotenv
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx
``` ```
### Notifications / logging ### Notifications & Logging
```dotenv ```dotenv
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/... DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...
@@ -143,12 +143,12 @@ [email protected]
LOG_LEVEL=info # debug | info | warn | error LOG_LEVEL=info # debug | info | warn | error
``` ```
### Emulator JAR backup (jobs worker) ### Emulator JAR Backup (Jobs Worker)
```dotenv ```dotenv
EMULATOR_JAR_PATH=/path/to/emulator.jar EMULATOR_JAR_PATH=/path/to/emulator.jar
EMULATOR_BACKUP_DIR=/path/to/backups EMULATOR_BACKUP_DIR=/path/to/backups
EMULATOR_BACKUP_KEEP=7 # number of backups to keep EMULATOR_BACKUP_KEEP=7 # number of backups to retain
``` ```
--- ---
@@ -167,7 +167,7 @@ pnpm install
pnpm prisma:generate pnpm prisma:generate
``` ```
This generates TypeScript types in `src/generated/prisma/`. Generates TypeScript types in `src/generated/prisma/`.
--- ---
@@ -177,9 +177,9 @@ This generates TypeScript types in `src/generated/prisma/`.
pnpm db:migrate pnpm db:migrate
``` ```
This executes the SQL files in `prisma/migrations/` on the database and creates the CMS tables (9 migrations). Executes SQL files in `prisma/migrations/` against the database, creating all CMS-owned tables.
**Check status:** **Check migration status:**
```bash ```bash
pnpm db:migrate:status pnpm db:migrate:status
@@ -189,23 +189,23 @@ pnpm db:migrate:status
## 6. Configure Website Settings ## 6. Configure Website Settings
After starting (step 7) and logging in as admin: After starting the server (step 7) and logging in as an administrator:
1. Go to **Admin → CMS Settings** (`/admin/settings`) 1. Navigate to **Admin → CMS Settings** (`/admin/settings`).
2. At minimum, configure: 2. Configure the following essentials:
- `hotel_name` — your hotel name - `hotel_name` — your hotel name
- `habbo_imaging_url` — avatar image URL (default: `https://www.habbo.com/habbo-imaging/avatarimage`) - `habbo_imaging_url` — avatar image URL (default: `https://www.habbo.com/habbo-imaging/avatarimage`)
- `nitro_client_url` — Nitro client URL (see `update-Nitrov3.sh`) - `nitro_client_url` — Nitro client URL (refer to `update-Nitrov3.sh`)
- `logo_url` — path to your logo - `logo_url` — path to your logo
- `cms_favicon` — favicon URL - `cms_favicon` — favicon URL
- `min_staff_rank` — minimum rank for admin access (default: 7) - `min_staff_rank` — minimum rank required for admin access (default: 7)
- Optionally: theme colors, CAPTCHA, VPN blocking, etc. - Optionally: theme colors, CAPTCHA, VPN blocking, and more.
--- ---
## 7. Start the Site ## 7. Start the Server
### Development (hot reload) ### Development (Hot Reload)
```bash ```bash
pnpm dev pnpm dev
@@ -217,13 +217,13 @@ pnpm dev
pnpm build && pnpm start pnpm build && pnpm start
``` ```
### TypeScript check ### TypeScript Check
```bash ```bash
pnpm typecheck pnpm typecheck
``` ```
### Run tests ### Run Tests
```bash ```bash
pnpm test pnpm test
@@ -233,25 +233,25 @@ pnpm test
## 8. Jobs Worker (Background Tasks) ## 8. Jobs Worker (Background Tasks)
Run this as a persistent process (e.g. via systemd / screen / PM2): Run as a persistent process (e.g., via systemd, screen, or PM2):
```bash ```bash
pnpm jobs:worker pnpm jobs:worker
``` ```
This executes: Scheduled tasks:
- **Daily at 03:00** — Emulator JAR backup (only if `EMULATOR_JAR_PATH` + `EMULATOR_BACKUP_DIR` are set) - **Daily at 03:00** — Emulator JAR backup (when `EMULATOR_JAR_PATH` and `EMULATOR_BACKUP_DIR` are configured)
- **Daily at 04:00** — Clean up old login logs (>30 days) and expired password reset tokens (>7 days) - **Daily at 04:00** — Cleanup of login logs older than 30 days and expired password reset tokens older than 7 days
--- ---
## 9. First Login ## 9. First Login
1. Open `http://localhost:3000` in your browser 1. Open `http://localhost:3000` in your browser.
2. Register an account via `/register` **OR** log in with an existing account 2. Register an account via `/register`, or log in with an existing account.
3. To get admin access, your rank must be >= `min_staff_rank` (default 7) 3. To obtain administrator access, your rank must equal or exceed `min_staff_rank` (default: 7).
- Set it directly in the database: `UPDATE users SET rank = 7 WHERE username = 'yourname';` - Set it directly in the database: `UPDATE users SET rank = 7 WHERE username = 'yourname';`
4. Go to `/admin` for the admin panel 4. Access the admin panel at `/admin`.
--- ---
@@ -259,37 +259,39 @@ This executes:
### Emulator — RCON ### Emulator — RCON
For live actions (credits, badges, rank changes, kick/ban), the Arcturus emulator must be running with RCON enabled on the same `RCON_HOST:RCON_PORT`. For live actions (credits, badges, rank changes, kick/ban), the Arcturus emulator must be running with RCON enabled and accessible at the configured `RCON_HOST:RCON_PORT`.
### Client — Nitro ### Client — Nitro
The `/client` page loads the Nitro client. Configure the client URL in `website_settings` via **Admin → CMS Settings** (`nitro_client_url`). The `/client` page loads the Nitro client. Configure the client URL via **Admin → CMS Settings** (`nitro_client_url`).
### Radio ### Radio
If you use a radio (e.g. Azuracast), configure: For use with a streaming radio (e.g., Azuracast):
- `radio_now_playing_api_url` - `radio_now_playing_api_url`
- `radio_listeners_api_url` - `radio_listeners_api_url`
### CAPTCHA ### CAPTCHA
Supports Cloudflare Turnstile and Google reCAPTCHA. Configure in **Admin → CMS Settings**: Supports Cloudflare Turnstile and Google reCAPTCHA. Configure via **Admin → CMS Settings**:
- `captcha_provider` — `turnstile` or `recaptcha` - `captcha_provider` — `turnstile` or `recaptcha`
- `turnstile_site_key` / `turnstile_secret` - `turnstile_site_key` / `turnstile_secret`
- `recaptcha_site_key` / `recaptcha_secret` - `recaptcha_site_key` / `recaptcha_secret`
### Theme ### Theming
12 preset themes available via **Admin → Theme** (`/admin/theme`), plus fully customizable colors. 12 preset themes are available via **Admin → Theme** (`/admin/theme`), along with fully customizable color schemes.
--- ---
## Database Overview ## Database Architecture
| Component | Type | Migrations | | Component | Type | Migrations |
|---|---|---| |---|---|---|
| Emulator tables (users, items, rooms, etc.) | Existing Arcturus schema | None — CMS reads only | | Emulator tables (`users`, `items`, `rooms`, etc.) | Existing Arcturus schema | None — read-only for CMS |
| CMS tables (website_*, radio_*, etc.) | CMS-owned | `prisma/migrations/*.sql` (9 files) | | CMS tables (`website_*`, `radio_*`, etc.) | CMS-owned | `prisma/migrations/*.sql` (9 files) |
| Migration tracking | `cms_migrations` table | Auto-created | | Migration tracking | `cms_migrations` table | Auto-created |
--- ---
@@ -302,19 +304,25 @@ Supports Cloudflare Turnstile and Google reCAPTCHA. Configure in **Admin → CMS
│ └── migrations/ # 9 SQL migrations for CMS tables │ └── migrations/ # 9 SQL migrations for CMS tables
├── scripts/ ├── scripts/
│ ├── apply-migrations.ts # migration runner │ ├── apply-migrations.ts # migration runner
│ └── jobs-worker.ts # background tasks (backups, cleanup) │ └── jobs-worker.ts # background task scheduler
├── src/ ├── src/
│ ├── app/ # Next.js App Router (pages + API) │ ├── app/ # Next.js App Router (pages & API routes)
│ ├── actions/ # Server Actions │ ├── actions/ # Server Actions
│ ├── components/ # UI components (top-header, navigation, etc.) │ ├── components/ # UI components (header, navigation, etc.)
│ ├── lib/ │ ├── lib/
│ │ ├── auth/ # NextAuth + password hashes + 2FA │ │ ├── auth/ # NextAuth with password hashing & 2FA
│ │ ├── services/ # RCON, email, currency, PayPal, etc. │ │ ├── services/ # RCON, email, currency, PayPal, etc.
│ │ ├── prisma.ts # database connection │ │ ├── prisma.ts # database connection singleton
│ │ └── redis.ts # Redis client │ │ └── redis.ts # Redis client abstraction
│ ├── messages/ # i18n (en, nl, de, fr, es, it) │ ├── messages/ # i18n translations (en, nl, de, fr, es, it)
│ └── env.ts # Zod validation for environment variables │ └── env.ts # Zod-validated environment schema
├── public/assets/ # images, icons, fonts ├── public/assets/ # images, icons, fonts
├── .env.example # example configuration ├── .env.example # environment template
└── update-Nitrov3.sh # emulator + Nitro updater (Remco) └── update-Nitrov3.sh # emulator & Nitro updater utility
``` ```
---
## License
This project is licensed under the **CC BY-NC-SA 4.0** license. See `LICENSE` for details.