Tech debt cleanup: update README, fix comments, sync shared submodule
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 52s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 52s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
52
README.md
52
README.md
@@ -4,7 +4,7 @@ Product browsing and marketplace service for the Rose Ash cooperative. Displays
|
|||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
One of four Quart microservices sharing a single PostgreSQL database:
|
One of five Quart microservices sharing a single PostgreSQL database:
|
||||||
|
|
||||||
| App | Port | Domain |
|
| App | Port | Domain |
|
||||||
|-----|------|--------|
|
|-----|------|--------|
|
||||||
@@ -12,6 +12,7 @@ One of four Quart microservices sharing a single PostgreSQL database:
|
|||||||
| **market** | 8001 | Product browsing, Suma scraping |
|
| **market** | 8001 | Product browsing, Suma scraping |
|
||||||
| cart | 8002 | Shopping cart, checkout, orders |
|
| cart | 8002 | Shopping cart, checkout, orders |
|
||||||
| events | 8003 | Calendars, bookings, tickets |
|
| events | 8003 | Calendars, bookings, tickets |
|
||||||
|
| federation | 8004 | ActivityPub, fediverse social |
|
||||||
|
|
||||||
## Structure
|
## Structure
|
||||||
|
|
||||||
@@ -19,9 +20,7 @@ One of four Quart microservices sharing a single PostgreSQL database:
|
|||||||
app.py # Application factory (create_base_app + blueprints)
|
app.py # Application factory (create_base_app + blueprints)
|
||||||
path_setup.py # Adds project root + app dir to sys.path
|
path_setup.py # Adds project root + app dir to sys.path
|
||||||
config/app-config.yaml # App URLs, feature flags
|
config/app-config.yaml # App URLs, feature flags
|
||||||
models/ # Market-domain models
|
models/ # Market-domain models (+ re-export stubs)
|
||||||
market.py # Product, Category, CartItem
|
|
||||||
market_place.py # MarketPlace (page-scoped marketplace)
|
|
||||||
bp/ # Blueprints
|
bp/ # Blueprints
|
||||||
market/ # Market root, navigation, category listing
|
market/ # Market root, navigation, category listing
|
||||||
browse/ # Product browsing with filters and infinite scroll
|
browse/ # Product browsing with filters and infinite scroll
|
||||||
@@ -29,39 +28,21 @@ bp/ # Blueprints
|
|||||||
cart/ # Page-scoped cart views
|
cart/ # Page-scoped cart views
|
||||||
api/ # Product sync API (used by scraper)
|
api/ # Product sync API (used by scraper)
|
||||||
scrape/ # Suma Wholesale scraper
|
scrape/ # Suma Wholesale scraper
|
||||||
get_auth.py # Authentication
|
services/ # register_domain_services() — wires market + cart
|
||||||
listings.py # Product listing pages
|
shared/ # Submodule -> git.rose-ash.com/coop/shared.git
|
||||||
nav.py # Category navigation
|
|
||||||
product/ # Individual product scraping
|
|
||||||
build_snapshot/ # Build product snapshots
|
|
||||||
persist_snapshot/ # Save snapshots to DB
|
|
||||||
persist_api/ # Save via API
|
|
||||||
templates/ # Jinja2 templates
|
|
||||||
entrypoint.sh # Docker entrypoint
|
|
||||||
Dockerfile
|
|
||||||
shared/ # Submodule → git.rose-ash.com/coop/shared.git
|
|
||||||
glue/ # Submodule → git.rose-ash.com/coop/glue.git
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Dependencies
|
## Cross-Domain Communication
|
||||||
|
|
||||||
**Cross-app model imports:**
|
- `services.cart.*` — cart summary via CartService protocol
|
||||||
- `blog.models.ghost_content.Post` — `app.py` hydrates page data for marketplace views
|
- `services.federation.*` — AP publishing via FederationService protocol
|
||||||
|
- `shared.services.navigation` — site navigation tree
|
||||||
**Glue services:**
|
|
||||||
- `glue.services.navigation.get_navigation_tree` — context processor builds site nav
|
|
||||||
|
|
||||||
**Internal APIs:**
|
|
||||||
- Calls `GET /internal/cart/summary` — context processor for cart widget
|
|
||||||
|
|
||||||
## Scraping
|
## Scraping
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Full scrape (Suma Wholesale catalogue)
|
bash scrape.sh # Full Suma Wholesale catalogue
|
||||||
bash scrape.sh
|
bash scrape-test.sh # Limited test scrape
|
||||||
|
|
||||||
# Test scraping (limited)
|
|
||||||
bash scrape-test.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
@@ -70,15 +51,6 @@ bash scrape-test.sh
|
|||||||
export DATABASE_URL_ASYNC=postgresql+asyncpg://user:pass@localhost/coop
|
export DATABASE_URL_ASYNC=postgresql+asyncpg://user:pass@localhost/coop
|
||||||
export REDIS_URL=redis://localhost:6379/0
|
export REDIS_URL=redis://localhost:6379/0
|
||||||
export SECRET_KEY=your-secret-key
|
export SECRET_KEY=your-secret-key
|
||||||
export SUMA_USER=your-suma-username
|
|
||||||
export SUMA_PASSWORD=your-suma-password
|
|
||||||
|
|
||||||
hypercorn app:app --reload --bind 0.0.0.0:8001
|
hypercorn app:app --bind 0.0.0.0:8001
|
||||||
```
|
|
||||||
|
|
||||||
## Docker
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker build -t market .
|
|
||||||
docker run -p 8001:8000 --env-file .env market
|
|
||||||
```
|
```
|
||||||
|
|||||||
2
app.py
2
app.py
@@ -1,5 +1,5 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
import path_setup # noqa: F401 # adds shared_lib to sys.path
|
import path_setup # noqa: F401 # adds shared/ to sys.path
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|||||||
2
shared
2
shared
Submodule shared updated: bccfff0c69...d697709f60
Reference in New Issue
Block a user