D
D
Denis Shestoperov2020-05-28 18:23:07
MySQL
Denis Shestoperov, 2020-05-28 18:23:07

How to design MySQL database for photo album editor?

There is a task to develop a photo album editor ( example ).

The user creates a project, uploads their photos, creates or deletes photo album spreads, selects a template for the photo album, and inserts photos onto the template.

User actions to create a project:
1. Select a product category on the site (photo album, photo card, invitation)
2. Select a specific product from the category
3. Select product properties and go to the editor Front-

end is developed on Vue.js, Back-end on Symfony 4, communication between client and server is done through the REST API (HAL+json).

When designing such a database, I lack my own knowledge to solve some problems:
1. Product categories can contain different properties (photo albums, photo cards, invitations have different properties)
2. Some properties can depend on each other
3. I don’t understand how to CORRECTLY create a project that is passed to the editor

I built some database and I consider it wrong, since it contains a lot of nested entities, and therefore I cannot implement an adequate API for communicating with the client.

Current DB Schema:

spoiler
5ecfd539a97d6672177646.png


Initially, the administrator creates a new photo album in the admin panel (table photo_book). The photo_book_format table is needed to create photo album variations (it specifies the size of the album, the number of possible spreads (photo_book_spread_range), templates for photo album pages (photo_book_format_layout stores the path to the json file)).
The user on the site selects properties for the photo album (photo_book_project_details table) and creates a project (project table).
The project_details table is needed in order to link project and photo_book_project_details.
The spreads table is a table of spreads. Spreads contain pages (page). The page has a selected template (which in turn refers to the photo album variation (layout from photo_book_format_layout).
I tried to explain how I implemented this database, but I think you yourself understand that it is too complicated and confusing.

The task is to create a visual editor for photo albums or photo cards that are created in the site admin panel.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-05-28
@dimonchik2013

now hipsters invest this in nosebleeds and don’t sweat it until the customer screams from Amazon bills
and you don’t worry:
1) build the database as best you can
2) write code
3) take a faker and some wrk , check at the
same time write tests right away - they’re already -they usually reflect the business logic
well, but what is not clear is that with any base it will be for a new person, the main documenting what you do well

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question