2 unstable releases
0.7.0 | May 21, 2022 |
---|---|
0.6.2 | May 5, 2022 |
0.0.9 |
|
0.0.8 |
|
0.0.7 |
|
#422 in Database interfaces
24 downloads per month
Used in deepwell-rpc
1MB
24K
SLoC
DEEPWELL
DEEPWELL is an experimental backend system to provide core wiki operations via an API for Wikijump. This is intended as an internal API consumed by the web server as part of its logical tasks.
The lint #![forbid(unsafe_code)]
is set, and therefore this crate has only safe code.
Available under the terms of the GNU Affero General Public License. See LICENSE.md.
Development
If you have sea-orm-cli
, and have a local instance of Wikijump running, you can use the following script to autogenerate SeaORM model files:
$ scripts/generate-models.sh
Structure
The primary organization of the crate is as follows:
api/
— Web server definition, such as its routes and related structures.- Each API is namespaced based on its version. The primary version of interest is the "internal" API, which is consumed by PHP and not meant for outside consumption due to it providing unguarded access.
methods/
— Implementations for individual routes provision above.services/
— "Services", or logical encapsulations of different concepts or operations.- For instance, the
ParentService
allows retrieving and storing data related to parent-child page relationships. You can think of it as "wrapping" thepage_parent
table. - Similarly, the
PageService
encapsulates thepage
table, but also wraps all the other operations contained with the logical concept of the "page", such as creating new revisions using theRevisionService
as part of the "edit" method.
- For instance, the
locales/
— Provides localization methods, interpreting the Fluent translation files.models/
— Primarily auto-generated by Sea-ORM, these files allow for interfacing with the database.- Other files are utilities, and are generally understandable by looking at their contents..
The routes are defined in api/
, with their implementations in methods/
, and the structures they rely on in services/<name>/structs.rs
. The services invoked to encapsulate logical operations are at services/<name>.rs
or services/<name>/service.rs
.
Compilation
This executable targets the latest stable Rust. At time of writing, that is 1.61.0
.
$ cargo build --release
Testing
Tests have not yet been implemented, but when they are, run:
$ cargo test
Add -- --nocapture
to the end if you want to see test output.
Development
$ cargo fmt # Ensure code is formatted
$ cargo clippy # Check code for lints
Dependencies
~33–47MB
~1M SLoC