Tech debt cleanup: update README, fix comments, sync shared submodule
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 50s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 50s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
40
README.md
40
README.md
@@ -4,7 +4,7 @@ Calendar and event booking service for the Rose Ash cooperative platform. Manage
|
||||
|
||||
## Architecture
|
||||
|
||||
One of four Quart microservices sharing a single PostgreSQL database:
|
||||
One of five Quart microservices sharing a single PostgreSQL database:
|
||||
|
||||
| App | Port | Domain |
|
||||
|-----|------|--------|
|
||||
@@ -12,6 +12,7 @@ One of four Quart microservices sharing a single PostgreSQL database:
|
||||
| market | 8001 | Product browsing, Suma scraping |
|
||||
| cart | 8002 | Shopping cart, checkout, orders |
|
||||
| **events** | 8003 | Calendars, bookings, tickets |
|
||||
| federation | 8004 | ActivityPub, fediverse social |
|
||||
|
||||
## Structure
|
||||
|
||||
@@ -19,7 +20,6 @@ One of four Quart microservices sharing a single PostgreSQL database:
|
||||
app.py # Application factory (create_base_app + blueprints)
|
||||
path_setup.py # Adds project root + app dir to sys.path
|
||||
config/app-config.yaml # App URLs, feature flags
|
||||
events_api.py # Internal API (/internal/events/*)
|
||||
models/ # Events-domain models
|
||||
calendars.py # Calendar, CalendarEntry, CalendarSlot,
|
||||
# TicketType, Ticket, CalendarEntryPost
|
||||
@@ -37,11 +37,8 @@ bp/ # Blueprints
|
||||
ticket_admin/ # Ticket administration
|
||||
markets/ # Page-scoped marketplace views
|
||||
payments/ # Payment-related views
|
||||
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
|
||||
services/ # register_domain_services() — wires calendar + market + cart
|
||||
shared/ # Submodule -> git.rose-ash.com/coop/shared.git
|
||||
```
|
||||
|
||||
## Models
|
||||
@@ -57,26 +54,18 @@ All events-domain models live in `models/calendars.py`:
|
||||
| **Ticket** | Individual ticket with unique code, state, and `order_id` (plain integer, no FK) |
|
||||
| **CalendarEntryPost** | Junction linking entries to content via `content_type + content_id` |
|
||||
|
||||
`order_id` on CalendarEntry and Ticket is a plain integer column — no FK constraint to the orders table. The cart app writes these values via glue services (`order_lifecycle.py`), not directly.
|
||||
`order_id` on CalendarEntry and Ticket is a plain integer column — no FK constraint to the orders table. The cart app writes these values via service calls, not directly.
|
||||
|
||||
## Dependencies
|
||||
## Cross-Domain Communication
|
||||
|
||||
**Cross-app model imports:**
|
||||
- `blog.models.ghost_content.Post` — `app.py` context processor, calendar/market services for page hydration
|
||||
- `market.models.market_place.MarketPlace` — `app.py` context processor, marketplace views
|
||||
- `cart.models.page_config.PageConfig` — `bp/payments/routes.py` for per-page SumUp config
|
||||
|
||||
**Glue services:**
|
||||
- `glue.services.relationships.attach_child / detach_child` — calendar and marketplace services manage page associations
|
||||
- `glue.services.navigation.get_navigation_tree` — context processor builds site nav
|
||||
|
||||
**Internal APIs:**
|
||||
- Calls `GET /internal/cart/summary` — context processor for cart widget
|
||||
- Exposes `/internal/events/*` via `events_api.py` — serves calendar data to other apps
|
||||
- `services.market.*` — marketplace queries for page views
|
||||
- `services.cart.*` — cart summary for context processor
|
||||
- `services.federation.*` — AP publishing for new entries
|
||||
- `shared.services.navigation` — site navigation tree
|
||||
|
||||
## Migrations
|
||||
|
||||
This app does **not** run Alembic migrations on startup. Migrations are managed in the `shared/` submodule and run from the blog app's entrypoint. The events app's `entrypoint.sh` skips the migration step.
|
||||
This app does **not** run Alembic migrations on startup. Migrations are managed in the `shared/` submodule and run from the blog app's entrypoint.
|
||||
|
||||
## Running
|
||||
|
||||
@@ -87,10 +76,3 @@ export SECRET_KEY=your-secret-key
|
||||
|
||||
hypercorn app:app --bind 0.0.0.0:8003
|
||||
```
|
||||
|
||||
## Docker
|
||||
|
||||
```bash
|
||||
docker build -t events .
|
||||
docker run -p 8003:8000 --env-file .env events
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user