mycopunk-swag-store/README.md

106 lines
2.3 KiB
Markdown

# Mycopunk Swag Store
E-commerce platform for mycopunk merchandise at **swag.mycofi.earth**
## Stack
- **Frontend**: Next.js 15 + shadcn/ui + Tailwind CSS
- **Backend**: FastAPI + SQLAlchemy + Alembic
- **Database**: PostgreSQL
- **Payments**: Stripe Checkout
- **Fulfillment**: Printful (apparel) + Prodigi (stickers/prints)
## Architecture
```
swag.mycofi.earth
Cloudflare Tunnel → Traefik
│ │
▼ ▼
Next.js (3000) FastAPI (8000)
┌───────────────┼───────────────┐
▼ ▼ ▼
PostgreSQL Stripe POD APIs
```
## Development
### Prerequisites
- Docker & Docker Compose
- Python 3.12+
- Node.js 20+
- pnpm
### Quick Start
```bash
# Clone and setup
cd /home/jeffe/Github/mycopunk-swag-store
cp .env.example .env
# Edit .env with your API keys
# Start services
docker compose up -d
# Backend available at http://localhost:8000
# Frontend available at http://localhost:3000
```
### Local Development (without Docker)
```bash
# Backend
cd backend
pip install -e .
uvicorn app.main:app --reload
# Frontend
cd frontend
pnpm install
pnpm dev
```
## Project Structure
```
mycopunk-swag-store/
├── 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
```
## Environment Variables
See `.env.example` for required configuration.
## Deployment
Deployed on Netcup RS 8000 via Docker Compose with Traefik reverse proxy.
```bash
# On server
cd /opt/mycopunk-swag-store
git pull
docker compose up -d --build
```
## Links
- [Stripe Dashboard](https://dashboard.stripe.com)
- [Printful API Docs](https://developers.printful.com/docs/)
- [Prodigi API Docs](https://www.prodigi.com/print-api/docs/)