Skip to content

This repository contains code and configuration files for deploying the Social-Contract platform, which provides children and parents with the ability to enter into a "social contract" that allows financial incentives for a child's success in school.

License

Notifications You must be signed in to change notification settings

SergeyIvanovDevelop/Social-Contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social-Contract

Social Contract

Social-Contract · GitHub license Python Golang GUI PostgreSQL Дневник.ру LinkedIn Telegram

This repository contains code and configuration files for deploying the Social-Contract platform, which provides children and parents with the ability to enter into a "social contract" that allows financial incentives for a child's success in school.

⚙️ How it works

  1. Parent and child need to register in Social-Contract platform via Desktop GUI Application. There, the parent enters their data, the child's data (including the open data of the child's bank card) and the data for entering the electronic diary platform Dnevnik.ru - so that the platform can track the child's grades. During the registration process, the policy for calculating material incentives for grades is also selected.

  2. After registration on the platform is completed, the parent subscribes to the Telegram bot, enters the necessary identification data, and subsequently, at his request, the bot will generate a QR code for payment in a mobile bank (tested in the bank Tinkoff bank) for a parent in accordance with the financial incentive policies described in the contract.

  3. The general scheme of the platform is shown in the image:

💻 Getting Started

Step 1

  1. Go to home directory and clone repository from github: cd ~ && git clone https://SergeyIvanovDevelop@github.com/SergeyIvanovDevelop/Social-Contract

Step 2

  1. Go to the directory of the downloaded repository: cd ~/Social-Contract

Step 3

  1. Installing dependencies for the PostgreSQL DBMS, creating a new user and creating a database on his behalf and deploying it (tables, mappings, etc.), as well as installing dependencies for Python scripts:
cd Backend/PostgreSQL && ./deploy.sh

Step 4

  1. Install Golang and the library for building GUI applications fyne

Step 5

  1. Enter the required personal details in the source code in the files:
	- "subnet":"<IP-address>/32" ---> bash: $ ip a
	- "database":"<db_name>",
	- "user":{
                "name":"<db_user_name>",
                "password":"<db_user_password>"
            }
	- "token":"<telegram_bot_token>"
	- DB_USER     = "<db_user_name>"
	- DB_PASSWORD = "<db_user_password>"
	- DB_NAME     = "<db_name>"

Step 6

  1. Build and run the backend part of the platform: cd ~/Social-Contract/Backend && go build -o ./main && ./main <backend-part-port>

Step 7

  1. Build and run the frontend part of the platform: cd ~/Social-Contract/GUI_funy_lib && go build -o ./main && ./main <IP-address of backend-part> <backend-part-port>

Step 8

  1. Run Telegram bot: cd ~/Social-Contract/Python_modules && bot.py

*Note: The login of the user that the bot requests is calculated according to the rule: "LOGIN_"+Child's name+""+"Child's last name"+""+"Parent's login". Example: Parent login: login_1 Child's name: Ivan Child's last name: San

----> Child login: LOGIN_Ivan_San_login_1_*

🖼️ Illustrations:

This illustrations demonstrates using the desktop GUI application of Social-Contract platform.

🎬 Example using (GIF):

This animation demonstrates scenarios for using the Telegram-bot of Social-Contract platform.

animated

📑 Licence

Social-Contract is CC BY-NC-SA 3.0 licensed.

About

This repository contains code and configuration files for deploying the Social-Contract platform, which provides children and parents with the ability to enter into a "social contract" that allows financial incentives for a child's success in school.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published