A Rust-based image processing service that provides upload, transformation, and management capabilities for images.
- User registration and login
- JWT-based authentication
- Token-protected endpoints
- Upload images in various formats
- List uploaded images with metadata
- Retrieve images by ID
- Cloud storage for images
- Resize
- Crop
- Rotate
- Watermark
- Color filters (grayscale, sepia)
- Compression
- Format conversion (JPEG, PNG, etc.)
- Language: Rust
- Framework: Actix-web
- Database: SQLite
- Image Processing: image-rs
- Authentication: JWT
- Storage: Local file system (upgradable to S3/R2)
- Rust 1.70 or higher
- Cargo
# Clone repository
git clone <repository-url>
cd image-processing-service
# Run server
cargo run
# Or for development mode with auto-reload
cargo watch -x runServer runs on http://localhost:8080.
POST /register
Content-Type: application/json
{
"username": "username",
"password": "password"
}POST /login
Content-Type: application/json
{
"username": "username",
"password": "password"
}POST /images
Authorization: Bearer <jwt-token>
Content-Type: multipart/form-dataGET /images?page=1&limit=10
Authorization: Bearer <jwt-token>GET /images/{id}
Authorization: Bearer <jwt-token>POST /images/{id}/transform
Authorization: Bearer <jwt-token>
Content-Type: application/json
{
"transformations": {
"resize": {
"width": 800,
"height": 600
},
"crop": {
"width": 400,
"height": 300,
"x": 100,
"y": 100
},
"rotate": 90,
"format": "jpeg",
"filters": {
"grayscale": true,
"sepia": false
}
}
}The project uses .env file for configuration:
DATABASE_URL=sqlite:images.db
JWT_SECRET=your-secret-key
SERVER_HOST=127.0.0.1
SERVER_PORT=8080
UPLOAD_DIR=./uploadsTo run tests:
cargo testcargo build --releaseThis is a solution for the Image Processing Service project on roadmap.sh.
Project URL: https://roadmap.sh/projects/image-processing-service