Simple ToDo list based on last date I did.
This app's purpose is to remind me of forgotten daily tasks like cleaning in specific places (window, shoe case, bed cover, ...).
First, we have to install sqlite3
.
git clone https://github.com/yammmt/last-date.git
cd last-date
cargo run
You can access your site by accessing http://localhost:8000
.
If you want to run this in production environment, for example, run following commands.
export ROCKET_SECRET_KEY=<your secret key>
cargo run --release
You can access your site by accessing http://<your machine address>:8000
.
Note that you can generate secret key with openssl rand -base64 32
.
To use Diesel from command line, diesel-cli is needed.
cargo install diesel_cli --no-default-features --features sqlite
export DATABASE_URL=db/mydb.sqlite # if needed
To use database file different from one defined in Rocket.toml
, set environment variable.
export ROCKET_DATABASES='{sqlite_database={url="db/mydb.sqlite"}}'
Note that this setting is common between cargo run
and cargo test
.
This repository uses the CSS framework Bulma and Sass. The procedure to generate css files is the following:
- Clone submodule repository by
git submodule update --init --recursive
. - Move to
static
directory. - Update
static/mystyles.scss
file. - Generate
static/css/mystyles.css
file bysass --no-source-map mystyles.scss:css/mystyles.css --style compressed
.
Use clippy for code lint.
cargo clippy
If you want to work with DB directly, you can use SQLite3 (sqlite3 db/dev.sqlite
).
sqlite> INSERT INTO tasks(name,description,updated_at) VALUES ("Eat sushi","Essential to my life!","2020-04-20");
sqlite> SELECT * FROM tasks;
110|Eat sushi|Essential to my life!|2020-04-20
- Rocket todo example
- This app is based on this example 🙇
- CSS framework Bulma