Implements cloud-based file storage for plant photos, documents, and certificates: Storage Layer: - Multi-provider support (AWS S3, Cloudflare R2, MinIO, local filesystem) - S3-compatible provider with presigned URL generation - Local storage provider for development with signed URL verification - Configurable via environment variables Image Processing: - Automatic thumbnail generation (150x150, 300x300, 600x600, 1200x1200) - WebP conversion for optimized file sizes - EXIF data extraction for image metadata - Image optimization with Sharp API Endpoints: - POST /api/upload/image - Upload images with automatic processing - POST /api/upload/document - Upload documents (PDF, DOC, DOCX) - POST /api/upload/presigned - Get presigned URLs for direct uploads - GET/DELETE /api/upload/[fileId] - File management UI Components: - ImageUploader - Drag & drop image upload with preview - PhotoGallery - Grid gallery with lightbox view - DocumentUploader - Document upload with file type icons - ProgressBar - Animated upload progress indicator Database: - FileStore service with in-memory storage (Prisma schema ready for Agent 2) - File metadata tracking with soft delete support - Category-based file organization
54 lines
1.6 KiB
JSON
54 lines
1.6 KiB
JSON
{
|
|
"name": "localgreenchain",
|
|
"version": "1.0.0",
|
|
"private": true,
|
|
"license": "MIT",
|
|
"scripts": {
|
|
"dev": "next dev -p 3001",
|
|
"build": "next build",
|
|
"start": "next start -p 3001",
|
|
"preview": "bun run build && bun run start",
|
|
"lint": "next lint",
|
|
"test": "jest",
|
|
"test:watch": "jest --watch",
|
|
"test:coverage": "jest --coverage",
|
|
"cy:open": "cypress open",
|
|
"cy:run": "cypress run",
|
|
"test:e2e": "start-server-and-test 'bun run preview' http://localhost:3001 cy:open",
|
|
"test:e2e:ci": "start-server-and-test 'bun run preview' http://localhost:3001 cy:run"
|
|
},
|
|
"dependencies": {
|
|
"@aws-sdk/client-s3": "^3.937.0",
|
|
"@aws-sdk/s3-request-presigner": "^3.937.0",
|
|
"@tailwindcss/forms": "^0.4.0",
|
|
"@tailwindcss/typography": "^0.5.1",
|
|
"@tanstack/react-query": "^4.0.10",
|
|
"classnames": "^2.3.1",
|
|
"drupal-jsonapi-params": "^1.2.2",
|
|
"html-react-parser": "^1.2.7",
|
|
"multer": "^2.0.2",
|
|
"next": "^12.2.3",
|
|
"next-drupal": "^1.6.0",
|
|
"nprogress": "^0.2.0",
|
|
"react": "^17.0.2",
|
|
"react-dom": "^17.0.2",
|
|
"react-hook-form": "^7.8.6",
|
|
"sharp": "^0.34.5",
|
|
"socks-proxy-agent": "^8.0.2"
|
|
},
|
|
"devDependencies": {
|
|
"@babel/core": "^7.12.9",
|
|
"@types/jest": "^29.5.0",
|
|
"@types/multer": "^2.0.0",
|
|
"@types/node": "^17.0.21",
|
|
"@types/react": "^17.0.0",
|
|
"@types/sharp": "^0.32.0",
|
|
"autoprefixer": "^10.4.2",
|
|
"eslint-config-next": "^12.0.10",
|
|
"jest": "^29.5.0",
|
|
"postcss": "^8.4.5",
|
|
"tailwindcss": "^3.0.15",
|
|
"ts-jest": "^29.1.0",
|
|
"typescript": "^4.5.5"
|
|
}
|
|
}
|