Illystre/Photo-Editor-
0 forks
A full-stack photo editing application built with React, TypeScript, Spring Boot, and Docker. Features include image upload, real-time editing with canvas manipulation, server-side transform pipelines, async job processing, and secure JWT authentication.
id: 15
7,695 Lines
  • Markdown 42.8%
  • Java 27.4%
  • TypeScript-JSX 11.5%
  • JSON 4.5%
  • TypeScript 3.7%
  • Yaml 2.9%
  • XML 2.5%
  • Python 2.5%
  • SQL 0.9%
  • CSS 0.6%
  • Shell 0.4%
  • JavaScript 0.2%
  • HTML 0.2%
README.md

PhotoEditor - Professional Photo Editing Platform

A full-stack photo editing application built with React, TypeScript, Spring Boot, and Docker. Features include image upload, real-time editing with canvas manipulation, server-side transform pipelines, async job processing, and secure JWT authentication.

๐Ÿš€ Features

Core Functionality

  • โœ… Image Upload & Management - Upload, view, and delete images
  • โœ… Real-time Editing - Browser-based photo editing with Fabric.js
  • โœ… Transform Pipeline - Server-side reproducible image transformations
  • โœ… Undo/Redo - Full editing history with state management
  • โœ… Filters & Adjustments - Grayscale, Sepia, Brightness, Rotation, Flip
  • โœ… JWT Authentication - Secure user authentication and authorization
  • โœ… Thumbnail Generation - Automatic thumbnail creation on upload
  • โœ… Job System - Async background job processing with Redis

Technical Highlights

  • Frontend: React 18 + TypeScript + Vite + Tailwind CSS + Fabric.js
  • Backend: Spring Boot 3.2 + Java 17 + PostgreSQL + MinIO (S3)
  • State Management: Zustand for lightweight, performant state
  • Storage: MinIO for object storage, PostgreSQL for metadata
  • Queue: Redis for job queue and caching
  • Containerization: Full Docker Compose setup for local development
  • API Documentation: OpenAPI/Swagger at /swagger-ui.html

๐Ÿ“‹ Prerequisites

  • Docker and Docker Compose (recommended)
  • Java 17+ (for local backend development)
  • Node.js 20+ (for local frontend development)
  • Maven 3.9+ (for building backend)

๐Ÿƒ Quick Start

  1. Clone the repository
git clone <repository-url>
cd phoEditor
  1. Start all services
docker compose up --build

This will start:

  1. Access the application

Option 2: Local Development

Backend Setup

  1. Start dependencies
# Start PostgreSQL, MinIO, and Redis
docker compose up postgres minio redis -d
  1. Run the backend
cd backend
./mvnw spring-boot:run

Backend will be available at http://localhost:8080

Frontend Setup

  1. Install dependencies
cd frontend
npm install
  1. Start development server
npm run dev

Frontend will be available at http://localhost:5173

๐Ÿ“ Project Structure

phoEditor/
โ”œโ”€โ”€ backend/                    # Spring Boot backend
โ”‚   โ”œโ”€โ”€ src/main/java/
โ”‚   โ”‚   โ””โ”€โ”€ com/photoeditor/
โ”‚   โ”‚       โ”œโ”€โ”€ config/        # Configuration (Security, MinIO, OpenAPI)
โ”‚   โ”‚       โ”œโ”€โ”€ controller/    # REST controllers
โ”‚   โ”‚       โ”œโ”€โ”€ dto/           # Data transfer objects
โ”‚   โ”‚       โ”œโ”€โ”€ entity/        # JPA entities
โ”‚   โ”‚       โ”œโ”€โ”€ enums/         # Enums (JobType, JobStatus)
โ”‚   โ”‚       โ”œโ”€โ”€ exception/     # Exception handlers
โ”‚   โ”‚       โ”œโ”€โ”€ repository/    # JPA repositories
โ”‚   โ”‚       โ”œโ”€โ”€ security/      # JWT & security implementations
โ”‚   โ”‚       โ””โ”€โ”€ service/       # Business logic
โ”‚   โ”œโ”€โ”€ src/main/resources/
โ”‚   โ”‚   โ”œโ”€โ”€ db/migration/      # Flyway migrations
โ”‚   โ”‚   โ””โ”€โ”€ application.yml    # Application configuration
โ”‚   โ””โ”€โ”€ pom.xml
โ”‚
โ”œโ”€โ”€ frontend/                   # React frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/        # Reusable components
โ”‚   โ”‚   โ”œโ”€โ”€ lib/               # API client & utilities
โ”‚   โ”‚   โ”œโ”€โ”€ pages/             # Page components
โ”‚   โ”‚   โ”œโ”€โ”€ store/             # Zustand state management
โ”‚   โ”‚   โ”œโ”€โ”€ App.tsx            # Main app component
โ”‚   โ”‚   โ””โ”€โ”€ main.tsx           # Entry point
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ vite.config.ts
โ”‚
โ””โ”€โ”€ docker-compose.yml          # Docker orchestration

