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
18 changes: 9 additions & 9 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
NODE_ENV="development"
PORT=3001

APP_URL=https://connect4.app/api/
S3_BUCKET=https://mybucket.s3.amazonaws.com/
APP_URL=https://your-app.ngrok-free.app/api/
S3_BUCKET=https://sdk-connect4.s3.amazonaws.com/
TEXT_ASSET_ID=textAsset
WEB_IMAGE_ASSET_ID=webImageAsset
INSTANCE_DOMAIN=api.topia.io
INTERACTIVE_KEY==\***\*\*\*\*\***
INTERACTIVE_SECRET=\***\*\*\*\*\***

GOOGLESHEETS_CLIENT_EMAILxxxxxxx
GOOGLESHEETS_SHEET_IDxxxxxxx
GOOGLESHEETS_PRIVATE_KEY=xxxxxxx
INTERACTIVE_KEY=your_interactive_key
INTERACTIVE_SECRET=your_interactive_secret
GOOGLESHEETS_CLIENT_EMAIL=your_google_service_account_email
GOOGLESHEETS_SHEET_ID=your_google_sheet_id
GOOGLESHEETS_PRIVATE_KEY=your_google_private_key
2 changes: 1 addition & 1 deletion .github/workflows/aws_prod_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
cache: 'npm'
- run: git config --global user.email devops@topia.io
- run: git config --global user.name Devops
- run: npm version --no-git-tag-version ${{ github.event.release.tag_name }}
- run: npm version ${{ github.event.release.tag_name }}
- run: npm i
- run: CI=false npm run build

Expand Down
56 changes: 47 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

Connect 4 is a completely on-canvas game where two players take turns dropping pieces in an attempt to connect 4 in a row.

## Built With

### Server

![Node.js](https://img.shields.io/badge/node.js-%2343853D.svg?style=for-the-badge&logo=node.js&logoColor=white)
![Express](https://img.shields.io/badge/express-%23000000.svg?style=for-the-badge&logo=express&logoColor=white)

## Key Features

### Canvas elements & interactions
Expand All @@ -21,7 +28,45 @@ Connect 4 is a completely on-canvas game where two players take turns dropping p
- Key Asset: the data object attached to the Reset Button key asset can stores all of the game play information including current players, player turn status, and game status.
- World: the data object attached to the world will store the key asset id of each dropped scene indexed by `dropSceneId`. This allows world builders the option of dropping just the key asset and clicking Reset for the first time to build the board OR dropping the entire board as a prebuilt scene removing the need to click Reset to build the board for the first time.

## Developers:
## Implementation Requirements

### Required Assets with Unique Names

The app dynamically generates assets with the following unique names:

| Unique Name | Description |
| -------------- | ------------------------------------------------- |
| `board` | The board background image |
| `gameText` | Game status message |
| `player1Text` | Player 1 name display |
| `player2Text` | Player 2 name display |
| `player1` | Player 1 selection button |
| `player2` | Player 2 selection button |
| `selector` | Column drop arrows (7 total, all share this name) |
| `claimedSpace` | Game pieces placed on board |
| `crown` | Victory crown for winner |

## Environment Variables

Create a `.env` file in the root directory. See `.env-example` for a template.

| Variable | Description | Required |
| --------------------------- | ---------------------------------------------------------------------------------- | -------- |
| `NODE_ENV` | Node environment | No |
| `PORT` | Server port | No |
| `APP_URL` | Public URL for the app API, used for webhook callbacks | Yes |
| `APP_VERSION` | App version identifier | Yes |
| `S3_BUCKET` | S3 bucket URL for game assets | Yes |
| `TEXT_ASSET_ID` | Asset ID template for text assets in Topia | Yes |
| `WEB_IMAGE_ASSET_ID` | Asset ID template for web image assets in Topia | Yes |
| `INSTANCE_DOMAIN` | Topia API domain (`api.topia.io` for production, `api-stage.topia.io` for staging) | Yes |
| `INTERACTIVE_KEY` | Topia interactive app key | Yes |
| `INTERACTIVE_SECRET` | Topia interactive app secret | Yes |
| `GOOGLESHEETS_CLIENT_EMAIL` | Google service account email for analytics | No |
| `GOOGLESHEETS_SHEET_ID` | Google Sheet ID for analytics | No |
| `GOOGLESHEETS_PRIVATE_KEY` | Google service account private key | No |

## Developers

### Getting Started

Expand All @@ -30,14 +75,7 @@ Connect 4 is a completely on-canvas game where two players take turns dropping p

### Add your .env environmental variables

```json
APP_URL
INSTANCE_DOMAIN=api.topia.io
INSTANCE_PROTOCOL=https
INTERACTIVE_KEY=xxxxxxxxxxxxx
INTERACTIVE_SECRET=xxxxxxxxxxxxxx
S3_BUCKET=https://mybucket.s3.amazonaws.com/
```
See [Environment Variables](#environment-variables) above.

### Where to find INTERACTIVE_KEY and INTERACTIVE_SECRET

Expand Down