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.
-
Parent and child need to register in
Social-Contract
platform viaDesktop 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. -
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 aQR
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. -
The general scheme of the platform is shown in the image:
Step 1
- Go to home directory and clone repository from github:
cd ~ && git clone https://[email protected]/SergeyIvanovDevelop/Social-Contract
Step 2
- Go to the directory of the downloaded repository:
cd ~/Social-Contract
Step 3
- 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 forPython
scripts:
cd Backend/PostgreSQL && ./deploy.sh
Step 4
Step 5
- 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
- Build and run the
backend
part of the platform:cd ~/Social-Contract/Backend && go build -o ./main && ./main <backend-part-port>
Step 7
- 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
- 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.
Social-Contract is CC BY-NC-SA 3.0 licensed.