Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Run instantly with npx (no installation required!)
npx jspod

# That's it! Your Solid server is running at http://localhost:3000
# That's it! Your Solid server is running at http://localhost:5444
```

## ✨ Features
Expand Down Expand Up @@ -61,7 +61,7 @@ npx jspod
### Basic Usage

```bash
# Start with defaults (port 3000, single-user)
# Start with defaults (port 5444, single-user)
jspod

# Custom port
Expand All @@ -78,7 +78,7 @@ jspod --multiuser

```
Options:
-p, --port <number> Port to listen on (default: 3000)
-p, --port <number> Port to listen on (default: 5444)
-h, --host <address> Host to bind to (default: 0.0.0.0)
-r, --root <path> Data directory (default: ./pod-data)
--multiuser Enable multi-user mode
Expand Down Expand Up @@ -125,7 +125,7 @@ jspod

5. **Monitor logs**
```bash
jspod --verbose > jspod.log 2>&1
jspod > jspod.log 2>&1
```

## 🏃 Quickstart Examples
Expand All @@ -136,7 +136,7 @@ jspod
# Start your personal Solid pod
jspod

# Visit http://localhost:3000 in your browser
# Visit http://localhost:5444 in your browser
# Register with passkey, start storing data!
```

Expand Down Expand Up @@ -195,7 +195,7 @@ Under the hood, jspod runs JavaScriptSolidServer with these options:

```javascript
{
port: 3000, // Easy to remember
port: 5444, // Memorable, low collision with common dev servers
host: '0.0.0.0', // Accept connections from anywhere
root: './pod-data', // Local data directory
multiuser: false, // Single pod per server
Expand All @@ -210,7 +210,7 @@ Under the hood, jspod runs JavaScriptSolidServer with these options:
npx jspod
```

**Step 2**: Open your browser to `http://localhost:3000`
**Step 2**: Open your browser to `http://localhost:5444`

**Step 3**: Register with a passkey
- Click "Register" or "Sign Up"
Expand All @@ -223,7 +223,7 @@ npx jspod
- Your data stays on your server

**Troubleshooting**:
- **Port in use?** Run `jspod --port 3001`
- **Port in use?** Run `jspod --port 5445`
- **Data location?** Check `./pod-data` directory
- **Can't register?** Make sure your browser supports WebAuthn (Chrome, Firefox, Safari, Edge all work)

Expand Down
21 changes: 13 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import { spawn } from 'child_process';
import { fileURLToPath } from 'url';
import { dirname, join, delimiter } from 'path';
import chalk from 'chalk';
import { existsSync, mkdirSync } from 'fs';
import { existsSync, mkdirSync, readFileSync } from 'fs';

const __dirname = dirname(fileURLToPath(import.meta.url));
const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8'));

// Parse CLI arguments
const args = process.argv.slice(2);
Expand All @@ -36,33 +37,37 @@ for (let i = 0; i < args.length; i++) {
options.multiuser = true;
} else if (arg === '--no-auth') {
options.auth = false;
} else if (arg === '--version' || arg === '-v') {
console.log(`jspod v${pkg.version}`);
process.exit(0);
} else if (arg === '--help') {
console.log(chalk.cyan(`
╔═══════════════════════════════════════════════════════════════════╗
║ jspod - Help ║
╚═══════════════════════════════════════════════════════════════════╝
`));
console.log(chalk.white('Usage:'));
console.log(chalk.yellow(' jssd') + chalk.dim(' [options]\n'));
console.log(chalk.yellow(' jspod') + chalk.dim(' [options]\n'));
console.log(chalk.white('Options:'));
console.log(chalk.green(' -p, --port ') + chalk.yellow('<number>') + chalk.dim(' Port to listen on (default: 5444)'));
console.log(chalk.green(' -h, --host ') + chalk.yellow('<address>') + chalk.dim(' Host to bind to (default: 0.0.0.0)'));
console.log(chalk.green(' -r, --root ') + chalk.yellow('<path>') + chalk.dim(' Data directory (default: ./pod-data)'));
console.log(chalk.green(' --multiuser') + chalk.dim(' Enable multi-user mode'));
console.log(chalk.green(' --no-auth') + chalk.dim(' Disable authentication'));
console.log(chalk.green(' -v, --version') + chalk.dim(' Show jspod version'));
console.log(chalk.green(' --help') + chalk.dim(' Show this help message\n'));
console.log(chalk.white('Examples:'));
console.log(chalk.dim(' jssd'));
console.log(chalk.dim(' jssd --port 8080 --root /var/pods'));
console.log(chalk.dim(' jssd --multiuser\n'));
console.log(chalk.dim(' jspod'));
console.log(chalk.dim(' jspod --port 8080 --root /var/pods'));
console.log(chalk.dim(' jspod --multiuser\n'));
console.log(chalk.white('Features:'));
console.log(chalk.dim(' • Solid Protocol compliant'));
console.log(chalk.dim(' • WebID authentication'));
console.log(chalk.dim(' • Passkey support'));
console.log(chalk.dim(' • WebSocket notifications'));
console.log(chalk.dim(' • JSON-LD native\n'));
console.log(chalk.white('Resources:'));
console.log(chalk.blue(' https://github.com/JavaScriptSolidServer/jssd'));
console.log(chalk.blue(' https://github.com/JavaScriptSolidServer/jspod'));
console.log(chalk.blue(' https://solidproject.org\n'));
process.exit(0);
} else {
Expand Down Expand Up @@ -111,7 +116,7 @@ console.log(chalk.cyan(' ├─ ') + chalk.green('Notifications ') + chal
console.log(chalk.cyan(' └─ ') + chalk.green('JSON-LD Native ') + chalk.bold.green('✓'));

console.log('\n' + chalk.bold.white('📚 Resources:\n'));
console.log(chalk.cyan(' ├─ ') + chalk.white('Server: ') + chalk.blue.underline('https://github.com/JavaScriptSolidServer/jssd'));
console.log(chalk.cyan(' ├─ ') + chalk.white('Server: ') + chalk.blue.underline('https://github.com/JavaScriptSolidServer/jspod'));
console.log(chalk.cyan(' ├─ ') + chalk.white('Solid: ') + chalk.blue.underline('https://solidproject.org'));
console.log(chalk.cyan(' └─ ') + chalk.white('WebID: ') + chalk.blue.underline('https://www.w3.org/2005/Incubator/webid/spec'));

Expand All @@ -138,7 +143,7 @@ const jss = spawn('jss', jssArgs, {
env: {
...process.env,
PATH: `${join(__dirname, 'node_modules', '.bin')}${delimiter}${process.env.PATH}`,
TOKEN_SECRET: process.env.TOKEN_SECRET || 'jssd-default-secret-change-in-production',
TOKEN_SECRET: process.env.TOKEN_SECRET || 'jspod-default-secret-change-in-production',
NODE_ENV: process.env.NODE_ENV || 'development'
}
});
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jspod",
"version": "0.0.7",
"version": "0.0.8",
"description": "JavaScript Solid Pod - Just works, batteries included",
"type": "module",
"main": "index.js",
Expand Down Expand Up @@ -37,6 +37,6 @@
},
"dependencies": {
"chalk": "^5.6.2",
"javascript-solid-server": "^0.0.186"
"javascript-solid-server": "^0.0.194"
}
}