Git Product home page Git Product logo

image-upload-dart's Introduction

Homework #8

Your task is to create a simple image upload API using the Shelf and Dart frameworks. The API should allow users to upload an image file and store it on the file project.

Requirements:

  • Create a new Dart project and set up the necessary dependencies (shelf) in the pubspec.yaml file.
  • Implement a basic server using the Shelf framework.
  • Create an endpoint that accepts POST requests for uploading an image.
  • The API should support uploading images in common formats such as JPEG and PNG.
  • The uploaded image should be saved on the file project.
  • Generate a unique filename for each uploaded image to avoid conflicts.
  • Provide appropriate error handling and response messages for different scenarios (e.g., invalid file format).
  • Add appropriate logging to track the incoming requests and their status.

Optional Enhancements (Bonus):

  • Implement image validation to ensure the uploaded file is indeed an image.
  • Allow users to specify a preferred filename for the uploaded image.
  • Add functionality to resize or manipulate the uploaded image before saving it.
  • Create an endpoint that accepts POST requests for uploading a video.

Deliverables:

  • Submit your Dart project code, including all the necessary files.

Required Dependencies:

  • shelf: Used for building the HTTP server and handling requests.
  • shelf_hot_reload: Enables hot reloading for faster development iterations.
  • dart_code_metrics: Provides code analysis and metrics for improving code quality.

Note:

  • Use shelf_hot_reload to automatically reload the server when you make changes to the code during development, improving development efficiency.
  • Utilize dart_code_metrics to analyze your code and ensure good coding practices, maintainability, and readability.
  • You can use any additional libraries or packages if needed, but be sure to document them properly.
  • Feel free to explore and be creative with the design and implementation of your API.

Deadline:

16/5/2023 10:00 AM

image-upload-dart's People

Contributors

mightynawaf avatar xilujain avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.