hacker-lobby 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +48 -44
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,17 +1,29 @@
1
1
  # 📟 Hacker Lobby
2
2
 
3
- A secure, real-time, multiplayer terminal chat application built with a zero-dependency Node.js CLI frontend and a Cloudflare Workers/D1 database serverless backend.
3
+ A secure, real-time, multiplayer terminal chat application that connects hackers globally. The application runs entirely within your terminal, utilizing a serverless Cloudflare Workers and D1 database backend on the edge to deliver real-time messaging without latency.
4
4
 
5
5
  ---
6
6
 
7
- ## 🚀 Getting Started with Node.js, npm, and npx
7
+ ## 🌍 Global Access & Connecting Globally
8
8
 
9
- To run the Hacker Lobby client and server, you need **Node.js** installed on your system. Node.js comes bundled with **npm** (Node Package Manager) and **npx** (Node Package Runner) automatically.
9
+ Hacker Lobby is designed to connect people globally. When you run the application, it connects to a production server deployed on Cloudflare's serverless edge network. This allows you to chat in real-time with developers and terminal enthusiasts from all around the world.
10
10
 
11
- ### 📥 1. Installation Guide
11
+ * **Global API Backend URL**: `https://hacker-lobby-backend.spidozx.workers.dev`
12
+
13
+ ---
14
+
15
+ ## 📥 Prerequisites: Downloading Node.js and npm
16
+
17
+ To run the Hacker Lobby client, you need **Node.js** installed on your system.
18
+
19
+ When you install Node.js, it automatically installs:
20
+ 1. **npm (Node Package Manager)**: Used for installing and managing Node.js packages.
21
+ 2. **npx (Node Package Runner)**: Used to execute Node.js CLI packages directly without manual global installation.
22
+
23
+ ### How to Download and Install
12
24
 
13
25
  #### 🪟 Windows
