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 4f90f65a8f
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m28s
Update shared submodule (adds missing alembic.ini)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 14:20:16 +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%