Update app READMEs for monorepo
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m56s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m56s
Remove stale submodule references, port numbers, and Running sections. Add fragment composition details. Create READMEs for federation and account. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,28 +2,13 @@
|
||||
|
||||
Calendar and event booking service for the Rose Ash cooperative platform. Manages calendars, time slots, calendar entries (bookings), tickets, and ticket types.
|
||||
|
||||
## Architecture
|
||||
|
||||
One of five Quart microservices sharing a single PostgreSQL database:
|
||||
|
||||
| App | Port | Domain |
|
||||
|-----|------|--------|
|
||||
| blog (coop) | 8000 | Auth, blog, admin, menus, snippets |
|
||||
| market | 8001 | Product browsing, Suma scraping |
|
||||
| cart | 8002 | Shopping cart, checkout, orders |
|
||||
| **events** | 8003 | Calendars, bookings, tickets |
|
||||
| federation | 8004 | ActivityPub, fediverse social |
|
||||
|
||||
## Structure
|
||||
|
||||
```
|
||||
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
|
||||
models/ # Events-domain models
|
||||
calendars.py # Calendar, CalendarEntry, CalendarSlot,
|
||||
# TicketType, Ticket, CalendarEntryPost
|
||||
bp/ # Blueprints
|
||||
entrypoint.sh # Container entrypoint (Redis flush, start)
|
||||
bp/
|
||||
calendars/ # Calendar listing
|
||||
calendar/ # Single calendar view and admin
|
||||
calendar_entries/ # Calendar entries listing
|
||||
@@ -37,18 +22,20 @@ bp/ # Blueprints
|
||||
ticket_admin/ # Ticket administration
|
||||
markets/ # Page-scoped marketplace views
|
||||
payments/ # Payment-related views
|
||||
fragments/ # container-nav, container-cards fragments
|
||||
models/ # Re-export stubs (Calendar, CalendarEntry, Ticket, etc.)
|
||||
services/ # register_domain_services() — wires calendar + market + cart
|
||||
shared/ # Submodule -> git.rose-ash.com/coop/shared.git
|
||||
templates/ # Events-specific templates (override shared/)
|
||||
```
|
||||
|
||||
## Models
|
||||
|
||||
All events-domain models live in `models/calendars.py`:
|
||||
All events-domain models live in `shared/models/`:
|
||||
|
||||
| Model | Description |
|
||||
|-------|-------------|
|
||||
| **Calendar** | Container for entries, scoped to a page via `container_type + container_id` |
|
||||
| **CalendarEntry** | A bookable event/time slot. Has `state` (pending/ordered/provisional), `cost`, ownership (`user_id`/`session_id`), and `order_id` (plain integer, no FK) |
|
||||
| **CalendarEntry** | A bookable event/time slot with state (pending/ordered/provisional) and cost |
|
||||
| **CalendarSlot** | Recurring time bands (day-of-week + time range) within a calendar |
|
||||
| **TicketType** | Named ticket categories with price and count |
|
||||
| **Ticket** | Individual ticket with unique code, state, and `order_id` (plain integer, no FK) |
|
||||
@@ -56,23 +43,13 @@ All events-domain models live in `models/calendars.py`:
|
||||
|
||||
`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.
|
||||
|
||||
## Cross-Domain Communication
|
||||
## Cross-domain communication
|
||||
|
||||
- `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
|
||||
## Fragments served
|
||||
|
||||
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
|
||||
|
||||
```bash
|
||||
export DATABASE_URL_ASYNC=postgresql+asyncpg://user:pass@localhost/coop
|
||||
export REDIS_URL=redis://localhost:6379/0
|
||||
export SECRET_KEY=your-secret-key
|
||||
|
||||
hypercorn app:app --bind 0.0.0.0:8003
|
||||
```
|
||||
- **container-nav** — calendar entries + links for blog sidebar
|
||||
- **container-cards** — event cards for blog listing pages
|
||||
|
||||
Reference in New Issue
Block a user