|
2 | 2 |
|
3 | 3 | 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. |
4 | 4 |
|
| 5 | +## Built With |
| 6 | + |
| 7 | +### Client |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +### Server |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
5 | 19 | ## Features |
6 | 20 |
|
7 | 21 | - 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: |
53 | 67 |
|
54 | 68 | Click the "Admin" button in the drawer. |
55 | 69 | 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