Factorio Bot Developer Guide

User Guide LUA API Docs MIT License GitHub issues codecov actions Github Repo

Intro

You are welcome to clone the Github repository and extend the ability of the platform. This guide is intended to write down steps needed to develop this application before i forget it myself.

Technologies used

Frontend: Vite.js + PrimeVue

  • Vite.js is a new modern bundler for javascript which is blazing fast and includes many sensible defaults.
  • Vue.js is an incremental frontend framework which is an absolute joy to work with. It has seen very impressive improvements in version 3 including Composition Api, script setup, dynamic css binding and ... .
  • PrimeVue is the a component library for Vue 3. Lots of premade components will make your job as application developer easier and more fun.

Backend: Rust + Tauri

  • Tauri is a new modern technology to turn your web apps into a desktop app for multiple platforms (Windows, MacOS, Linux, android and ios soon). Tauri apps have very small file size and tiny memory consumption.

Setup Development Environment

  • Ready your workspace according to Tauri Getting Started
  • Clone repository git clone git@github.com:arturh85/factorio-bot.git
  • Change directory to app/
  • cd app/
  • yarn or npx yarn

Commands

  • cd app/; npm start starts the application while watching for changes
  • cargo repl starts the repl version of the application which removes most features and builds quicker
  • cargo nextest starts rust test runnner
  • cargo release increments the version numbers, updates changelog and pushes release
  • cd docs/userguide; mdbook serve serves userguide locally

Required tools

  • cargo install tauri-cli

Optional tools

  • cargo install mdbook
  • cargo install mdbook-mermaid
  • cargo install cargo-release
  • cargo install git-cliff
  • cargo install cargo-nextest

Architecture

work in progress

graph TD
    A[Christmas] -->|Get money| B(Go shopping)
    B --> C{Let me think}
    C -->|One| D[Laptop]
    C -->|Two| E[iPhone]
    C -->|Three| F[fa:fa-car Car]
sequenceDiagram
    participant F as Frontend
    participant C as Tauri Core

    F-)+C: IPC request
    note over C: Perform computation, write to file system, etc.
    C-)-F: Response

Howto: Run CI locally

Before pushing any merge requests you might want to locally check the build.

Commands

  • cd app; npm run precommit:check

Howto: Release a new Version

Requirements

  • cargo install cargo-release
  • cargo install git-cliff

Command

  • cargo release <minor|major|patch>

Check the output, if ok rerun with --execute

Useful Links

Mo## Development

Factorio

Lua

Statistics

Rust Internal API