How githubtraining/guided-prompt-engineering-junior works
Purpose and Runtime
This is a small server-rendered habit-tracking web application used as a Copilot-guided learning project. Users create habits, mark daily completions, and review a habit’s progress. The Python application entry point is app.py; dependencies are declared in requirements.txt.
Application Boundary
app.py is the central application layer. It likely owns web routes, request handling, persistence operations, and template rendering rather than separating these into service modules. The browser interacts through HTML forms and page navigation; no separate frontend API or client application is present.
Habit Management Flow
The main dashboard is rendered from templates/index.html. Its control flow is expected to:
1. Load stored habits from the local database.
2. Display habit summaries and creation controls.
3. Submit user actions back to routes in app.py for creating habits or recording completion.
This makes the application server the authority for habit state and completion history.
Habit Detail and Progress
templates/habit_detail.html is the per-habit view. It forms the boundary for inspecting an individual habit and its check-in history, including any future streak, badge, motivational-message, sharing, or graph enhancements suggested by the project instructions. Requests for a specific habit are routed through app.py, which loads the relevant persisted data and renders this template.
Persistence
The application uses a local SQLite database at instance/habits.db. The instance/ location indicates environment-specific mutable state, separate from source templates and static assets. The Python server in app.py is responsible for translating habit and check-in operations into database reads/writes. This is a single-instance, filesystem-backed persistence model rather than an external managed database.
Presentation Layer
Server-rendered templates live under templates/, with shared visual styling in static/css/style.css. Browser-side behavior, if any, is embedded in templates or delivered as static assets; the tree contains no standalone JavaScript bundle. Styling changes, including the README’s suggested themed UI work, are concentrated in static/css/style.css and the two page templates.
Development Infrastructure
The project is designed to run in GitHub Codespaces/dev containers. .devcontainer/devcontainer.json and .devcontainer/Dockerfile define the development runtime, while .devcontainer/scripts/update_dates.py supports the workspace setup or date-related maintenance. GitHub Copilot is an intended development aid, not an application runtime dependency.
Main entry points: app.py Habit web server · devcontainer.json Dev container config · index.html Habit dashboard · habit_detail.html Habit detail
Components 10
Browser presentation
- User browser · Uses page navigation and HTML forms.
- Habit dashboard · Lists habits and provides creation and completion controls.
templates/index.html - Habit detail · Shows one habit and its check-in history.
templates/habit_detail.html - Shared styles
static/css/style.css
Application
- Habit web server · Owns routes, form handling, rendering, and database operations.
app.py - Python dependencies
requirements.txt
Local persistence
- Habits database · Stores habits and completion history as local mutable state.
instance/habits.db
Development environment
- Dev container config
.devcontainer/devcontainer.json - Development image
.devcontainer/Dockerfile - Date maintenance script · Supports workspace setup or date-related maintenance.
.devcontainer/scripts/update_dates.py
Connections 9
- User browser → Habit web server: HTTP requests and form posts
- Habit web server → Habit dashboard: renders dashboard
- Habit web server → Habit detail: renders habit view
- Habit dashboard → Shared styles: uses
- Habit detail → Shared styles: uses
- Habit web server → Habits database: reads and writes habits/check-ins
- Python dependencies → Habit web server: provides runtime packages
- Dev container config → Development image: builds development runtime
- Dev container config → Date maintenance script: runs or supports setup