Unif is a Telegram bot that monitors and notifies users about changes in their university's Learning Management System (LMS). Stay informed about exercise deadlines, online session additions, and other critical updates without constantly checking the LMS portal. Unif bridges the gap between your academic responsibilities and your preferred communication platform.
Please note that the live demo only works with lms.ui.ac.ir
- Installation
- Usage
- Technologies Used
- Documentation
- Contributing
- Contributors
- License
- Change Log
- Roadmap
Follow these steps to set up Unif locally:
-
Clone the repository:
git clone https://github.com/ausdavoud/unif.git cd unif
-
Setup environment variables
cp .env.example .env
-
Obtain a new Telegram Bot Token from Botfather
Go to Botfather and get a bot token by creating a new bot or using an existing one. Set BOT_TOKEN in .env file:BOT_TOKEN='7206814144:AAHuiqA7HNmRwK8vmqponfS098sTpocnTQc' # Replace this with our own token
-
Get a new Django Secret Key
You can set any random string you'd like. Alternatively, generate a new one at djecrety.ir. Set it in .env file:SECRET_KEY='44m2da+ru@b-g%^9m3kfv1_^ut9vn%5*v$cj8f!k0(_$pvagd@' # Replace this with our own secret key
-
Add your VPS IP or domain name
SetPRODUCTION_HOSTNAME
environment variable to your VPS IP address or domain (without leading http/https). It will be added to DjangoALLOWED_HOSTS
andCSRF_TRUSTED_ORIGINS
.PRODUCTION_HOSTNAME=116.125.1.53 # or your_domain.com
-
Set SSL
If SSL is enabled at your specified domain (the value ofPRODUCTION_HOSTNAME
), setUSE_SSL
to True:USE_SSL=True
-
Run the docker containers:
docker compose up -d
Additionally, you can create a superuser for you Django admin panel. First ssh into your VPS and then:
docker compose exec web bash
. venv/bin/activate
cd src
python manage.py createsuperuser
# set user name and password
exit
You'll be able to visit your admin panel at your_domain_or_IP.com/americano-coffee
. (It's also a best practice to change the admin panel url at src/core_config/urls.py)
Send /login
to your newly created bot and provide your LMS username and password. Unif will periodically check LMS every 5 minutes.
- Django: Web framework for rapid development and clean design.
- Celery: Distributed task queue for handling asynchronous jobs.
- Redis: Message broker for Celery task management.
- aiogram: A modern and fully asynchronous framework for Telegram Bot API
View docs.
We welcome contributions! To get started:
- Fork the repository.
- Create a feature branch: git checkout -b feature-name.
- Commit your changes: git commit -m "Add feature".
- Push to your branch: git push origin feature-name.
- Submit a pull request.
This project is licensed under the MIT License - see the license file for details.
1.0.0-alpha - Initial release
- Convert bot login to service architecture
- Hash user passwords in storage
- Add
/delete_my_data
command with periodic task cleanup - Store author_id | lmsuser mapping
- Add
/set_chat_id
command - Implement
/get_chat_id
command - Implement notifications for unsuccessful login attempts
- Configure docker volumes for venv, staticfiles, and media
- Set up Dokploy integration
- Create GitHub releases workflow
- Configure SSL backend
- Chat ID management interface
- Interval configuration interface
- Active course dashboard with manual update triggers
- Account deletion interface
- Implement change_interval API
- Migrate to Python-first approach
- Refactor atomic transactions:
- Replace chain patterns with standard functions
- Ensure atomic operation integrity
- Create Django admin command for batch Telegram notifications
- Develop Celery command to send pending messages (is_sent=false)
- Configure Celery retry mechanism
- Comprehensive logging system
- Serve documentation
- Complete README documentation
- Implement test suite with coverage targets