TODO: A bit of informative Text
- Rust (see rust-lang.org for installation instructions)
- MySQL/MariaDB (on Ubuntu 'mysql-server'/'mariadb-server')
- You'll need a database and a user who can read and write it
- Clone or download this repository
- Copy
SettingsDefault.toml
toSettings.toml
and adjust the values if necessary.- See the wiki for more information.
- Compile:
cargo build
orcargo build --release
(for production) - Start the backend by executing
cargo run [--release]
.- Alternative option: Use a systemd-service (see below).
The server should now run on http://localhost:8000 (you can change this in Settings.toml
).
- Copy the following to
/etc/systemd/system/smartbeans-backend.service
. Replace <username> by the user you want to run the application and <path_to_repo> by the path to this repository.
[Unit]
Description=SmartBeans Backend
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=1
User=<username>
WorkingDirectory=<path_to_repo>
ExecStart=<path_to_repo>/target/release/backend
[Install]
WantedBy=multi-user.target
- Run
sudo systemctl daemon-reload
. - Now you can use
sudo systemctl (start|stop|enable|disable) smartbeans.service
to start/stop the application and enable/disable autostart.
- All relevant data is stored in the database and Settings.toml. It should be sufficient to backup these files. If you want to be extra sure, you can of course save the entire folder.
- To update to a newer version, just pull the changes and recompile (and restart the systemd service, if you use it).
Copyright (c) 2021 Niklas Birth and other contributors
All contents of this repository are provided under the MIT License. See LICENSE for the full text.