About the project
Content goes through extraction, classification and draft preparation. The source and intermediate results are stored separately, so a failed step can be inspected and rerun.
FastAPI, PostgreSQL, a Telegram collector and a publication processing pipeline. The server runs the original app without a demo wrapper. Collection needs Telegram and model configuration. Those are not connected yet, so there is no collected content.
- Telegram API ID/hash and an authorized MTProto session have not yet been provided. Collection of real messages has not started.
- The active tfidf_logreg.joblib model and selected LLM settings are missing. There is no basis for claiming verified classification or rewriting quality.
- The interface currently shows an empty production-schema database. The previous demo's synthetic corpus has not been mixed into the original tables.
- External publishing has not been tested: it requires a destination channel and BOT_TOKEN or MAX settings. AUTO_PUBLISH remains false until the destination is configured.
Screenshots, diagrams and source evidence retain their original language; captions and descriptions are translated.
Architecture and diagrams
- The original application's app.web.main:app is running, rather than app.portfolio.
- PostgreSQL with the original migrations; separate persistent sessions, media, models, cache, artifacts and reports directories.
- The collector and full-cycle pipeline are separate services in the connected profile. They are activated after configuring the Telegram session, model and selected integrations.
- The administrative interface is protected by HTTPS Basic Auth; secrets are kept outside the repository.
Code map: files and dependencies
This map is tied to version be01bfe3995f. The table lists the screen or API, related module and data.
| Feature | Screen / API | Module | Data / verification |
|---|---|---|---|
| Collection | Telegram MTProto | app/main.py; app/collector.py | TG session → telegram_posts; connection awaiting configuration |
| Application interface | /processed, /drafts, /pipeline | app/web/main.py; app/web/templates | 11 main GET sections checked |
| Classification | Pipeline / models | app/content/model_registry.py; pipeline_manager.py | model_versions; active joblib is not yet available |
| Editorial processing | Rewriting / prompts | app/content/pipeline_rewriter.py; prompt_versions.py | PublicationDraft / RewriteAttempt; external models unverified |
| Operations | /health; Docker Compose | Dockerfile.runtime; app/config.py; alembic | PostgreSQL, migrations, password access |
Using the code map
- Before making a change, find the feature and trace its links to the API, state and storage.
- Check inputs, errors, repeated events and dependent workflows.
- After making a change, update the map and affected diagrams alongside the code.
- Run the related checks and link the new evidence to the source version.
Workflows and API
- Sign in to the owner's interface and open Materials, Drafts, Labeling, Models and Pipeline.
- Open Rewrite Progress, Prompts and Search: these are the original pages backed by PostgreSQL.
- After configuring Telegram: app.main login/login-qr → inspect-folder → limited sync → inspect materials.
- After registering a model and configuring the LLM: processing → classification → draft → review → approved publication to the selected channel.
Verification of the published version
CI: Full build of the original application ↗ · be01bfe3 · this demo's version · 2026-09-07
- The original Docker image was built in GitHub CI. PostgreSQL migrations were applied.
- All 11 main navigation pages return HTTP 200 after sign-in, with no JavaScript errors.
- Unauthenticated requests return 401. /health confirms web and database availability.
- Telegram collection, model execution and publishing are unverified because configuration is missing; these stages are not described as complete.
These checks apply to the listed version. Business metrics and model quality on an independent dataset were not measured.
Measurements
- Five sequential HTTPS GET requests from the VPS to itself: 81.5–228.6 ms, all HTTP 200. This is not a load test or an assessment of the external network.
- No Telegram collection, LLM processing or Codex task ran during the measurements.
Running and operating
The Dockerfile.runtime image is built outside the VPS. Web starts with uvicorn app.web.main:app --host 0.0.0.0 --port 8080.
Runtime settings: /srv/portfolio/publisher/.env; additional integrations: /srv/portfolio/publisher/integrations.env. Secret values are not published.
After configuring the collector, create a session with app.main login-qr or login. Do not import old WTG data: WTG has been deleted and is not a recovery source.
Register the model with the standard app.content.model_registry register-initial-model command using the owner's supplied package. Initial sync is limited to 20 messages per chat.
Do not enable AUTO_PUBLISH without a configured destination channel. Keep administrative screens private when working with real data.
Stack
| FastAPI / Jinja | Original editorial interface |
|---|---|
| PostgreSQL / SQLAlchemy / Alembic | Production data schema and migrations |
| Telethon | MTProto collector; awaiting a session |
| scikit-learn / LLM | Classification and rewriting after model configuration |
Materials and source code
Code history: since 16 June 2026. Demo preparation: 7 September 2026.
The evidence archive retains its original language.