Skip to content

Developing a Image Poll Feature #6

@JenilSavalia

Description

@JenilSavalia

Implement CDN for Image Uploads to Support Image Polls

Image

Description

To enhance the functionality of the poll creation feature, we need to implement a Content Delivery Network (CDN) for uploading and hosting images. This will allow users to create image-based polls by uploading images seamlessly. The preferred solution is AWS S3, but Cloudinary can also be considered as an alternative.


Objective

  • Allow users to upload images when creating polls.
  • Store and serve images efficiently using a CDN.
  • Ensure the solution is scalable, cost-effective, and secure.

Requirements

Functional Requirements

  1. Image Upload:

    • Users should be able to upload images from their local device or provide a URL.
    • Supported image formats: JPEG, PNG, GIF, SVG.
    • Maximum file size: 5MB.
  2. Image Storage:

    • Images should be stored in a scalable and reliable storage service (AWS S3 preferred).
    • Images should be served via a CDN for fast delivery.
  3. Image Poll Creation:

    • Users should be able to attach uploaded images to poll options.
    • Display images in the poll interface.
  4. Security:

    • Implement proper access controls to prevent unauthorized access to images.
    • Validate image files to prevent malicious uploads.
  5. Cost Optimization:

    • Use efficient storage and CDN solutions to minimize costs.

Non-Functional Requirements

  1. Performance:

    • Image uploads should be fast and reliable.
    • Images should load quickly in the poll interface.
  2. Scalability:

    • The solution should handle a large number of image uploads and requests.
  3. Error Handling:

    • Provide clear error messages for failed uploads (e.g., file size exceeded, unsupported format).

Preferred Solutions

AWS S3

  • Use Amazon S3 for storing images.
  • Use Amazon CloudFront as the CDN for serving images.
  • Implement pre-signed URLs for secure uploads directly to S3.

Cloudinary

  • Use Cloudinary for image storage, transformation, and delivery.
  • Leverage Cloudinary's SDK for easy integration.

Tasks

  1. Research and compare AWS S3 and Cloudinary for image storage and CDN.
  2. Set up an AWS S3 bucket or Cloudinary account.
  3. Implement backend API for generating pre-signed URLs (for AWS S3) or handling uploads (for Cloudinary).
  4. Create a frontend component for image upload and preview.
  5. Integrate the image upload feature into the poll creation flow.
  6. Write unit and integration tests for the new feature.
  7. Document the implementation and usage.

Acceptance Criteria

  • Users can upload images and attach them to poll options.
  • Images are stored securely and served via a CDN.
  • The feature works seamlessly on both desktop and mobile devices.
  • Proper error handling and user feedback are implemented.
  • Documentation is updated to include the new feature.

Additional Context

  • This feature is part of the Image Polls initiative to enhance user engagement.
  • The implementation should align with the existing architecture and coding standards.

Assignees

  • Anyone from G2 or G3 groups.

Attachments


Labels

  • enhancement
  • feature
  • backend
  • frontend
  • AWS (or Cloudinary)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions