This is a simple backend written in Rust for the Frontend Software Engineer Interview. It is a simple REST API that allows you to send Image processing request. It uses a InMemory database to store data & images.
docker build --target production -t backend .
docker run -p 8080:80 backend
Requirements:
- Rust 1.74.0
cargo run --release --bin backend -- --port 8080
/job
(POST): Create a new image processing request -> Returns a job id [UUID v4]- Multipart fields
image
: Image file (png, jpeg, tiff)filter
: Filter to apply on the image (Blurring, UnSharpening)sigma
: Sigma value for the filter
/job
(GET): Retrieves info about jobs/job/:id
(GET): Retrieves info about a single job/job/result/:id
(GET): Retrieves result image of a job
curl http://0.0.0.0:8080/job -F 'image=@/path/to/your/image' -F filter=Blurring -F sigma=5
curl http://0.0.0.0:8080/job
curl http://0.0.0.0:8080/job/{job_id}
curl http://0.0.0.0:8080/job/result/{job_id}