Skip to content

yavnolib/Miptgram-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIPTGRAM Social Network

This repository contains the source code for the cross-platform social network MIPTGRAM created by MIPT students for MIPT students. The project was developed as the final project in Computer Technology for the 4th semester.

miptgram

Table of Contents

Team

  • Amadei Vorontsov
  • Yaroslav Nikolaev
  • Ivan Chevychelov
  • Lena Zemskova.

Purpose

The purpose of the MIPTgram project is to provide a social network platform for students of the Moscow Institute of Physics and Technology (MIPT) that is cross-platform and accessible on any device. It aims to connect students and provide them with a variety of features such as a schedule, newsfeed, and a graph builder for labs. By creating a social network tailored to the needs of MIPT students, the project team hopes to enhance communication and collaboration among students and contribute to their academic success. The project also serves as a final project for the 4th semester of the Computer Technology course at MIPT.

Tech Stack

  • Flutter Framework
  • Dart language
  • Rive
  • Linux administration
  • Python for server's apps (Flask, matplotlib, numpy)
  • PostgreSQL
  • NoSQL
  • C/C++
  • Swift
  • Kotlin
  • Object Oriented Programming
  • Parallel programming usinc acync/await template, Future and Stream objects; using multiprocessing on the server side of the application

Features

  • Chat between students and professors (in future)
  • Subject schedule for students
  • Phystech.Conversations, a platform for anonymous posts
  • General physics lab handler, which includes laboratory work results, schedules, and materials (in future)

Project Overview

MIPTGRAM is a social network for MIPT students that can be run on any device and in a web browser. The programming language chosen for the project is Dart object-oriented language using Flutter framework, which is separately compiled into C++, HTML, Kotlin, or Swift depending on the platform. The entire server-side is written in Python. A separate Rive application was used to create animations. At the moment, the application has registration and account authorization, a schedule that is updated for each student, a Phystech.Confessions newsfeed, and a graph builder for labs.

Database

PostgreSQL is used as a database management system, which has tables because it is a relational database. The database is hosted on a computer with an external irstpin and can be connected to from anywhere.

The PostgreSQL database has several tables, including:

  • groups: contains the full group name and group id

  • users: contains user id, first name, last name, group id, password, mail. Instead of passwords, it stores an MD5 hash of 'password' + 'kisy lubish'. In PostgreSQL, this hash is simply calculated using the md5(concat(password, 'kisy lubish')) function.

  • pairs: contains the pair's id and the time of the pair

  • weekdays: table with days of the week

  • subjects: table with all kinds of subjects

  • schedule: table with the schedule, where each column are the IDs, they can be combined tables and get the texts all.

  • posts: similar table with posts.

In addition, there is also a local database for each platform. This is a NoSQL database that is used to save the information and the user, so as not to ask him to log in every time, and old posts so as not to download them every time.

Asynchrony and Multithreading

On the client-side, the async/await template is used, through which all requests to the database are done in parallel. For example, when the login and password are checked, in parallel, information is sent to the server, and the animation download is displayed. When updating the schedule or writing a new post, access to the database is done in parallel with the rest of the application, so the application does not hang up, and the user can use it while sending data.

On the server-side, a Python program with Flask, NumPy, and Matplotlib libraries is used to draw graphs. The main process is the parent process, which sits listening to incoming requests. For each request, it runs a separate process that sends a picture to the parent process. This was done to handle a large number of requests and to avoid memory leaks that are allowed by the Matplotlib library.

When Matplotlib draws a chart, memory leaks there. It requests a canvas (memory for storing information about the shape, about the chart), draws on this canvas, but the allocated memory is not released in any way, and it's not fixed because this is in the library engine itself. That's why you need a separate process to draw the graphic. When the drawing process draws the chart, it just dies, and thus frees all memory allocated to it, including memory for the canvas.

Menus and Applications

The MIPTGram application has the following main menus and features:

  1. Main Window: This window is the first window that appears when you launch the application. It displays an animation along with the application logo.

main window

  1. Login Window: This window allows users to either register a new account or log in to an existing one. When the user presses the login button, the application sends a request to the database. If the request is successful, the application retrieves all the user's information, including their schedule and new posts. On subsequent visits, the application will not display this information again since it will be saved on the user's device.

login window

  1. Schedule Window: This window displays the user's schedule with all their subjects. Users can swipe left or right to switch between days of the week, add a new subject to their schedule, or delete a subject. Any changes made to the schedule will update the database.

schedule window

  1. Side Menu: The side menu allows users to switch to any of the other windows, view their personal information, or log out of their account.

side menu

  1. Phystech.Confessions Window: This window displays posts that are visible to all users. Users can add a new post, which updates the database and allows other users to read it.

confessions window

  1. MiptChat This window contains the chat, which will be further developed. You can click on the dialog with another user and go to a separate window with correspondence, or you can swipe to the right to go to the menu of online calls.

| miptchat | dialog | calls |

  1. Graph Builder Window: In this window, users can enter data, which the application sends to the server for processing using the method of least squares. The error is also calculated, and the output is a graph of the data that users can use to design their lab work.

graph

Installation

For installiation download latest version here

  • For Android:

    • Download miptgram.apk.tar.gz to your Android-based smartphone from latest version on "Releases" button in this repository.
    • Extract and install miptgram.apk from this archieve.
    • Use with pleasure!
  • For Linux:

    • Download linux-app.tar.gz to your Linux-based device from latest version on "Releases" button in this repository.
    • Extract "release" folder from this archieve
    • Go to this folder:
    cd release/bundle
    chmod +x Miptgram
    
    • Launch the application by double-click on Miptgram in /release/bundle or write this command in /release/bundle:
    ./Miptgram
    
    • Use with pleasure!

To install and run the MIPTgram project from github repository, follow these steps:

  1. Clone the repository: git clone https://github.com/vorontsov-amd/Miptgram.git
  2. Install the Flutter SDK: follow the instructions on the Flutter website.
  3. Install PostgreSQL: follow the instructions on the PostgreSQL website.
  4. Update dependency flutter pub get
  5. Run the client: flutter run

License

The MIPTgram project is licensed under the MIT License. You can find a copy of the license in the LICENSE file in the project repository. The MIT License is a permissive free software license that allows for reuse within proprietary software as well as free and open-source software. It allows for modification, distribution, and private use of the software as long as the original copyright and license notices are retained.

Future Plans

In the future, the MIPTGram team plans to add a chat room to the application so that users can communicate with each other. They also plan to improve the user interface and add more features to the application, such as notifications and the ability to share posts.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published