This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
115 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,126 @@ | ||
# README | ||
# Welcome to Rails Tic-Tac-Toe Project | ||
|
||
This README would normally document whatever steps are necessary to get the | ||
application up and running. | ||
This is the tic tac toe game with multiple modes: play with AI, two-player mode with lots of customization, invincible mode. | ||
|
||
Things you may want to cover: | ||
# Demo | ||
|
||
* Ruby version | ||
You can try it at https://railstictactoe.herokuapp.com | ||
|
||
* System dependencies | ||
## Support for me | ||
Support this project :stuck_out_tongue_winking_eye: :pray: | ||
<p align="center"> | ||
<a href="https://www.paypal.me/tanhongit" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-green.svg" data-origin="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="PayPal buymeacoffee TanHongIT"></a> | ||
</p> | ||
|
||
* Configuration | ||
# 1. Technology | ||
- Ruby on Rails | ||
|
||
* Database creation | ||
# 2. Configuration requirements | ||
We are going to build the web application using: | ||
- Rails 6.0.3.2 | ||
- Ruby 2.7.1 | ||
|
||
* Database initialization | ||
# 3. Modes | ||
|
||
* How to run the test suite | ||
- Play Rank with AI | ||
- Invincible mode | ||
- Two-player mode | ||
|
||
* Services (job queues, cache servers, search engines, etc.) | ||
# 4. Runing | ||
|
||
* Deployment instructions | ||
### 4.1. Clone Repo | ||
|
||
* ... | ||
``` | ||
$ git clone https://github.com/TanHongIT/rails-tic-tac-toe-project | ||
$ cd rails-tic-tac-toe-project | ||
``` | ||
|
||
### 4.2. Bundle Install | ||
|
||
``` | ||
$ bundle install | ||
``` | ||
|
||
### 4.3. Yarn Install | ||
|
||
``` | ||
$ yarn install | ||
``` | ||
|
||
### 4.4. Create database with Postgresql | ||
|
||
You must change the appropriate database configuration | ||
|
||
Change configuration at _"**config/database.yml**"_ with Postgresql. | ||
|
||
```ruby | ||
default: &default | ||
adapter: postgresql | ||
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | ||
timeout: 5000 | ||
username: railstictactoe | ||
password: 1234 | ||
host: localhost | ||
# tutorial for ubuntu linux: | ||
# sudo -u postgres psql | ||
# create user "railstictactoe" with password '1234'; | ||
# create database "railstictactoe" owner "railstictactoe"; | ||
development: | ||
<<: *default | ||
database: railstictactoe | ||
# Warning: The database defined as "test" will be erased and | ||
# re-generated from your development database when you run "rake". | ||
# Do not set this db to the same as development or production. | ||
test: | ||
<<: *default | ||
database: railstictactoe_test | ||
production: | ||
<<: *default | ||
database: railstictactoe_production | ||
``` | ||
You must change the username, password and database name accordingly! | ||
### 4.5. run rails db:migrate | ||
``` | ||
$ rails db:migrate | ||
``` | ||
### 4.6. Run server | ||
``` | ||
$ rails s | ||
``` | ||
Now go to http://localhost:3000 | ||
# 5. Images demo | ||
#### HomePage. | ||
![Image](https://imgur.com/c64pSd3.png) | ||
#### Play Rank With AI. | ||
![Image](https://imgur.com/jCTKgTs.png) | ||
#### High Score Rank Screen. | ||
![Image](https://imgur.com/YUhkISQ.png) | ||
#### Two-player Mode. | ||
![Image](https://imgur.com/QZP0LJg.png) | ||
#### Two-player Mode customization. | ||
![Image](https://imgur.com/Vc4VkWD.png) | ||
#### Invincible mode. | ||
![Image](https://imgur.com/g7iaUkU.png) |