A storefront chatbot built for the Introduction to Computing (KU1102-19) Project at STEI ITB — Tugas Besar Pengenalan Komputasi 1: Algoritma dan Pemrograman.
The assignment is an exercise in applying computational thinking techniques — decomposition, abstraction, pattern recognition, and algorithm design — to a chatbot application. The shop is decomposed into independent commands (browse, stock, cart, checkout), its catalog and settings are abstracted into data rather than code, the repeating shape of every command is factored into shared helpers, and each flow is expressed as an explicit algorithm over a shared database.
It ships as four surfaces over one database: a Telegram bot, an analytics dashboard, a command-line interface, and a key-guarded JSON API.
![]() |
![]() |
| Web & Telegram | Command Line |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
python cli.py
Dependencies are managed with PDM (pyproject.toml + pdm.lock), on Python 3.13.
git clone https://github.com/faizath/chatbot.git
cd chatbot
pdm install
pdm run python manage.py migrate
pdm run python manage.py runserver
| Env var | Default | Notes |
|---|---|---|
DJANGO_SECRET_KEY |
(none) | Required whenever DJANGO_DEBUG is off. With debug on, a random key is generated per start, so sessions reset on restart. |
DJANGO_DEBUG |
false |
Accepts 1/true/yes/on. Never enable it in production. |
Generate a secret key with:
pdm run python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
Set both in the server's environment. With debug off, static files are served by whitenoise from a manifest, so collectstatic must run before the server starts — runserver.sh already does this.
The Telegram bot polls in its own process, so start it alongside the web server:
pdm run python manage.py runbot
It needs a ChatbotUser row with username='admin' and a telegram_token set; without one it exits with an error.









