A mood tracking / short journaling web app built with Rust and Svelte.
All of the following commands should be run from the backend
directory.
$ cd backend
$ cargo run
$ cargo test
$ cargo fmt
$ cargo clippy
$ cargo build
Run the backend locally which frisby will test against. Or configure env.ts
to point to a different backend.
$ cargo run
Run frisby.
$ cd frisby
$ yarn
$ yarn test
All of the following commands should be run from the frontend
directory.
$ cd frontend
$ yarn
When the frontend is built, it can be served by the backend.
$ yarn build
$ yarn dev
This project uses Diesel and Postgres.
Running this project requires installation and setup of both diesel_cli
and postgresql
, as well as creating a .env
file to store the database url.
There is a setup.sh
script that will install the required dependencies, setup the database, and create required .env
files.
⚠️ WARNING: This will overwrite any existing
.env
files.
$ ./setup.sh
$ sudo apt-get install postgresql postgresql-contrib libpq-dev
$ sudo -u postgres createuser <username>
$ sudo -u postgres createdb <database>
$ sudo -u postgres psql
psql=# ALTER USER <username> WITH PASSWORD <password>;
psql=# GRANT ALL PRIVILEGES ON DATABASE <database> TO <username>;
$ cd backend
$ cargo install diesel_cli --no-default-features --features postgres
$ echo DATABASE_URL=postgres://<username>:<password>@<host>/<database> > .env
$ diesel setup
$ diesel migration run
$ cd backend
$ diesel migration redo --all
GitHub actions will run cargo test ci --verbose
on commit to main
or when creaing a pull request. In order to have a backend test run using GitHub actions, include ci
in the test name.
As an example util::unix_time::ci_unit::positive
could be defined as:
#[cfg(test)]
mod ci_unit {
use super::*;
#[test]
fn positive() {
let unix_time = unix_time();
assert!(unix_time > 0, "unix_time should be positive");
}
}
This project uses Conventional Commits to manage commits.
Use the following format when committing:
$ git commit -m "type(scope): message"
feat
A new feature
fix
A bug fix
docs
Documentation only changes
style
Changes that do not affect the meaning of the code
refactor
A code change that neither fixes a bug nor adds a feature
perf
A code change that improves performance
test
Adding missing tests or correcting existing tests
build
Changes that affect the build system or external dependencies
ci
Changes to our CI configuration files and scripts
chore
Other changes that don't modify src or test files
revert
Reverts a previous commit
The scope is optional and should be a GitHub issue number if applicable.
But how could you live and have no story to tell? — Fyodor Dostoevsky
🖤