The Camera Reel Service is a simple solution designed specifically for uploading and retrieving camera images taken from Decentraland Explorer. This service enables users to capture and store images with additional metadata, providing valuable context to enhance their visual content.
Before start, make sure you have these installed:
- Rust | you can use this Development setup guide
- docker-compose | used for DB and MinIO (local S3)
- just (optional) | A command runner - use
cargo install just
or follow the Installation guide
Before running the Camera Reel service you need Postgres and MinIO (local S3) instances, you can start both by running:
$ just run-services
or
$ docker-compose -f docker-compose.dev.yml up -d
In order to run the Camera Reel service:
$ cargo run
Also, you can run it in watch mode by installing cargo-watch
and using the command to run the server:
$ cargo install cargo-watch
$ cargo watch -x 'run'
In order to run the tests:
$ cargo test
The RUST_LOG
environment variable can be used to specify the log level, for example:
$ RUST_LOG=debug cargo run
See these docs to understand the possible values.
The utoipa
crate is used to generate the OpenAPI Documentation and a UI.
{server}/api/docs/ui
: Swagger UI with endpoints and schemas{server}/api/docs/openapi.json
: OpenAPI json used by the UI
Some endpoints may be authenticated based on the environment. The authentication method is the Signed Fetch and follows the ADR-44.
Those endpoints are:
- POST
{server}/api/images/
- DELETE
{server}/api/images/{image_id}
- GET
{server}/api/users/{address}
(if non authenticated, it will take into account public images) - GET
{server}/api/users/{address}/images
(if non authenticated, it will only return public images) - PATCH
{server}/api/images/{image_id}/visibility
There is an upload example, you can run it:
$ cargo run --example upload-image
To manage database migrations follow SQLX CLI instructions (link)
Here is a highlevel architecture overview that can help to understand the project strucuture and components: