fix: correct typo in progress tracking variable name from Progss to Progress
This commit is contained in:
@@ -9,7 +9,7 @@ Server-rendered social network for developers. FastAPI backend serving Jinja2 te
|
||||
```bash
|
||||
make install # pip install -e .
|
||||
make dev # uvicorn --reload on port 10500
|
||||
make test # 129 Playwright integration + unit tests, headless, fail-fast
|
||||
make test # Playwright integration + unit tests, headless, fail-fast
|
||||
make test-headed # same tests in visible browser
|
||||
make demo # full-journey GUI demo (headed)
|
||||
```
|
||||
@@ -44,6 +44,7 @@ devplacepy/
|
||||
templates/ # Jinja2 HTML templates
|
||||
static/css/ # Page-specific CSS files
|
||||
static/js/ # Application.js (ES6 module)
|
||||
services/ # Background service framework (base, manager, news)
|
||||
```
|
||||
|
||||
## Routes
|
||||
@@ -61,6 +62,11 @@ devplacepy/
|
||||
| `/votes` | Upvote/downvote on posts, comments, projects |
|
||||
| `/follow` | Follow/unfollow users |
|
||||
| `/avatar` | Multiavatar proxy with in-memory cache |
|
||||
| `/bugs` | Bug reports listing, creation |
|
||||
| `/services` | Background service monitoring (status, logs) |
|
||||
| `/follow` | Follow/unfollow users |
|
||||
| `/admin` | Admin panel (user management, settings) |
|
||||
| `(none)` | `/robots.txt`, `/sitemap.xml` (SEO) |
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -69,6 +75,39 @@ devplacepy/
|
||||
| `DEVPLACE_DATABASE_URL` | `sqlite:///devplace.db` | Database connection string |
|
||||
| `SECRET_KEY` | hardcoded fallback | Session signing key |
|
||||
|
||||
## Background Services
|
||||
|
||||
`devplacepy/services/` provides a generic async service framework. Services start on server boot, run at configurable intervals, and are gracefully cancelled on shutdown.
|
||||
|
||||
### Service framework
|
||||
|
||||
- **`BaseService`** — abstract class with async run loop, `deque(maxlen=20)` log buffer, `name`, `interval_seconds`
|
||||
- **`ServiceManager`** — singleton that registers, starts, and stops all services
|
||||
- **`NewsService`** — fetches news from `news.app.molodetz.nl/api`, grades with AI, stores articles >= threshold
|
||||
|
||||
### Adding a service
|
||||
|
||||
Create a class extending `BaseService`, override `run_once()`, register in `main.py`:
|
||||
```python
|
||||
service_manager.register(YourService())
|
||||
```
|
||||
The service appears at `/services` with live status and log tail.
|
||||
|
||||
### News service
|
||||
|
||||
Fetches news from a configurable API, grades each article via AI, stores those exceeding the grade threshold. Articles are never processed twice — tracked in `news_sync` table by `guid`.
|
||||
|
||||
Configuration via admin site settings:
|
||||
|
||||
| Setting key | Default | Purpose |
|
||||
|-------------|---------|---------|
|
||||
| `news_grade_threshold` | `7` | Minimum AI grade to store |
|
||||
| `news_api_url` | `https://news.app.molodetz.nl/api` | News source |
|
||||
| `news_ai_url` | `https://openai.app.molodetz.nl/v1/chat/completions` | AI grading endpoint |
|
||||
| `news_ai_model` | `molodetz` | AI model |
|
||||
|
||||
CLI: `devplace news clear` — delete all news from local database.
|
||||
|
||||
## Database
|
||||
|
||||
SQLite via `dataset` with production-oriented pragmas set on every connection:
|
||||
@@ -86,7 +125,7 @@ All indexes are created via `CREATE INDEX IF NOT EXISTS` wrapped in try/except
|
||||
|
||||
## Testing
|
||||
|
||||
- **129 tests** across 13 files: 95 Playwright integration tests + 34 unit tests
|
||||
- **148 tests** across 14 files: Playwright integration + unit tests
|
||||
- Playwright (NOT pytest-playwright plugin — conflicts, uninstall it)
|
||||
- Server starts as subprocess on port 10501 with isolated temp database
|
||||
- Test users `alice_test` / `bob_test` seeded via HTTP at session start
|
||||
@@ -112,14 +151,14 @@ Gitea Actions workflow at `.gitea/workflows/test.yaml`:
|
||||
- Runs on push/PR to main
|
||||
- Sets up Python 3.13, installs dependencies + Playwright
|
||||
- Validates all source files with `hawk`
|
||||
- Runs all 129 tests with fail-fast
|
||||
- Runs all tests with fail-fast
|
||||
- Uploads failure screenshots as artifacts
|
||||
|
||||
## Feature workflow
|
||||
|
||||
1. Implement the feature (router + template + CSS + JS)
|
||||
2. `hawk .` — validate all source files
|
||||
3. `make test` — run all 95 tests (fail-fast)
|
||||
3. `make test` — run all tests (fail-fast)
|
||||
4. Add Playwright tests in `tests/test_*.py` for new functionality
|
||||
5. For visual features: `falcon take --output /tmp/verify.png && falcon describe /tmp/verify.png`
|
||||
6. Update `AGENTS.md` and `README.md` if new conventions were introduced
|
||||
|
||||
Reference in New Issue
Block a user