Andrii · AI at work

All lessons

01

My website hasn't worked for five years. I'm rebuilding it into a portal — showing everything

22:26 · 20 steps

  1. 1 00:00 Five copies of one entry — live
  2. 2 00:48 The duplicates are not in the search, but in the markup
  3. 3 01:08 An empty first screen
  4. 4 01:22 Breakdown of the "before": nine roles, Skills, English 55 %
  5. 5 02:58 Two storefronts: the website and the channel
  6. 6 03:29 Who I am and why this isn't about a pretty website
  7. 7 04:30 Architecture on the board: four tasks
  8. 8 06:54 The stack out loud: why not a website generator
  9. 9 07:55 Three things before the first prompt
  10. 10 08:59 First prompt: the skeleton

    1 What to do

    I give Claude Code the portal skeleton: routes, markdown reading, a base template. First the plan, then the files.

    2 Prompt

    EN · Prompt
    We're building a personal portal on FastAPI. No static generator, no SPA:
    pages are rendered on the server via Jinja2.
    
    Project structure:
      app/main.py     — the FastAPI application
      app/content.py  — reading markdown from content/ and parsing the front matter
      templates/      — Jinja2: base.html and one template per section
      static/css/site.css — built Tailwind (we commit it to the repository already built)
      content/ru|uk|en/   — section texts in markdown with YAML front matter
      content/works/      — one file per work
    
    What to do now:
    
    1. app/main.py: a FastAPI application, StaticFiles mounted at /static,
       Jinja2Templates pointing at templates/.
    
    2. Routes. The language is the first path segment, Russian without a prefix:
       /            /uk/            /en/
       /how         /uk/how         /en/how
       /works       /uk/works       /en/works
       /works/{slug} and the same with prefixes
       /materials   /contact   /archive — likewise.
       One shared handler, not twenty identical functions.
    
    3. app/content.py: reads content/{lang}/{name}.md, parses the YAML front matter
       (title, description, updated), returns HTML and metadata.
       If the file doesn't exist — return a 404, not an empty page.
    
    4. templates/base.html: the lang attribute is filled in, title and meta description
       come from the front matter, one link to /static/css/site.css.
    
    5. No texts in templates. Any string I might want to edit
       lives in content/. The template has only markup and substitutions.
    
    We're not touching the styling now — only the structure and the correct texts
    in the correct places.
    
    First show the plan and the list of files you're going to create.
    Don't write the files until I confirm.
    EN · Prompt from the screen
    Собираем персональный портал на FastAPI. Ни генератора статики, ни SPA:
    страницы рендерятся на сервере через Jinja2.
    
    Структура проекта:
      app/main.py     — приложение FastAPI
      app/content.py  — чтение markdown из content/ и разбор фронтматтера
      templates/      — Jinja2: base.html и по шаблону на раздел
      static/css/site.css — собранный Tailwind (кладём в репозиторий собранным)
      content/ru|uk|en/   — тексты разделов в markdown с YAML-фронтматтером
      content/works/      — по одному файлу на работу
    
    Что сделать сейчас:
    
    1. app/main.py: приложение FastAPI, StaticFiles смонтирован на /static,
       Jinja2Templates на templates/.
    
    2. Маршруты. Язык — первый сегмент пути, русский без префикса:
       /            /uk/            /en/
       /how         /uk/how         /en/how
       /works       /uk/works       /en/works
       /works/{slug} и то же с префиксами
       /materials   /contact   /archive — так же.
       Один общий обработчик, а не двадцать одинаковых функций.
    
    3. app/content.py: читает content/{lang}/{name}.md, разбирает YAML-фронтматтер
       (title, description, updated), отдаёт HTML и метаданные.
       Файла нет — отдаём 404, а не пустую страницу.
    
    4. templates/base.html: атрибут lang подставляется, title и meta description
       берутся из фронтматтера, один link на /static/css/site.css.
    
    5. Никаких текстов в шаблонах. Любая строка, которую я захочу поправить,
       живёт в content/. В шаблоне только разметка и подстановки.
    
    Оформление сейчас не трогаем — только структура и правильные тексты
    в правильных местах.
    
    Сначала покажи план и список файлов, которые собираешься создать.
    Файлы не пиши, пока я не подтвержу.

    Ask in Telegram

  11. 11 10:49 Sections: works in a single scheme
  12. 12 13:09 Where AI did the wrong thing: invented facts
  13. 13 15:09 A silent error: hreflang "ua" instead of "uk"
  14. 14 15:38 Languages and URL structure
  15. 15 16:42 The funnel: form, email, channel
  16. 16 17:21 Four events in analytics
  17. 17 17:51 Deploy to my own VPS
  18. 18 18:35 Before and after
  19. 19 19:49 Where it breaks
  20. 20 20:58 Homework and what's next