GSoC Diary: Backend and the Live Preview

Posted by n42k on 18 July 2017 in English (English)

With the front end design of the repository complete, I’ve been working on the backend. So far, most of the pages have been implemented, namely the homepage and the model information and search results pages.

Screenshot of the search results page The search page. Note that there's a single result per page, for testing.

The user page has also begun to be implemented.

Screenshot of the user page The current state of the user page. Notice the presence of my avatar.

It was decided to use the PostgreSQL database, and the Django framework for quickly implementing all these pages. The database schema has also been agreed upon since the last diary entry.

A diagram of the conceptual model for the database The conceptual model that was decided on.

In terms of implementation of this schema into Django models, it was almost a direct conversion, except the tags: we used a HStore field for them, as suggested by pnorman on IRC. The banned_by and banned_date fields were also removed from the user, and a Ban Table was made instead.

Furthermore, since no major issues have come up, I’ve managed to add a commenting feature, so that users can comment on models, and model revisions, to serve as a beginning for editing models. Hopefully this feature will be present at the end of GSoC. I’ve also implemented the live preview, one of the most interesting parts of the project, using THREE.js so that users can see a preview of the model right in the repository, in their browsers, without explicitely downloading a file and opening it themselves. Starting off, it will just support the Wavefront OBJ format.

Screenshot of the model information page The current state of the model information page, showcasing the commenting feature and a model of the Eiffel Tower being displayed in the live preview.

The REST API is also progressing fairly well, most of the endpoints have been implemented, namely the info get and model get endpoints, search by latitude and longitude and the author, category and tag lookups. In the next couple weeks, I will be working on the upload model page, and the administration of the repository.

Copyright note: the Eiffel Tower model was taken from, in OpenCOLLADA format, then converted with Blender to Wavefront OBJ.

Comment from dkiselev on 19 July 2017 at 13:44

Hi, nice to see a progress on that. Can you add upAxis to model properties? Because sometimes it's Y and sometimes it's Z

Hide this comment

Comment from dkiselev on 19 July 2017 at 13:46

And if it will be converted to obj anyway, can you also add the ability to add Obj?

Hide this comment

Comment from n42k on 19 July 2017 at 14:05

Hello dkiselev!

Yes, that's a good point, differentiating between the Y or Z up axes. I'll take it in consideration, maybe by specifying it directly for each model, or establishing a standard for all models.

Note that I converted it from OpenCOLLADA to OBJ externally, in Blender, manually. The model stored in the repository is an OBJ, and all models will be, for now. Other model formats could be added later.

Hide this comment

Leave a comment

Parsed with Markdown

  • Headings

    # Heading
    ## Subheading

  • Unordered list

    * First item
    * Second item

  • Ordered list

    1. First item
    2. Second item

  • Link

  • Image

    ![Alt text](URL)

Login to leave a comment