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.
478636f799f3160c7871eb3fdc2b8cb36e7e5b2a
Phase 1-3 of decoupling: - path_setup.py adds project root to sys.path - Market-owned models in market/models/ (market, market_place) - All imports updated: shared.infrastructure, shared.db, shared.browser, etc. - MarketPlace uses container_type/container_id instead of post_id FK Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 scrollbp/product/- Product detail pagesbp/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
Languages
Python
73.2%
HTML
26%
Shell
0.5%
Dockerfile
0.3%