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
- Upload 3D files
- Rename 3D files
- Delete 3D files
- Download original 3D files
- Download transformed 3D files with dynamic scaling and translation
To get started with the 3D Filestore API follow these steps:
- Clone the project repository:
git clone https://github.com/franklinkemta/challenge-3dfilestore.git
- Navigate, Install and Serve
cd challenge-3dfilestore && npm install
- Start the server
npm run serve
Visit API docs UI: localhost:5000
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
# ...
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
# ...
The API provides the following endpoints in openapi V3 specification:
GET /api/files
: List all 3D filesPUT /api/files/:fileId
: Rename a 3D fileDELETE /api/files/:fileId
: Delete a 3D fileGET /api/files/:fileId
: Download the original 3D file or transformed(scaling and translation)
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
- 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
To run tests, run the following command
npm run test
- Node.js
- Express.js
- TypeScript
- swagger-ui-express (for OpenAPI v3 docs UI)
- Jest (for testing)
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.