Fakultas Ilmu Komputer UI

Commit 7d2e46b0 authored by ZAKI RAIHAN's avatar ZAKI RAIHAN
Browse files

Update README.md v0.1

parent 2a190432
......@@ -4,7 +4,7 @@
1. Requirements
2. Application Structure
3. Application Configuration
4. How It Works
4. Features
## Requirements
1. Python 3.7
......@@ -51,4 +51,62 @@ ossd-notification-bot
Make sure to have those environment variable before running the app:
- APP_SETTINGS=\<which config that you want to use\>
- BOT_TOKEN=\<your bot token that acquired from telegram bot father\>
- BOT_USER_NAME=\<your telegram bot username\>
\ No newline at end of file
- BOT_USER_NAME=\<your telegram bot username\>
- URL=\<your server url name\>
- SSO_UI_URL=\<SSO UI CAS URL\>
- DATABASE_URL=\<your postgre database URL\>
- API_CS_CLIENT_SECRET=\<akun.cs client secret key\>
- API_CS_CLIENT_ID=\<akun.cs client id key\>
## Features
### 1. Authentification Using akun.cs.ui.ac.id
Authentication Flow:
- User use command /login from their notification bot
- Bot will send authentication link to User, the link will be used to authenticate user SSO account using akun.cs.ui.ac.id (link example: https://<yourServerUrl>/loginsso)
- User will login to akun.cs.ui.ac.id using their SSO account
- If User account registered to akun.cs.ui.ac.id, User could fill their phone number that associated with his/her telegram account
- User phone number saved in database, the notification settings still deactivted
- If User account not registered (maybe wrong username or password) they could retry to login again
### 2. Activate and Deactivate Notification (From Telegram Bot APP)
Activate Account Notification:
- User use command /activateNotif in telegram bot chat room
- Chat bot will ask User if they want to share their contact to bot
- User share their contact, then server will save the chatId from contact to database associated with phone number that has been registered through authentification process
- User will recieve notification that being push by Information System in Fasilkom UI
Deactivate Account Notification:
- User use command /deactivateNotif in telegram bot chat room
- Chat bot will automatically delete chatId in database, so User won't recieve any notification
### 3. Push Notification Custom Message
If any information system want to send custom push notification to specific User, they could this API:
- URL: https://\<your server main url\>/sendNotification/custom
- Method: POST
- Request Body:
{
"username": <User SSO username>,
"message": <Custom massage that want to be given to the User>
}
After that user will recieve notification based on custom message that being send
### 4. Push Notification for surat.cs.ui.ac.id Using Template
If surat.cs.ui.ac.id want to send notification to user that request to make Letter, they could use this API:
- URL: https://\<your server main url\>/sendNotification/sisurat
- Method: POST
- Request Body:
{
"username": <User SSO username>,
"type": <Enum type of letter creation status, see definition below>,
"judulSurat": <The letter tittle>
}
- Letter creation status enum:
- 0 : "Diajukan"
- 1 : "Ditolak"
- 2 : "PersetujuanDosen"
- 3 : "Proses"
- 4 : "Selesai"
After that user will recieve notification based on their letter creation status, using template that has been configured. See files ./telebot/sisuratNotif.py to see messages template
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment