updated readme.md
This commit is contained in:
1 parent
b4c6c48958
commit
da39fd4fd0
1 file changed
+108
-69
@@ -1,36 +1,50 @@
|
||||
# GD FEDL
|
||||
|
||||
A Geometry Dash FEDL-style website with a live server-backed main list.
|
||||
GD FEDL is a small multi-page Geometry Dash list site with a static frontend and a lightweight Node.js backend for live list data, run submissions, and admin moderation.
|
||||
|
||||
It includes:
|
||||
## What It Includes
|
||||
|
||||
- a home page
|
||||
- a main list page
|
||||
- a run submission page
|
||||
- a players page
|
||||
- a rules page
|
||||
- an admin panel for the list and submitted runs
|
||||
- `index.html` landing page with live list stats and featured entries
|
||||
- `lists.html` ranked list browser with search, range filters, and video modal playback
|
||||
- `run.html` run submission form with a live submission queue
|
||||
- `admelist.html` admin panel for editing the list and reviewing submitted runs
|
||||
- `guess.html` rank guessing game
|
||||
- `roulette.html` demon roulette picker with level ID lookups
|
||||
- `rules.html` submission and moderation rules
|
||||
- `players.html` browser-local player tracker
|
||||
- `errors.html` plus individual HTTP-style error pages
|
||||
|
||||
## Project Files
|
||||
## Tech Stack
|
||||
|
||||
- `index.html` - home page
|
||||
- `lists.html` - main live list view
|
||||
- `run.html` - live run submission page
|
||||
- `players.html` - player manager
|
||||
- `rules.html` - submission rules and mod guidelines
|
||||
- `admelist.html` - admin panel for list edits and run review
|
||||
- `app.js` - client-side logic
|
||||
- `styles.css` - site styling
|
||||
- `data.txt` - static fallback list data
|
||||
- `server/data.txt` - live server list data
|
||||
- `server/runs.json` - live run submission queue
|
||||
- `server/server.js` - Node.js server for the live list
|
||||
- `start-server.command` - one-click launcher for macOS
|
||||
- `server/LINUX_SERVICE_SETUP.txt` - Linux `systemd` setup notes
|
||||
- Plain HTML, CSS, and JavaScript
|
||||
- No build step
|
||||
- Node.js `http` server
|
||||
- Server-Sent Events for live updates
|
||||
- Browser `localStorage` / `sessionStorage` for local state
|
||||
|
||||
## Project Structure
|
||||
|
||||
- `index.html` main landing page
|
||||
- `lists.html` live list page
|
||||
- `run.html` run submission page
|
||||
- `admelist.html` admin page
|
||||
- `guess.html` guessing game
|
||||
- `roulette.html` roulette page
|
||||
- `players.html` local player manager
|
||||
- `rules.html` rules page
|
||||
- `errors.html` error page gallery
|
||||
- `401.html`, `403.html`, `404.html`, `429.html`, `500.html`, `502.html`, `503.html` standalone error pages
|
||||
- `app.js` shared frontend logic for all pages
|
||||
- `styles.css` shared site styling
|
||||
- `data.txt` static fallback list data
|
||||
- `level-ids.txt` optional local level ID lookup data for roulette
|
||||
- `server/server.js` backend for list data, run submissions, auth, and live events
|
||||
- `server/LINUX_SERVICE_SETUP.txt` example `systemd` setup notes
|
||||
- `start-server.command` macOS launcher for the Node server
|
||||
|
||||
## Data Format
|
||||
|
||||
Both `data.txt` and `server/data.txt` use the same format:
|
||||
The list data file uses one entry per line in this format:
|
||||
|
||||
```txt
|
||||
category|position|title|url
|
||||
@@ -42,86 +56,111 @@ Example:
|
||||
new|1|Flamewall|https://youtu.be/x4Io4zkWVRw
|
||||
```
|
||||
|
||||
## Pages
|
||||
The frontend parses that into:
|
||||
|
||||
- `lists.html` is the main live list page.
|
||||
- `roulette.html` uses the same live server-backed list.
|
||||
- `run.html` submits runs into the live moderation queue.
|
||||
- `admelist.html` lets you edit the list and review submissions.
|
||||
- `level` / category
|
||||
- `position`
|
||||
- `title`
|
||||
- `url`
|
||||
|
||||
## Fallback Order
|
||||
## Backend API
|
||||
|
||||
The live list tries these in order:
|
||||
The Node server exposes these routes:
|
||||
|
||||
1. `/api/list`
|
||||
2. `server/data.txt`
|
||||
3. `data.txt`
|
||||
- `GET /api/list` returns the live list
|
||||
- `PUT /api/list` replaces the live list data
|
||||
- `GET /api/runs` returns submitted runs
|
||||
- `POST /api/runs` creates a run submission
|
||||
- `PUT /api/runs/:id` updates a submission
|
||||
- `DELETE /api/runs/:id` deletes a submission
|
||||
- `GET /events` streams `list-update` and `runs-update` events
|
||||
|
||||
That means `lists.html` can still show data even if the live API is down.
|
||||
If `ADMIN_PASSWORD` is set, list editing and run moderation routes require HTTP Basic auth.
|
||||
|
||||
## Running The Static Site
|
||||
## Local Setup
|
||||
|
||||
If you only want the static pages, you can run a simple file server:
|
||||
1. Make sure Node.js is installed.
|
||||
2. Create the server data files if they do not exist yet:
|
||||
|
||||
```bash
|
||||
python3 -m http.server 8000
|
||||
printf "new|1|Example Level|https://youtu.be/example\n" > server/data.txt
|
||||
printf "[]\n" > server/runs.json
|
||||
```
|
||||
|
||||
Then open:
|
||||
|
||||
```txt
|
||||
http://localhost:8000
|
||||
```
|
||||
|
||||
## Running The Live Server
|
||||
|
||||
The live list uses the Node server:
|
||||
3. Start the server:
|
||||
|
||||
```bash
|
||||
node server/server.js
|
||||
```
|
||||
|
||||
Or to allow other devices on your network to connect:
|
||||
4. Open the site at:
|
||||
|
||||
```txt
|
||||
http://127.0.0.1:8090/fedl/
|
||||
```
|
||||
|
||||
To expose it on your local network:
|
||||
|
||||
```bash
|
||||
HOST=0.0.0.0 PORT=8090 node server/server.js
|
||||
```
|
||||
|
||||
Then open:
|
||||
On macOS you can also run:
|
||||
|
||||
```txt
|
||||
http://localhost:8090/fedl/lists.html
|
||||
http://localhost:8090/fedl/run.html
|
||||
http://localhost:8090/fedl/admelist.html
|
||||
./start-server.command
|
||||
```
|
||||
|
||||
On macOS you can also use:
|
||||
## Important Frontend Note
|
||||
|
||||
`app.js` currently uses this hardcoded live server base:
|
||||
|
||||
```txt
|
||||
start-server.command
|
||||
https://raspberrypi-1.tail46eacb.ts.net/fedl
|
||||
```
|
||||
|
||||
## Hosting On Another Device
|
||||
That means:
|
||||
|
||||
If you want one device to host the live list for other devices:
|
||||
- when the site is opened over `http` or `https`, the frontend will try that remote live server first
|
||||
- when the site is opened directly from disk with `file://`, it falls back to local `data.txt`
|
||||
- if you want the frontend to use your own local Node server as the primary live backend, update `liveServerBase` in `app.js`
|
||||
|
||||
1. Run the server with `HOST=0.0.0.0`.
|
||||
2. Open or forward port `8090`.
|
||||
3. Visit `http://YOUR-IP:8090/fedl/lists.html`, `http://YOUR-IP:8090/fedl/run.html`, or `http://YOUR-IP:8090/fedl/admelist.html`.
|
||||
## Fallback Behavior
|
||||
|
||||
If you already have router port forwarding set up, point it to the machine running `server/server.js`.
|
||||
List loading tries these sources in order:
|
||||
|
||||
## Linux Service
|
||||
1. Remote live API: `/api/list`
|
||||
2. Remote live data file: `/server/data.txt`
|
||||
3. Local `data.txt`
|
||||
|
||||
For running the Node server automatically on boot on Linux, see:
|
||||
Run data comes from the live runs API when available. If the live backend is unavailable, run submissions and moderation will not work.
|
||||
|
||||
`server/LINUX_SERVICE_SETUP.txt`
|
||||
## Environment Variables
|
||||
|
||||
- `HOST` server bind host, default `127.0.0.1`
|
||||
- `PORT` server port, default `8090`
|
||||
- `ADMIN_PASSWORD` optional admin password for protected write actions
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
ADMIN_PASSWORD=changeme HOST=0.0.0.0 PORT=8090 node server/server.js
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Player data is stored in the browser with `localStorage`
|
||||
- The players list is local to each browser/device
|
||||
- The live list data is stored in `server/data.txt`
|
||||
- The live run queue is stored in `server/runs.json`
|
||||
- The static fallback list data is stored in `data.txt`
|
||||
- The project does not need a build step
|
||||
- `players.html` stores player data only in the current browser via `localStorage`
|
||||
- admin auth is stored only for the current browser session
|
||||
- `roulette.html` can use `level-ids.txt` first, then fall back to the GD Browser API lookup
|
||||
- the backend automatically creates `server/runs.json` if it is missing
|
||||
- the backend does not automatically create `server/data.txt`, so create that file before first run
|
||||
|
||||
## Linux Service
|
||||
|
||||
For running the server on boot with `systemd`, see:
|
||||
|
||||
- `server/LINUX_SERVICE_SETUP.txt`
|
||||
|
||||
## License
|
||||
|
||||
See `LICENSE`.
|
||||
Reference in new issue
Block a user