mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-06 01:15:42 -06:00
chore: setup lib for testing, image handling notes in README
This commit is contained in:
5
Cargo.lock
generated
5
Cargo.lock
generated
@@ -2677,14 +2677,19 @@ version = "0.1.1"
|
||||
name = "pacman-server"
|
||||
version = "0.4.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"axum",
|
||||
"axum-cookie",
|
||||
"bytes 1.10.1",
|
||||
"chrono",
|
||||
"dashmap",
|
||||
"dotenvy",
|
||||
"fast_image_resize",
|
||||
"figment",
|
||||
"http",
|
||||
"hyper",
|
||||
"hyper-util",
|
||||
"image",
|
||||
"jsonwebtoken",
|
||||
"oauth2",
|
||||
|
||||
@@ -14,6 +14,10 @@ categories.workspace = true
|
||||
publish.workspace = true
|
||||
default-run = "pacman-server"
|
||||
|
||||
[lib]
|
||||
name = "pacman_server"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
axum = { version = "0.8", features = ["macros"] }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
@@ -44,3 +48,11 @@ fast_image_resize = { version = "5.3", features = ["image"] }
|
||||
image = { version = "0.25", features = ["png", "jpeg"] }
|
||||
sha2 = "0.10"
|
||||
# validator = { version = "0.16", features = ["derive"] }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
http = "1"
|
||||
hyper = { version = "1", features = ["server", "http1"] }
|
||||
hyper-util = { version = "0.1", features = ["server", "tokio", "http1"] }
|
||||
bytes = "1"
|
||||
anyhow = "1"
|
||||
|
||||
@@ -45,3 +45,19 @@ This crate is a webserver that hosts an OAuth login and leaderboard API for the
|
||||
13. API Rate Limiting (inbound requests, by IP, by User)
|
||||
14. Provider Circuit Breaker
|
||||
15. Merge migration files
|
||||
|
||||
## Notes
|
||||
|
||||
### Image Handling
|
||||
|
||||
Avatar images are stored in S3 as follows:
|
||||
|
||||
- `avatars/{user_public_id}/{avatar_hash}.original.png`
|
||||
- `avatars/{user_public_id}/{avatar_hash}.mini.png`
|
||||
|
||||
- The original image is converted to PNG and resized to a maximum of 512x512 pixels.
|
||||
- Ideally, non-square images are fitted to a square.
|
||||
- The mini image is converted to PNG and resized to a maximum of 16x16, 24x24, or 32x32 pixels. TBD.
|
||||
- All images receive a Content-Type header of `image/png`.
|
||||
|
||||
Image processing is handled immediately asynchronously, allowing a valid presigned URL to be generated immediately.
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
|
||||
pub mod app;
|
||||
pub mod auth;
|
||||
pub mod config;
|
||||
pub mod data;
|
||||
pub mod errors;
|
||||
pub mod formatter;
|
||||
pub mod image;
|
||||
pub mod logging;
|
||||
pub mod routes;
|
||||
pub mod session;
|
||||
|
||||
Reference in New Issue
Block a user