Based on another similiar, famous game we decided to create a small Webapp for fun.
├── backend | Backend based on Warp (Rust)
│ ├── Cargo.lock
│ ├── Cargo.toml
│ └── src
├── frontend | Frontend based on Svelte and Tailwind (TS, HTML, JS)
| ├── public
│ ├── src
│ ├── package.json
│ ├── postcss.config.js
│ ├── tailwind.config.js
│ ├── webpack.config.js
│ └── package-lock.json
├── docker-entrypoint.sh
├── Dockerfile
├── Makefile
└── README.md
Run the following commands only the first time or if new dependencies were added:
cd frontend
npm install
npm run build
cargo install cargo-watch
After that, start development with two terminals and the following commands:
make watch-fe
and make watch-be
This will start watch modes for the server and frontend and will automatically update the code and restart the server. The update process is visible in the terminal output.
Run the backend tests with the following command and also update the coverage report:
make test-be
(Note, that this command requires Tarpaulin; alternatively simply use cargo test
)
Run the following command to create the Docker image with the full app:
make build
Run the following command to start the image created previously. This will start the server and the application should be available on localhost:3333. Use the environment variables to change the host or other settings.
make run
Frontend: Node 14, preferred installation with NVM
Backend: Rust, Cargo Watch, Tarpaulin, Criterion
General: Docker Desktop
We recommend to use VSCode for Frontend and Backend with the following extensions enabled:
- rust-analyzer
- crates
- Better TOML / TOML Language Support
- npm
- Tailwind CSS IntelliSense
- ESLint
- Svelte for VSCode