v0.7.0 cli client with readline added, directory structure updated
This commit is contained in:
58
README.md
58
README.md
@ -3,7 +3,7 @@
|
||||
<td>
|
||||
<h1>Go Chess API</h1>
|
||||
<p>
|
||||
<a href="https://golang.org"><img src="https://img.shields.io/badge/Go-1.24-00ADD8?style=flat&logo=go" alt="Go"></a>
|
||||
<a href="https://golang.org"><img src="https://img.shields.io/badge/Go-1.25-00ADD8?style=flat&logo=go" alt="Go"></a>
|
||||
<a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/License-BSD_3--Clause-blue.svg" alt="License"></a>
|
||||
</p>
|
||||
</td>
|
||||
@ -30,7 +30,7 @@ Go backend server providing a RESTful API for chess gameplay with user authentic
|
||||
|
||||
## Requirements
|
||||
|
||||
- Go 1.24+
|
||||
- Go 1.25+
|
||||
- Stockfish chess engine (`stockfish` in PATH)
|
||||
- SQLite3 (for persistence features)
|
||||
|
||||
@ -44,24 +44,45 @@ pkg install stockfish
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Using Make (Recommended)
|
||||
```bash
|
||||
git clone https://github.com/lixenwraith/chess
|
||||
cd chess
|
||||
make build
|
||||
|
||||
# Standard mode with persistence and auth
|
||||
make run-server
|
||||
|
||||
# Or run with web UI
|
||||
make run-server-web
|
||||
|
||||
# Initialize database with user support
|
||||
make db-init
|
||||
|
||||
# Add users via CLI
|
||||
./bin/chess-server db user add -path db/chess.db -username alice -password AlicePass123
|
||||
```
|
||||
|
||||
### Building Manually
|
||||
```bash
|
||||
#git clone https://git.lixen.com/lixen/chess # Mirror
|
||||
git clone https://github.com/lixenwraith/chess
|
||||
cd chess
|
||||
go build ./cmd/chessd
|
||||
go build ./cmd/chess-server
|
||||
|
||||
# Standard mode with persistence and auth
|
||||
./chessd -storage-path chess.db
|
||||
./chess-server -storage-path chess.db
|
||||
|
||||
# Development mode with all features
|
||||
./chessd -dev -storage-path chess.db -pid /tmp/chessd.pid -pid-lock -port 9090
|
||||
./chess-server -dev -storage-path chess.db -pid /tmp/chess-server.pid -pid-lock -port 9090
|
||||
|
||||
# Initialize database with user support
|
||||
./chessd db init -path chess.db
|
||||
./chess-server db init -path chess.db
|
||||
|
||||
# Add users via CLI
|
||||
./chessd db user add -path chess.db -username alice -password AlicePass123
|
||||
./chessd db user list -path chess.db
|
||||
./chess-server db user add -path chess.db -username alice -password AlicePass123
|
||||
./chess-server db user list -path chess.db
|
||||
```
|
||||
|
||||
Server listens on `http://localhost:8080`. See [API Reference](./doc/api.md) for endpoints including authentication.
|
||||
@ -73,28 +94,28 @@ The chess server supports user accounts with secure authentication:
|
||||
### Creating Users
|
||||
```bash
|
||||
# Add user with password
|
||||
./chessd db user add -path chess.db -username alice -email alice@example.com -password SecurePass123
|
||||
./chess-server db user add -path chess.db -username alice -email alice@example.com -password SecurePass123
|
||||
|
||||
# Interactive password prompt
|
||||
./chessd db user add -path chess.db -username bob -interactive
|
||||
./chess-server db user add -path chess.db -username bob -interactive
|
||||
|
||||
# Import with existing hash
|
||||
./chessd db user add -path chess.db -username charlie -hash '$argon2id$...'
|
||||
./chess-server db user add -path chess.db -username charlie -hash '$argon2id$...'
|
||||
```
|
||||
|
||||
### Managing Users
|
||||
```bash
|
||||
# List all users
|
||||
./chessd db user list -path chess.db
|
||||
./chess-server db user list -path chess.db
|
||||
|
||||
# Update password
|
||||
./chessd db user set-password -path chess.db -username alice -password NewPass456
|
||||
./chess-server db user set-password -path chess.db -username alice -password NewPass456
|
||||
|
||||
# Update email
|
||||
./chessd db user set-email -path chess.db -username alice -email newemail@example.com
|
||||
./chess-server db user set-email -path chess.db -username alice -email newemail@example.com
|
||||
|
||||
# Delete user
|
||||
./chessd db user delete -path chess.db -username alice
|
||||
./chess-server db user delete -path chess.db -username alice
|
||||
```
|
||||
|
||||
## Web UI
|
||||
@ -104,13 +125,13 @@ The chess server includes an embedded web UI for playing games through a browser
|
||||
### Enabling Web UI
|
||||
```bash
|
||||
# Start with web UI on default port 9090
|
||||
./chessd -serve
|
||||
./chess-server -serve
|
||||
|
||||
# Custom web UI port
|
||||
./chessd -serve -web-port 3000 -web-host 0.0.0.0
|
||||
./chess-server -serve -web-port 3000 -web-host 0.0.0.0
|
||||
|
||||
# Full example with authentication enabled
|
||||
./chessd -dev -serve -web-port 9090 -api-port 8080 -storage-path chess.db
|
||||
./chess-server -dev -serve -web-port 9090 -api-port 8080 -storage-path chess.db
|
||||
```
|
||||
|
||||
### Features
|
||||
@ -130,6 +151,7 @@ Access the UI at `http://localhost:9090` when server is running with `-serve` fl
|
||||
- [API Reference](./doc/api.md) - Endpoint specifications including auth
|
||||
- [Architecture](./doc/architecture.md) - System design with auth layer
|
||||
- [Development](./doc/development.md) - Build, test, and user management
|
||||
- [Client Guide](./doc/client.md) - Interactive debugging client
|
||||
- [Stockfish Integration](./doc/stockfish.md) - Engine communication
|
||||
|
||||
## License
|
||||
|
||||
Reference in New Issue
Block a user