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
5 changes: 3 additions & 2 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ node_modules
dist
dist-ssr
dev-dist
.pnpm-store

# Environment and local settings
*.local
.env

# mkcert certificates
mkcert+1.pem
mkcert+1-key.pem
dev-key.pem
dev.pem
localhost*.pem
localhost*-key.pem

Expand Down
8 changes: 5 additions & 3 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# 🎮 Dojo Game Starter - Frontend Integration Guide

> **Complete React + Dojo integration documentation**
> **Complete React + Dojo integration documentation**
> From zero to onchain game in 5 minutes ⚡

[![Starknet](https://img.shields.io/badge/Starknet-Ready-orange)](https://starknet.io) [![Cairo](https://img.shields.io/badge/Cairo-2.0-blue)](https://cairo-lang.org) [![Dojo](https://img.shields.io/badge/Dojo-ECS-red)](https://dojoengine.org)

## 🚀 Quick Start

> Controller requires the client to run over HTTPS, so make sure you have the `mkcert` package installed on your system

```bash
git clone https://github.com/your-username/dojo-game-starter
cd dojo-game-starter/client
npm install && npm run dev
npm install && npm run mkcert && npm run dev
```

**That's it!** Your onchain game is running locally with wallet integration, optimistic updates, and seamless blockchain connectivity.
Expand Down Expand Up @@ -147,4 +149,4 @@ Each guide builds upon the previous ones, creating a complete learning path from

---

**Ready to build the future of onchain gaming?** Start with the [Overview](./docs/01-overview.md) and begin your journey! 🚀
**Ready to build the future of onchain gaming?** Start with the [Overview](./docs/01-overview.md) and begin your journey! 🚀
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"preview": "vite preview",
"serve": "vite preview",
"format:check": "prettier --check .",
"format": "prettier --write ."
"format": "prettier --write .",
"mkcert": "mkcert -key-file dev-key.pem -cert-file dev.pem localhost"
},
"dependencies": {
"@cartridge/connector": "0.5.9",
Expand Down
12 changes: 6 additions & 6 deletions client/vite.config.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kronosapiens I understand your point about adding the HTTPS certificate configurations to localhost. The problem is that we have a deployment in Vercel, and it would crash if these certificates were allowed. I'm going to merge your PR and configure this VITE file to work dynamically based on the environment

Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import topLevelAwait from "vite-plugin-top-level-await";
import wasm from "vite-plugin-wasm";
//import fs from "fs";
import fs from "fs";

export default defineConfig({
plugins: [react(), wasm(), topLevelAwait()],
server: {
port: 3002,
// https: {
// key: fs.readFileSync("mkcert+1-key.pem"),
// cert: fs.readFileSync("mkcert+1.pem"),
// },
https: {
key: fs.readFileSync("dev-key.pem"),
cert: fs.readFileSync("dev.pem"),
},
},
define: {
global: 'globalThis',
Expand All @@ -24,4 +24,4 @@ export default defineConfig({
optimizeDeps: {
include: ['buffer'],
},
});
});
6 changes: 3 additions & 3 deletions contract/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ achievement = { git = "https://github.com/cartridge-gg/arcade", tag = "v1.2.1" }
[[target.starknet-contract]]
build-external-contracts = [
"dojo::world::world_contract::world",
"achievement::events::index::e_TrophyCreation",
"achievement::events::index::e_TrophyProgression",
"achievement::events::index::e_TrophyCreation",
"achievement::events::index::e_TrophyProgression",
]

[dev-dependencies]
cairo_test = "2.9.2"
dojo_cairo_test = { git = "https://github.com/dojoengine/dojo", tag = "v1.2.1" }

[profile.sepolia]
[profile.sepolia]