Merch store for the rSpace ecosystem
Go to file
Jeff Emmett 7be99d37d0 feat: add multi-tenant spaces with Fungi Flows storefront
Add subdomain-based spaces system for branded storefronts. Each space
has its own theme, product catalog, and isolated cart via scoped
localStorage keys.

- Backend: SpaceService loads YAML configs, new /api/spaces endpoints,
  design filtering by space, CORS regex for *.rswag.online
- Frontend: Next.js middleware detects subdomain and sets space_id cookie,
  dynamic CSS variable injection for theming, space-aware API calls
- Spaces: _default (rSwag hub, cyan/orange) and fungiflows (gold/green/purple)
- Docker: Traefik wildcard HostRegexp for subdomain routing
- Designs: Placeholder Fungi Flows sticker and logo tee

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 12:20:19 -07:00
backend feat: add multi-tenant spaces with Fungi Flows storefront 2026-02-18 12:20:19 -07:00
config Initial commit: rSwag - merch store for the rSpace ecosystem 2026-02-18 03:24:22 -07:00
designs feat: add multi-tenant spaces with Fungi Flows storefront 2026-02-18 12:20:19 -07:00
frontend feat: add multi-tenant spaces with Fungi Flows storefront 2026-02-18 12:20:19 -07:00
spaces feat: add multi-tenant spaces with Fungi Flows storefront 2026-02-18 12:20:19 -07:00
.env.example security: remove real SMTP host/user from .env.example 2026-02-18 12:11:02 -07:00
.gitignore Initial commit: rSwag - merch store for the rSpace ecosystem 2026-02-18 03:24:22 -07:00
CLAUDE.md feat: add multi-tenant spaces with Fungi Flows storefront 2026-02-18 12:20:19 -07:00
README.md Initial commit: rSwag - merch store for the rSpace ecosystem 2026-02-18 03:24:22 -07:00
docker-compose.dev.yml feat: add multi-tenant spaces with Fungi Flows storefront 2026-02-18 12:20:19 -07:00
docker-compose.prod.yml feat: add multi-tenant spaces with Fungi Flows storefront 2026-02-18 12:20:19 -07:00
docker-compose.yml feat: add multi-tenant spaces with Fungi Flows storefront 2026-02-18 12:20:19 -07:00

README.md

rSwag

Merchandise store for the rSpace ecosystem at rswag.online

Stack

  • Frontend: Next.js 15 + shadcn/ui + Tailwind CSS + Geist font
  • Backend: FastAPI + SQLAlchemy + Alembic
  • Database: PostgreSQL
  • Payments: Stripe Checkout
  • Fulfillment: Printful (apparel) + Prodigi (stickers/prints)
  • AI Design: Gemini API for on-demand design generation

Architecture

rswag.online
        │
        ▼
  Cloudflare Tunnel → Traefik
        │                │
        ▼                ▼
   Next.js (3000)   FastAPI (8000)
                         │
         ┌───────────────┼───────────────┐
         ▼               ▼               ▼
    PostgreSQL       Stripe          POD APIs

Development

Quick Start

cp .env.example .env
# Edit .env with your API keys

docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d

# Backend: http://localhost:8000
# Frontend: http://localhost:3000

Local Development (without Docker)

# Backend
cd backend
pip install -e .
uvicorn app.main:app --reload

# Frontend
cd frontend
pnpm install
pnpm dev

Project Structure

rswag/
├── backend/              # FastAPI Python backend
│   ├── app/
│   │   ├── api/         # Route handlers
│   │   ├── models/      # SQLAlchemy ORM
│   │   ├── schemas/     # Pydantic models
│   │   ├── services/    # Business logic
│   │   └── pod/         # POD provider clients
│   └── alembic/         # Database migrations
├── frontend/             # Next.js 15 frontend
│   ├── app/             # App Router pages
│   ├── components/      # React components
│   └── lib/             # Utilities
├── designs/              # Design assets (in-repo)
│   ├── stickers/
│   ├── shirts/
│   └── misc/
└── config/               # POD provider config

Deployment

Deployed on Netcup RS 8000 via Docker Compose with Traefik reverse proxy.

ssh netcup "cd /opt/apps/rswag && git pull && docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build"