Skip to content

Commit fdbb763

Browse files
authored
Merge pull request #38 from metaversecloud-com/dev
Update documentation and env-example
2 parents f304f89 + 86b74d8 commit fdbb763

File tree

2 files changed

+72
-12
lines changed

2 files changed

+72
-12
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: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
Race App is an exciting racing game built with Node.js and React. Players compete to complete a virtual race course in the fastest time possible by navigating through a series of waypoints. The app features a leaderboard that displays the top 20 fastest race times, allowing players to compare their performance with others.
44

5+
## Built With
6+
7+
### Client
8+
9+
![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)
10+
![Vite](https://img.shields.io/badge/vite-%23646CFF.svg?style=for-the-badge&logo=vite&logoColor=white)
11+
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
12+
![Tailwind CSS](https://img.shields.io/badge/tailwindcss-%2338B2AC.svg?style=for-the-badge&logo=tailwind-css&logoColor=white)
13+
14+
### Server
15+
16+
![Node.js](https://img.shields.io/badge/node.js-%2343853D.svg?style=for-the-badge&logo=node.js&logoColor=white)
17+
![Express](https://img.shields.io/badge/express-%23000000.svg?style=for-the-badge&logo=express&logoColor=white)
18+
519
## Features
620

721
- Interactive race course with a visual racetrack loop and multiple waypoints
@@ -53,3 +67,53 @@ To reset the race stats to a default unplayed state:
5367

5468
Click the "Admin" button in the drawer.
5569
On the admin page, click the "Reset Race Stats" button to remove all previously attained race times.
70+
71+
## Implementation Requirements
72+
73+
### Required Assets with Unique Names
74+
75+
The following assets must exist in the world with specific unique names:
76+
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. |
80+
| `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. |
82+
83+
### Environment Variables
84+
85+
Create a `.env` file in the root directory. See `.env-example` for a template.
86+
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 |
98+
99+
### Track Configuration
100+
101+
Tracks are configured via the `TRACKS` environment variable as a JSON array. Each track requires:
102+
103+
- `id`: Unique track identifier
104+
- `name`: Display name for the track
105+
- `thumbnail`: URL to track preview image
106+
- `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)