📜 ⬆️ ⬇️

Personal management system development

Motivation


Modern technology development is moving towards predicting human behavior based on tracking the entire array of its activities in virtual and physical reality (big data). There is a positive point in this, because if you see where a person is going, you can show him the shortest and most effective way. But, according to the law of unity and struggle of opposites, the following threat arises (for marketers, on the contrary, a perspective), as I see it - this is an opportunity not to predict behavior, but to form predictable behavior.

If you are interested in what an individual can do about it - welcome under cat.

Of course, if we look even wider, then society itself, using culture and other social tools, forms the predictable behavior of the individual, but this is too broad, because Culture gives an incomparably greater level of freedom of judgment, unlike a focused informational tape, so I’m narrowing back.

So, what can make a separate customer to complicate the task of forming their own predictable behavior? For me, the answer lies in the following phrase - in order to learn to manage something, you must learn to measure it.
')
But what can a person measure at himself and how to analyze it? The decision was invented for a long time - this is keeping a personal diary (its / my little data) and the subsequent analysis of recorded events.

But when keeping a diary, the following difficulty arises, at least for me, it is almost impossible to effectively categorize events \ objects (I’m vicious about object-oriented thinking). For example, I would like to separately consider tasks, thoughts, questions, mistakes, etc., to see the connections between them, to get an analyst. It should be noted that some examples of effective solutions to this problem can be found in numerous books on time management. But I tried to make my bike.

So, what properties can a perfect diary have?

And now, having finished with dreams, we return from Plato's ideal to our sinful and, having passed through many curved mirrors, and not only mirrors, we get the realization of the concept:



Task


Initially, I set myself the following goals:
  1. Creation of any kinds of objects without development;
  2. The output of identical objects on a separate page with the display in a tabular form, as well as with the ability to go to a separate object and display / maintain as a card
  3. The possibility of establishing links between objects;
  4. Setting statuses and categories for objects;
  5. Doing analytics \ reminder \ prediction.

results


Happened:

Problems:

Decision


Disclaimer! The author is not a professional programmer and expert in the field of development in python \ js, but just an amateur, so ideas on the proper organization of the architecture and the technologies used are welcome and I will be very grateful for these tips.

Github code

Tools used


Backend:

Frontend:

Solution Architecture


image

General architecture description


  1. In Python, a service is written that spins on localhost and handles requests from html pages.
  2. Objects are html-pages with a specific markup, in which the names of the fields are indicated, correspond to the fields in the database (no ORM solutions are used, the processing is done by your bicycle)
  3. Communication with the server occurs through json messages.
  4. All objects from the server are loaded at the initial page load, in the future only the delta is exchanged.
  5. There are built-in objects, these are statuses and relationships, the remaining objects are described separately (see below)

Unfortunately, as the functionality grows and the desire to quickly get a complete solution, the architecture began to creep away and failed to fully encapsulate objects, so in practice there are different hacks and moments of penetration of the encapsulation, but in general the scheme is relevant.

Frontend:

Backend:
  1. server.py - Request processing.
  2. json2sql.py - Converting a json query from a frontend to an sql query for a database
  3. dbserver.py - Execute sql query.
  4. settings.py - Options.
  5. object2db.py - Parameters of object types on the server.
  6. actionfile.py - Creating directories for tasks.


Database schema:


Examples of JSON messages:


Where:


Some of the objects created are:

Algorithm for creating a new object


  1. Create a table in the database
  2. Create file% object_name% .html
  3. Create file% object_name% .js
  4. Describe the object in the object2db.py file
  5. If you need to add a status, fill in the data in the tables (sys_status)
  6. If you want to create new relationships, fill in the data in the tables (sys_rel_object2object)

I did not describe the creation in more detail (and did not record the video, although initially the idea was), because It turned out quite a long and tedious process. I did not do the constructor, because for the concept, it turned out to be redundant, but this is the first thing I will begin when developing version 2.0, see below.

Future plans for version 2.0


The ideal is to work with any objects within one window, a minimum of actions with the mouse. Maximum translate to description on the command line.

Ideas:


Conclusion


I tried to write an article as short as possible so that you could quickly understand the basic idea and description of the implementation, without drowning in too much information.

I use this system, about 3 months, simultaneously correcting errors, the flight is equal.

Thank you for your time.

Source: https://habr.com/ru/post/306540/


All Articles