How besessener/procrastinationbuddy works
Project type and purpose
• This is a Dockerized, full-stack Python application called “Procrastination Buddy.”
• Purpose: deliver a Streamlit-based UI in the browser that fetches silly “procrastination tasks” from a Flask backend, which uses an Ollama AI model to generate tasks and persists tasks/settings in a PostgreSQL database.
File structure
• Top-level directories:
• backend/ – Flask app source (routes, services, DB code), Dockerfile, pytest tests
• frontend/ – Streamlit app source (UI components, utils), Dockerfile, pytest tests
• tests/ – API collections (Bruno .bru files) and E2E tests (Playwright)
• docs/ – architecture and UI screenshots
• compose.yaml – Docker Compose orchestration
• buddy.sh – helper script to start/stop services and run tests
• .github/workflows – CI (auto-merge, quality gate)
• Architectural hints: two containerized services (frontend, backend), an external AI model service, and a PostgreSQL data store.
README for additional insights
• Confirms four key services in Docker Compose:
1. Frontend (Streamlit)
2. Backend (Flask)
3. Ollama AI model
4. PostgreSQL database
• Tests include Flask unit tests, API test collections, and Playwright E2E.
• User’s Web Browser (UI)
• Streamlit Frontend Container
• Flask Backend Container
• Ollama AI Model Service Container
• PostgreSQL Database Container
• Orchestrator: Docker Compose (compose.yaml)
• (Optional) CI/CD: GitHub Actions pipelines
b. Relationships and data flows:
• Browser ↔ Frontend: HTTP(S) requests/responses for UI rendering and user interactions
• Frontend → Backend: REST API calls (tasks, settings endpoints)
• Backend → Ollama: RPC or HTTP call to the AI model for task generation
• Backend ↔ PostgreSQL: SQL queries over TCP to store/retrieve tasks/settings
• buddy.sh → Docker Compose: CLI orchestration of service lifecycle
c. Architectural patterns and principles:
• Layered microservices style: UI layer (Streamlit), API layer (Flask), Service/AI layer (Ollama), Data layer (Postgres)
• Separation of concerns: UI rendering vs. business logic vs. persistence vs. model inference
• Containerization for consistent environments
d. Key technologies/frameworks:
• Python, Streamlit, Flask
• Docker, Docker Compose, bash script (buddy.sh)
• Ollama model server
• PostgreSQL
• Testing: pytest, Playwright, Bruno collections
Essential details
• Inter-service protocols and data-flow directions are explicitly shown