CRM, messenger and barcodes: we continue to talk about educational projects of Technopark





We continue to talk about graduation projects of students of our educational projects. In this issue we will tell you about three projects in the discipline "Development in C ++" in Technopark. Previous publications: one , two , three , four .



— . .




JunTracker — CRM



The authors of the project wanted to do something useful that could be used in real life. One of the students worked as a teacher in robotics, programming and 3D modeling at a school of additional education. In Excel, a schedule was made, and financial accounting, and a journal with students' grades. All this was very uncomfortable to perceive, and you can't show your parents. This is how the idea arose to create a convenient service for such schools, allowing them to schedule, monitor the school's finances and keep an electronic journal for students. In this case, the service should be with separation of rights.



CRM was written from scratch in a semester. We did a lot, but we didn't manage to do some things. Next semester, the authors will make a second version with a React frontend and a Go server.





The left side is for the school administrator, and the right side displays all information about the current day. In the student database, you can search by first and last name.





Each student has a personal card with statistics:





CRM architecture looks like this:





The frontend is written in JS, HTML and CSS. It uses State and Composite patterns. The template uses Django syntax and the "factory" pattern. The server uses the mediator pattern. To work with the PostgreSQL database, the authors wrote a wrapper.



Project team: Mark Bykhovets, Mikhail Truschelev, Timofey Makarov, Andrey Mavrin.



GitHub repository .



Video from project defense .



Desktop messenger JMICKHENGER



The students wanted to try their hand at creating a messenger that has the basic functions of such modern applications. JMICKHENGER runs on Linux and macOS. He knows how to create conversations with people from the contact list (supports an unlimited number of users in one chat), send images and show the status of the message (read or not).





The messenger was created using the following technologies:



  • OpenSSL.
  • Qt - used for rendering the interface, applied the MVC design pattern.
  • Boost.
  • MongoDB.
  • SQLite.


General system architecture:





On the application side, there is a network part library. As soon as the user interacts with the application, a specific client function is called. And depending on the action, a callback is passed with the desired functionality, which will be executed after the network part processes the response from the server or notifies the model about an error. In case of incorrect actions, the application will process and notify the user about the inaccuracy of the entered data or other actions (wrong login or password, already registered user, non-existent friend, or friend is already on the list, etc.). The number of requests to the server has been reduced: unique IDs are allocated to notify all users in the chat, which are used instead of requests. There is a protection against impatient users: it is useless to click on the same button many times, each time sending a request,hoping to get a response from the server as soon as possible :)



The network part interacts with the remote server. The asynchronous client runs on a separate dedicated thread and is written using Boost Asio. The client maintains a TLS connection to the server. The data exchange format is JSON. OpenSSL is used for security. Interaction with the network part takes place using callbacks. Some callbacks are executed once after a response from the server arrives, while others are set for the entire duration of the application's operation and are triggered every time certain information is received from the server (analogous to observer in Google Firestore). For some information that is rarely updated, a cache is implemented using SQLite.



Asynchronous TCP Server is also written using Boost Asio and OpenSSL. The server identifies connections with unique IDs and delegates their execution to an instance of the business logic class using a request queue. Also, the authors using the mongocxx library wrote a wrapper class for working with MongoDB. When creating it, the mongocxx library was used. Business logic can be roughly divided into three parts: receiving a request from a client in the form of JSON and parsing it; working with the database and, in some cases, checking their correctness; formation of a response to the client. In addition, the business logic was implemented as a dynamic library, so that it would be more convenient to combine it with server parts.



The scheme of data exchange between client and server:





And this is how data exchange with the database works:





Project team: Konstantin Pavlov, Sergey Alekseev, Nikolay Manzeev, Nikita Shchelkanov.



GitHub repository .



Video from project defense .



Barcode system



The authors made a bar-coding system for businesses that produce all kinds of electronics. The system is able to automatically take into account products, control the passage of products through various stages of the technological process, and allows increasing the automation of production.



The system reduces the burden of controlling the production of products. All relevant information is available online. The system also eliminates human errors when counting products at different stages of production.



Scheme of work:





The client software allows generating barcodes and registering manufactured products in the database on the server. The performers use wireless scanners to read the barcodes printed on the packaging or the products themselves. The scanner sends information about the scanned barcode and asks the database to register a new product.



The system requires a wireless barcode scanner, like this:





Features of the firmware:



  • A state-of-the-art IDE that exclusively supports the C language.
  • Partially documented C API for scanning and working with keys, display, lights, WiFi, internal storage.
  • There is a utility for loading the firmware into memory.


To make the scanner compatible with its barcoding system, the authors of the project reverse-engineered the IDE. It turned out that the device is equipped with an STM32F103xx microcontroller with an ARMv7-M core. We also managed to find a static library with business logic for handling API calls.



Tools used to develop the system:



  • cc-arm-none-eabi (GNU ARM Toolchain) - a set of tools for development for the ARM architecture (compilers , ++, ASM; ld, objdump).
  • linker-script - for Flash and RAM markup.
  • cmake as a build system + cmake toolchain file for cross-compilation for STM32 microcontrollers (thanks to the repository https://github.com/ObKo/stm32-cmake ) /
  • Specification, documentation, Stackoverflow, topic forums.


I had to write the following modules:



  • A wrapper class for user interaction through keys.
  • "GUI" for working with the user.
  • TCP-HTTP-JSON stack over the IP layer implemented in the scanner API.
  • A wrapper class over the scanner API for scanning barcodes and getting scan results.


Next, the team wrote client software that allows you to:



  • Authorize user.
  • View all product models and information about them.
  • View all devices.
  • Add devices.
  • Add models.
  • Generate barcode for the model.
  • Print barcode on printer
  • Save barcode to file.


This software was written with:



  • QtCreator (graphical interface).
  • Boost (networking implementation and JSON parsing).
  • Libraries for converting a product ID to a barcode.


The HTTP Server is built using Boost.beast, MySqlCppConnector, Boost.thread, and OpenSSL. Its tasks:



  1. Receiving HTTP requests.
  2. Accessing the database.
  3. User / Scanner Authentication.
  4. User / Scanner Registration.
  5. Generation of unique QR codes.
  6. Sending HTTP responses.


MySQL acts as a database.



Server and database architecture:





Project team: Daniil Cherny, Nikolay Umrikhin, Sergey Chepurnoy.



Video from project defense .






You can read more about our educational projects at this link . And more often go to the Technostream channel , there regularly appear new training videos about programming, development and other disciplines.



All Articles