14
- * **Direct Installer**: Download the recommended LTS installer from the [official Node.js website](https://nodejs.org/). Run the `.msi` file and follow the default prompts.
26
+ * **Direct Installer**: Download the recommended LTS installer from the [official Node.js website](https://nodejs.org/). Run the downloaded `.msi` file and follow the installer prompts.
15
27
  * **Terminal (Winget)**: Open PowerShell or Command Prompt as administrator and run:
16
28
  ```powershell
17
29
  winget install OpenJS.NodeJS
@@ -25,75 +37,67 @@ To run the Hacker Lobby client and server, you need **Node.js** installed on you
25
37
  ```
26
38
 
27
39
  #### 🐧 Linux (Ubuntu/Debian)
28
- Open Terminal and run the following command to install Node.js and npm:
40
+ Open Terminal and run the following commands to install Node.js and npm:
29
41
  ```bash
30
42
  sudo apt update
31
43
  sudo apt install nodejs npm -y
32
44
  ```
33
45
 
34
- ---
35
-
36
- ### 💻 2. Accessing and Verifying via Terminal
37
-
38
- Once installed, restart your terminal application (PowerShell, Command Prompt, or bash) and verify the installation:
46
+ ### Verifying Your Installation
47
+ Once the installation is complete, restart your terminal application (PowerShell, Command Prompt, or bash) and verify the setup:
39
48
 
40
- 1. **Verify Node.js** (executes JavaScript code):
49
+ 1. **Verify Node.js**:
41
50
  ```bash
42
51
  node -v
43
52
  ```
44
- 2. **Verify npm** (installs and manages dependencies):
53
+ 2. **Verify npm**:
45
54
  ```bash
46
55
  npm -v
47
56
  ```
48
- 3. **Verify npx** (executes npm packages without globally installing them):
57
+ 3. **Verify npx**:
49
58
  ```bash
50
59
  npx -v
51
60
  ```
52
61
 
53
62
  ---
54
63
 
55
- ## 🛠️ Project Setup
56
-
57
- Follow these steps to set up and run Hacker Lobby locally:
58
-
59
- ### 1. Install Dependencies
60
- Clone the repository, navigate to the folder, and run:
61
- ```bash
62
- npm install
63
- ```
64
-
65
- ### 2. Configure Backend Database
66
- Initialize the local Cloudflare D1 database and apply the SQL schema:
67
- ```bash
68
- npx wrangler d1 execute chat-db --local --file=schema.sql
69
- ```
64
+ ## 🚀 How to Access Hacker Lobby
70
65
 
71
- ### 3. Run the Backend Server
72
- Start the local serverless backend with Wrangler:
73
- ```bash
74
- npx wrangler dev
75
- ```
76
- The server will start listening at `http://127.0.0.1:8787`.
66
+ You can connect to the global chat room instantly using `npx`. There is no need to clone the repository or set up a local server.
77
67
 
78
- ### 4. Connect with CLI Chat Client
79
- Configure the client to connect to your local backend server using environment variables:
68
+ Run one of the following commands in your terminal, which configures the `API_URL` environment variable to point to the global server and launches the client:
80
69
 
81
70
  * **PowerShell (Windows)**:
82
71
  ```powershell
83
- $env:API_URL="http://127.0.0.1:8787"; node index.js
72
+ $env:API_URL="https://hacker-lobby-backend.spidozx.workers.dev"; npx hacker-lobby
73
+ ```
74
+ * **Command Prompt (Windows)**:
75
+ ```cmd
76
+ set API_URL=https://hacker-lobby-backend.spidozx.workers.dev && npx hacker-lobby
84
77
  ```
85
78
  * **macOS / Linux / Git Bash**:
86
79
  ```bash
87
- API_URL="http://127.0.0.1:8787" node index.js
80
+ API_URL="https://hacker-lobby-backend.spidozx.workers.dev" npx hacker-lobby
88
81
  ```
89
82
 
90
83
  ---
91
84
 
85
+ ## 💬 How to Use
86
+
87
+ Once inside the lobby, you can interact with the global room:
88
+
89
+ 1. **Choose an Alias**: Type your nickname and press **Enter**.
90
+ 2. **Lock Your Alias (Optional)**: If you choose to lock your alias, you will be prompted to create a password. For security, characters are hidden as you type.
91
+ 3. **Chatting**: Type your message and press **Enter** to broadcast it.
92
+ 4. **Commands**:
93
+ * Type `/exit` or `/quit` to close the application.
94
+
95
+ ---
96
+
92
97
  ## ✨ Features
93
98
 
94
99
  - **Real-Time Messaging**: Built on Server-Sent Events (SSE) for zero-latency multiplayer updates.
95
- - **Secure Alias Locking**: Users can register and lock their alias with a password. Password hashes are calculated locally and checked securely using SHA-256 and salt on the database.
96
- - **Input Masking**: Passwords and confirmation queries are muted on the terminal during entry.
97
- - **Anti-Spam Rate Limiting**: Built-in IP-based Token Bucket rate limiting (capacity: 5 requests, refilling 1 token every 1.5 seconds) to prevent bot spam.
98
- - **Auto-Cleanup Cron**: Cloudflare worker triggers hourly routines to automatically prune chat logs older than 6 hours.
99
- - **Terminal XSS Protection**: Strip ANSI escape sequences from incoming user payloads to prevent control character injection attacks.
100
+ - **Secure Alias Locking**: Register your nickname with a password. Passwords are salted and hashed using SHA-256 for secure database verification.
101
+ - **Input Masking**: Passwords and confirmation queries are hidden on the terminal screen during entry.
102
+ - **Anti-Spam Rate Limiting**: Token-bucket rate limiting prevents message spamming.
103
+ - **Terminal XSS Protection**: Filters ANSI escape sequences to prevent control character injection attacks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hacker-lobby",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Multiplayer terminal chat application",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -17,4 +17,4 @@
17
17
  "engines": {
18
18
  "node": ">=16.0.0"
19
19
  }
20
- }
20
+ }