diff --git a/README.md b/README.md index d299d778..2c52de9c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ -Multiplayer turn based game in the spirit of For the King, Diablo and Final Fantasy. +# Roguelike Racing + +A multiplayer turn based game in the spirit of For the King, Diablo and Final Fantasy. UI written with the Yew frontend framework, backend uses websockets via Actix. To compile tailwind: -From the client directory run npx tailwindcss -i ./input.css -o ./style/output.css --watch +From the client directory run `npx tailwindcss -i ./input.css -o ./style/output.css --watch` To run the server: -From the server directory run cargo-watch -x run +From the server directory run `cargo-watch -x run` To run the frontend: -From the client directory run trunk serve +From the client directory run `TRUNK_PROD=false trunk serve` diff --git a/client/cypress/e2e/first-user.cy.ts b/client/cypress/e2e/first-user.cy.ts index 058bc06d..3a5071a7 100644 --- a/client/cypress/e2e/first-user.cy.ts +++ b/client/cypress/e2e/first-user.cy.ts @@ -12,12 +12,12 @@ describe("a test test", () => { cy.findByRole("button", { name: "Create Character" }).focus(); cy.findByRole("button", { name: "Create Character" }).click(); - // cy.findByPlaceholderText("Character name...") - // .click() - // .clear() - // .type("R. Chambers", { delay: 0 }); - // cy.findByRole("button", { name: "Create Character" }).focus(); - // cy.findByRole("button", { name: "Create Character" }).click(); + cy.findByPlaceholderText("Character name...") + .click() + .clear() + .type("R. Chambers", { delay: 0 }); + cy.findByRole("button", { name: "Create Character" }).focus(); + cy.findByRole("button", { name: "Create Character" }).click(); cy.task("checkpoint", "game created"); cy.task("waitForCheckpoint", "second player character created"); @@ -25,9 +25,14 @@ describe("a test test", () => { cy.findByRole("button", { name: "Ready" }).click(); // cy.findByText("Open Inventory").click(); cy.findByText("Ready to explore").click(); - cy.findByText("Attack").click(); - cy.findByText("Execute").click(); - cy.task("checkpoint", "first attack executed"); + // cy.findByText("Attack").click(); + // cy.findByText("Execute").click(); + + // cy.wait(2000); + + // cy.findByText("Attack").click(); + // cy.findByText("Execute").click(); + // cy.task("checkpoint", "first attack executed"); // cy.findAllByText("Take").first().click({ force: true }); // cy.findAllByText("Take").first().click({ force: true }); diff --git a/client/cypress/e2e/second-user.cy.ts b/client/cypress/e2e/second-user.cy.ts index 91ecdb05..ba042f95 100644 --- a/client/cypress/e2e/second-user.cy.ts +++ b/client/cypress/e2e/second-user.cy.ts @@ -15,10 +15,10 @@ describe("a test test", () => { cy.findByRole("button", { name: "Ready" }).click(); cy.findByText("Ready to explore").click(); - cy.task("waitForCheckpoint", "first attack executed"); + // cy.task("waitForCheckpoint", "first attack executed"); - cy.findByText("Attack").click(); - cy.findByText("Execute").click(); + // cy.findByText("Attack").click(); + // cy.findByText("Execute").click(); // cy.findAllByText("Take").first().click({ force: true }); // cy.findAllByText("Take").first().click({ force: true }); diff --git a/client/deployment-notes.md b/client/deployment-notes.md new file mode 100644 index 00000000..19ffdf86 --- /dev/null +++ b/client/deployment-notes.md @@ -0,0 +1,22 @@ +# both + +- check the dockerfile to see how dummy directories are used to cache dependencies before + actually building + +# client + +- set env variables in trunk like TRUNK_PROD=true trunk build --release +- access env variables in Yew like : + let in_production = std::env!("TRUNK_PROD"); +- websocket address should be in the format wss://domainname.com/ws + +# server + +- actix address must be changed to 0.0.0.0:port in order to serve from inside + a docker container +- nginx should be configured like shown in the config file in same directory +- in order to ensure the docker container exits on panic set + RUST_BACKTRACE=1 env to in server dockerfile and make sure the s + erver Cargo.toml sets the behavior of : + [profile.release] + panic = 'abort' diff --git a/client/dist/index.html b/client/dist/index.html index 8c2c4d6c..52c38a7f 100644 --- a/client/dist/index.html +++ b/client/dist/index.html @@ -1,15 +1,15 @@ Roguelike Racing - + - - + + -