๐Ÿ”ง Configuration

Environment Variables

Backend

DB_HOST=postgres
DB_PORT=5432
DB_NAME=photoeditor
DB_USER=postgres
DB_PASSWORD=postgres
MINIO_ENDPOINT=http://minio:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
REDIS_HOST=redis
JWT_SECRET=your-secret-key-here

Frontend

VITE_API_URL=http://localhost:8080

๐Ÿ“š API Documentation

Once the backend is running, access the interactive API documentation:

Key Endpoints

Authentication

  • POST /api/v1/auth/register - Register new user
  • POST /api/v1/auth/login - Login user

Images

  • POST /api/v1/images - Upload image
  • GET /api/v1/images - Get all user images
  • GET /api/v1/images/{id} - Get image metadata
  • DELETE /api/v1/images/{id} - Delete image
  • POST /api/v1/images/{id}/transform - Apply transform pipeline

Jobs

  • POST /api/v1/jobs - Create background job
  • GET /api/v1/jobs/{id} - Get job status
  • GET /api/v1/jobs - Get all user jobs

๐ŸŽจ Editor Features

Transform Operations

  • Rotate - Rotate image by 90ยฐ increments
  • Flip - Horizontal and vertical flipping
  • Brightness - Adjust image brightness
  • Filters - Grayscale, Sepia, Invert

Canvas Features

  • Pan & Zoom - Navigate large images
  • Undo/Redo - Full editing history
  • Real-time Preview - See changes instantly
  • Export - Download edited images

๐Ÿงช Testing

Backend Tests

cd backend
./mvnw test

Frontend Tests (when configured)

cd frontend
npm test

๐Ÿ”’ Security Features

  • JWT Authentication - Secure token-based auth
  • Password Hashing - BCrypt password encryption
  • CORS Configuration - Controlled cross-origin requests
  • Input Validation - Request validation with Bean Validation
  • Presigned URLs - Secure temporary access to S3 objects
  • Role-based Access - User role management

๐Ÿ“Š Database Schema

Users

  • id (UUID), email, password_hash, roles, enabled, timestamps

Images

  • id (UUID), user_id, storage_path, thumbnail_path, width, height, mime_type, size, checksum, timestamps

Projects

  • id (UUID), user_id, name, project_json, thumbnail_path, timestamps

Jobs

  • id (UUID), user_id, type, status, input_image_id, output_path, parameters, logs, timestamps

๐Ÿšข Deployment

Building for Production

Backend

cd backend
./mvnw clean package -DskipTests
docker build -t photoeditor-backend .

Frontend

cd frontend
npm run build
docker build -t photoeditor-frontend .

Production Considerations

  1. Change JWT Secret - Use a strong, unique secret in production
  2. Database Backups - Configure automated PostgreSQL backups
  3. MinIO/S3 - Use AWS S3 in production for scalability
  4. HTTPS - Enable SSL/TLS for secure communication
  5. Resource Limits - Set appropriate memory/CPU limits
  6. Monitoring - Use Actuator endpoints with Prometheus/Grafana
  7. Logging - Configure centralized logging (ELK stack)

๐Ÿ”ฎ Future Enhancements

Planned Features

  •  ML Background Removal - Python FastAPI service with U-2-Net
  •  Super Resolution - AI-powered image upscaling
  •  Batch Processing - Process multiple images
  •  Collaborative Editing - WebSocket-based real-time collaboration
  •  Image Versioning - Track edit history server-side
  •  Advanced Filters - More professional filters
  •  Layer System - Multiple layers support
  •  Text Overlays - Add and customize text
  •  Export Formats - Support more output formats

๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License.

๐Ÿ™ Acknowledgments

  • Spring Boot - Backend framework
  • React - Frontend library
  • Fabric.js - Canvas manipulation
  • MinIO - S3-compatible object storage
  • Thumbnailator - Image processing library
  • Zustand - State management

๐Ÿ“ž Support

For issues and questions:

  • Open an issue on GitHub
  • Check the API documentation
  • Review the code comments

Built with โค๏ธ using modern web technologies

Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover