- Move into the
app
folder - TODO: write this
- Develop the app or something
npx expo start
- Press
w
- It should open in browser
- Move into
sync
folder - Install the Rust installation manager
rustup
- Enable Rust nightly with
rustup default nightly
- Install the sqlx CLI using
cargo install sqlx-cli
- this will take some time - Copy
.env.example
to.env
- Update using values from an IdP of your choice
- Setup the SQLite database with
sqlx database setup
- Serve using
cargo run -- serve
The project is optimized for faster compiletime in dev, and faster runtime at
release. Release builds made with --release
will compile slower due to theese
runtime performance optimizations. Yes we know the compile times are slow in
dev too, there is little we can do.
An OpenAPI Swagger UI is available at /swagger
with the OpenAPI spec at
/openapi.json
. These are generated using the utoipa
family of crates,
specifically utoipa
, utoipa-axum
and utoipa-swagger-ui
. These do not make
a perfect specification, but it's a good overview of the endpoints. For further
information about the endpoints you can look into the code.
Tests can be run with cargo test
. Unit tests test specific small pieces of
code, and should live next to the source-code. These tests work well for
utilities. Integration tests are in the tests
folder, and test it as if it is
an HTTP API. We use an assertion library called googletest
. It is well
documented, including in the Advanced Rust Testing book. Avoid using assert!
or assert_eq!
. By using the sqlx::test
macro we get passed a mock database
into the test function. This database is reset, but applied with the data from
fixtures. Avoid using #[test]
, instead use #[gtest]
. If using the
sqlx::test
macro, put a #[gtest]
after it.