Git Product home page Git Product logo

challenge-3dfilestore's Introduction

3D Filestore API

Thanks to 3dverse for this challenge

This is an implementation of a REST API of a 3D file repository application

The API provides endpoints to manage and transform 3D object files

Features for 3D Objects CRUD and Transformation Operations

  • Upload 3D files
  • Rename 3D files
  • Delete 3D files
  • Download original 3D files
  • Download transformed 3D files with dynamic scaling and translation

Getting Started

To get started with the 3D Filestore API follow these steps:

  1. Clone the project repository:
  git clone https://github.com/franklinkemta/challenge-3dfilestore.git
  1. Navigate, Install and Serve
  cd challenge-3dfilestore && npm install
  1. Start the server
  npm run serve

Visit API docs UI: localhost:5000

App Screenshot Original buggy obj vertices before transformation

  # vertices
  v 329.088287 23.088200 739.943176
  v 332.551910 23.978901 738.547974
  v 332.605499 22.584801 738.398682
  # ...

App Screenshot

Transformed buggy obj vertices after scale and translate vector transformation

  { 
    "scale": [2,2,2], 
    "translation": [10,0,0] 
  }
  # transformed vertices
  v 668.176574 46.1764 1479.886352
  v 675.10382 47.957802 1477.095948
  v 675.210998 45.169602 1476.797364
  # ...

App Screenshot

API Reference

The API provides the following endpoints in openapi V3 specification:

  • GET /api/files: List all 3D files
  • PUT /api/files/:fileId: Rename a 3D file
  • DELETE /api/files/:fileId: Delete a 3D file
  • GET /api/files/:fileId: Download the original 3D file or transformed(scaling and translation)

Usage Examples

GET http://localhost:5000/api/files/buggy?scale=[2,2,2]&translation=[10,0,0]

This call will stream the transformed 3D object progressively as a download response applying the given transformation e.g { scale: [2,2,2], translate: [10,0,0] } on the original source file vertices and will not alter the file โš ๏ธ

Constraints

  • Added memory usage monitoring < ~512Mb, see src/server.ts file
  • Supports multiple clients at the same time
  • Can modify the constant FILE_READ_CHUNK_SIZE in src/constants.ts to tweak and see the output memory variation

Running Tests

To run tests, run the following command

  npm run test

Tech Stack

  • Node.js
  • Express.js
  • TypeScript
  • swagger-ui-express (for OpenAPI v3 docs UI)
  • Jest (for testing)

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

challenge-3dfilestore's People

Contributors

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