Code Monkey home page Code Monkey logo

downloaderapi's Introduction

Challenge Details

The application is a document library intended to give its users a web based solution to store and share their documents with others.

Functional Requirements:

Design and implement the application’s UI / API based on the requirements:

  • available document types for uploading PDF / Excel / Word/ txt / pictures documents
  • display / get a list of available documents name of the document icon based on its type a preview image of its content 1st page content date and time of upload number of downloads
  • download / upload a document
  • download / upload several documents
  • a document can be shared with other users via a generated link which is publicly available for the specified time period (e.g.: 1 hour, 1 day, etc.)

How to run

Run

Debug

  • Install .NET8
  • Go to ./backend/DocumentStore
  • Run docker compose --profile infra up to spin up dependancies
  • Run dotnet run --project DocumentStore.csproj

Design choices

  • The application uses a lighter version of Clean Architecture and incorporates some elements of Domain-Driven Design (DDD).
  • I decided not to employ complex abstraction and indirection, keeping the application only three layers deep.
  • I split the project by layers to make it easier to review, as it is a more conventional approach.
  • The project can be easily regrouped by feature if necessary.
  • I simplified the implementation by removing authentication, preview generation, retries, and other features to reduce the task's scope.

Ideas

  • Add proper Ci/CD pieplines
  • Move zipping/preview generation to an external asynchronous process
  • Add paging
  • Add Circuit Breaker and retry policies using something like Polly
  • Introduce metrics collection
  • Move configs to a config store, like AWS Secrets Manager, or a ConfigMap
  • Add proper resource access authentication
  • If it's a multiregional service, consider using a CDN, depending on how the service will be used
  • If the API is primarily for service-to-service usage, it makes sense to directly share files from S3 without re-streaming
  • Add checksum verification
  • Add e2e and integration tests
  • Introduce some DDD concepts like value objects.

Shortcuts and assumptions

I made several assumptions to reduce the scope of this task, as implementing a production-level service like this is very time consuming.

  1. We do not want any paging.
  2. Files are expected to be small, fitting within default limits, and will not require streaming.
  3. There is no versioning or replacing of files; each upload is treated as a separate document.
  4. Test code coverage is not a metric for the submission assessment; existing tests should be sufficient to provide an idea of my testing approach.
  5. It is acceptable to remove rudimentary logging to make the code easier to review.
  6. I used dummy previews instead of actual generation, which can be done with something like this: https://docs.groupdocs.com/viewer/net/licensing-and-evaluation/
  7. It is fine to make small shortcuts, such as simpler error handling.
  8. No frontend.

downloaderapi's People

Contributors

kapitan123 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.