Skip to content

Commit 86b74d8

Browse files
committed
Update env-example and README
1 parent 2365c3c commit 86b74d8

File tree

2 files changed

+40
-24
lines changed

2 files changed

+40
-24
lines changed

.env-example

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
API_KEY=xxxxxxx
2-
PORT=3000
3-
API_URL=http://localhost:3000
4-
INSTANCE_DOMAIN=api.topia.io
5-
INSTANCE_PROTOCOL=https
6-
INTERACTIVE_KEY=xxxxxxx
7-
INTERACTIVE_SECRET=xxxxxxx
81
NODE_ENV="development"
9-
10-
# Google Sheets
11-
GOOGLESHEETS_CLIENT_EMAIL=
12-
GOOGLESHEETS_SHEET_ID=
13-
GOOGLESHEETS_PRIVATE_KEY=
2+
INSTANCE_DOMAIN=api.topia.io
3+
INTERACTIVE_KEY=your_interactive_key
4+
INTERACTIVE_SECRET=your_interactive_secret
5+
REDIS_URL=redis://localhost:6379
6+
GOOGLESHEETS_CLIENT_EMAIL=your_google_service_account_email
7+
GOOGLESHEETS_SHEET_ID=your_google_sheet_id
8+
GOOGLESHEETS_PRIVATE_KEY=your_google_private_key
9+
TRACKS=[{"id":1,"name":"Track 1","thumbnail":"https://example.com/thumb.png","sceneId":"your_scene_id"}]

README.md

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,26 +74,46 @@ On the admin page, click the "Reset Race Stats" button to remove all previously
7474

7575
The following assets must exist in the world with specific unique names:
7676

77-
| Unique Name | Description |
78-
|-------------|-------------|
79-
| `race-track-container` | A rectangle asset that surrounds the entire race track area. Used to determine placement position when switching tracks. |
77+
| Unique Name | Description |
78+
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
79+
| `race-track-container` | A rectangle asset that surrounds the entire race track area. Used to determine placement position when switching tracks. |
8080
| `race-track-checkpoint` | Checkpoint assets placed along the track. Multiple checkpoints should use partial matching (e.g., `race-track-checkpoint-1`, `race-track-checkpoint-2`). |
81-
| `race-track-start` | The starting line asset where players begin the race. |
81+
| `race-track-start` | The starting line asset where players begin the race. |
8282

83-
### Additional Environment Variables
83+
### Environment Variables
8484

85-
In addition to the standard environment variables, this app supports Google Sheets integration for leaderboards:
85+
Create a `.env` file in the root directory. See `.env-example` for a template.
8686

87-
| Variable | Description |
88-
|----------|-------------|
89-
| `GOOGLESHEETS_CLIENT_EMAIL` | Google service account email for Sheets API access |
90-
| `GOOGLESHEETS_SHEET_ID` | The ID of the Google Spreadsheet for storing leaderboard data |
91-
| `GOOGLESHEETS_PRIVATE_KEY` | Service account private key for authentication |
87+
| Variable | Description | Required |
88+
| --------------------------- | ------------------------------------------------------------------------------------------------------------ | -------- |
89+
| `NODE_ENV` | Node environment (`development` or `production`) | No |
90+
| `INSTANCE_DOMAIN` | Topia API domain (`api.topia.io` for production, `api-stage.topia.io` for staging) | Yes |
91+
| `INTERACTIVE_KEY` | Topia interactive app key | Yes |
92+
| `INTERACTIVE_SECRET` | Topia interactive app secret | Yes |
93+
| `REDIS_URL` | Redis connection URL for caching race state (e.g., `redis://localhost:6379`) | Yes |
94+
| `TRACKS` | JSON array of track configurations. Each track requires `id`, `name`, `thumbnail`, and `sceneId`. See below. | Yes |
95+
| `GOOGLESHEETS_CLIENT_EMAIL` | Google service account email for analytics | No |
96+
| `GOOGLESHEETS_SHEET_ID` | Google Sheet ID for analytics | No |
97+
| `GOOGLESHEETS_PRIVATE_KEY` | Google service account private key | No |
9298

9399
### Track Configuration
94100

95-
Tracks are configured in `server/constants.js`. Each track requires:
101+
Tracks are configured via the `TRACKS` environment variable as a JSON array. Each track requires:
102+
96103
- `id`: Unique track identifier
97104
- `name`: Display name for the track
98105
- `thumbnail`: URL to track preview image
99106
- `sceneId`: The Topia scene ID containing the track assets
107+
108+
Example:
109+
110+
```json
111+
[
112+
{
113+
"id": 1,
114+
"name": "Beach",
115+
"thumbnail": "https://example.com/thumbnails/beach.png",
116+
"sceneId": "your_scene_id"
117+
}
118+
]
119+
```

0 commit comments

Comments
 (0)