https://github.com/mediacomem/comem-wopr
Play tic-tac-toe against the WOPR
https://github.com/mediacomem/comem-wopr
ruby sinatra svelte tic-tac-toe wopr
Last synced: 8 months ago
JSON representation
Play tic-tac-toe against the WOPR
- Host: GitHub
- URL: https://github.com/mediacomem/comem-wopr
- Owner: MediaComem
- License: mit
- Created: 2020-01-09T17:20:54.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-11-10T16:37:12.000Z (over 1 year ago)
- Last Synced: 2025-04-04T18:38:29.251Z (about 1 year ago)
- Topics: ruby, sinatra, svelte, tic-tac-toe, wopr
- Language: Ruby
- Homepage: https://comem-wopr.herokuapp.com
- Size: 389 KB
- Stars: 0
- Watchers: 2
- Forks: 42
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# WOPR
Play tic-tac-toe against the WOPR.
[](https://github.com/MediaComem/comem-wopr/actions/workflows/build.yml)
[](https://github.com/MediaComem/comem-wopr/actions/workflows/publish.yml)
[](https://opensource.org/licenses/MIT)
- [Installation](#installation)
- [Requirements](#requirements)
- [Initial setup](#initial-setup)
- [Usage](#usage)
- [Run in development mode](#run-in-development-mode)
- [Run in production mode](#run-in-production-mode)
- [Updating](#updating)
- [Configuration](#configuration)
## Installation
### Requirements
* [Ruby](https://www.ruby-lang.org) 3.x
* [Node.js](https://nodejs.org) 22.x
* [Redis](https://redis.io) 4+
### Initial setup
```bash
# Clone the repository
git clone https://github.com/MediaComem/comem-wopr.git
cd comem-wopr
# Configure Bundler.
bundle config set path 'vendor/bundle'
# Install dependencies (Ruby gems & npm packages).
bundle install
npm ci
# Build the web assets.
npm run build
```
## Usage
### Run in development mode
```
cd /path/to/application
bundle exec ruby app.rb
```
### Run in production mode
Set the `$WOPR_ENV` environment variable to run the application in production
mode:
```
cd /path/to/application
WOPR_ENV=production bundle exec ruby app.rb
```
You should point your Apache or nginx web server to the application's `public`
directory, which contains its static files.
## Updating
Your deployment workflow should install new dependencies and re-build the web
assets every time the frontend's source code is updated:
```bash
cd /path/to/application
bundle install
npm install
npm run build
```
## Configuration
The following environment variables can be set to customize the application's behavior:
Variable | Default value | Description
:------------------------------ | :------------------------- | :-------------------------------------------
`WOPR_ENV` | `development` | Set to `production` for deployment.
`WOPR_PORT` or `PORT` | 4567 | Port on which to listen to.
`WOPR_REDIS_PREFIX` | `wopr:` | Prefix prepended to all Redis database keys.
`WOPR_REDIS_URL` or `REDIS_URL` | `redis://localhost:6379/0` | Redis connection URL.