This repository has been archived on 2026-02-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
giles 7b1f8a0f5e
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m42s
CI: copy sibling app models into build context for cross-domain imports
Phases 1-3 split models by domain ownership, but cross-app imports
still exist (e.g. cart imports market.models.CartItem). In Docker
each app only has its own code. The CI step now copies sibling app
model packages into the build context before docker build.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 15:01:51 +00:00

Market App

Product browsing and marketplace application for the Rose Ash cooperative.

Overview

The Market app is one of three microservices split from the original coop monolith:

  • coop (:8000) - Blog, calendar, auth, settings
  • market (:8001) - Product browsing, categories, product detail
  • cart (:8002) - Shopping cart, orders, payments

Architecture

  • Framework: Quart (async Flask)
  • Database: PostgreSQL 16 with SQLAlchemy 2.0 (async)
  • Cache: Redis (tag-based page cache)
  • Frontend: HTMX + Jinja2 + Tailwind CSS
  • Data: Products scraped from Suma Wholesale

Blueprints

  • bp/market/ - Market root (navigation, category listing)
  • bp/browse/ - Product browsing with filters and infinite scroll
  • bp/product/ - Product detail pages
  • bp/api/ - Product sync API (used by scraper)

Development

# Install dependencies
pip install -r requirements.txt

# Set environment variables
export $(grep -v '^#' .env | xargs)

# Run migrations
alembic upgrade head

# Scrape products
bash scrape.sh

# Run the dev server
hypercorn app:app --reload --bind 0.0.0.0:8001

Scraping

# Full scrape (max 50 pages, 200k products, 8 concurrent)
bash scrape.sh

# Test scraping
bash scrape-test.sh

Docker

docker build -t market .
docker run -p 8001:8000 --env-file .env market

Environment Variables

DATABASE_URL_ASYNC=postgresql+asyncpg://user:pass@localhost/coop
REDIS_URL=redis://localhost:6379/0
SECRET_KEY=your-secret-key
SUMA_USER=your-suma-username
SUMA_PASSWORD=your-suma-password
APP_URL_COOP=http://localhost:8000
APP_URL_MARKET=http://localhost:8001
APP_URL_CART=http://localhost:8002
Description
No description provided
Readme 555 KiB
Languages
Python 73.2%
HTML 26%
Shell 0.5%
Dockerfile 0.3%