onlivfe

Crates.ioonlivfe
lib.rsonlivfe
version0.0.0-alpha.0
sourcesrc
created_at2023-01-11 11:30:41.509057
updated_at2023-01-11 11:30:41.509057
descriptionThe core powering listing social (VR) platforms' peeps
homepage
repositoryhttps://github.com/onlivfe/core
max_upload_size
id756347
size10,047
LJ (ljoonal)

documentation

README

Onlivfe core

Onlivfe core is the a library that provides the models & some of the logic for onlivfe. It's usage is not supported outside of the onlivfe ecosystem, though we won't stop others from using it. Also note that the license is AGPL.

Development

Basic requirements:

  • Git
  • Rust
  • SQLx CLI - (cargo install sqlx-cli --no-default-features --features sqlite)

Building

Start off by cloning the project with git.

git clone https://github.com/onlivfe/core

Then open the project folder in your terminal, & run cargo build. Then get to hacking, & optionally replace the dependency in other projects by overriding dependencies.

Database changes

Generally speaking, you first generate a new migration:

sqlx migrate add NAME_OF_MIGRATION

Then write the SQL changes, and then re-generate the schema by running the migrations:

# Drop DB, recreate it and run all migrations
sqlx database drop && sqlx database create && sqlx migrate run
# Save metadata
cargo sqlx prepare

API considerations

Note that serde by default fails at deserializing the whole response if even a single part is unexpected. Which is why we should generally allow data to just be missing, and use serde_with's VecSkipError and DefaultOnError.

Beyond that, we should try to respect the platforms that we interact with, and generally follow rate limits and/or wishes of said platforms developers, up to a reasonable extent. However, as our application is meant for interoperability, which some platforms may not like, thus we must not bow down to any singular platform too much either.

Commit count: 37

cargo fmt