A B2B2C SaaS platform for pet information management via QR codes. Pet owners scan a QR tag to view their pet's profile, contact the owner, and share a safe meeting location — no app required.
Built with a multi-tenant architecture to support multiple pet shops and brands on a single deployment.
- QR-based pet profiles — scan a tag to view name, breed, medical info, and owner contact
- PIN-protected access — dual-verification before revealing contact details
- Location sharing — suggest public meeting spots (schools, cafes, transit) without exposing home address, powered by OpenStreetMap
- Multi-tenant SaaS — each pet shop gets its own branded subdomain and schema-isolated database
- Tier 1 / Tier 2 tenants — dedicated RDS instance (enterprise) vs. shared schema isolation (standard)
- Bilingual UI — English and Chinese, runtime switchable
- Dark mode — full system-preference detection and persistence
| Layer | Stack |
|---|---|
| Backend | Python · FastAPI · SQLModel · Alembic · PostgreSQL 15 |
| Frontend | React 18 · TypeScript · Vite · Tailwind CSS · Zustand · TanStack Query |
| Auth | JWT + Refresh Token · bcrypt |
| Cloud | AWS (S3 · SES · CloudFront) |
| Maps | Leaflet · OpenStreetMap Overpass API |
| DevOps | Docker · Docker Compose · Redis 7 |
┌─────────────────────────────────────┐
│ Multi-Tenant Router │
│ (subdomain → tenant schema lookup) │
└──────────┬──────────────────────────┘
│
┌──────▼──────┐ ┌─────────────┐
│ FastAPI │────▶│ PostgreSQL │
│ Backend │ │ shared + │
│ :8000 │ │ tenant_* │
└──────┬──────┘ │ schemas │
│ └─────────────┘
┌──────▼──────┐ ┌─────────────┐
│ React SPA │ │ Redis │
│ Frontend │ │ (tenant │
│ :3000 │ │ cache) │
└─────────────┘ └─────────────┘
Database schema strategy:
sharedschema → tenant registry, global userstenant_{name}schema → per-tenant pets, QR codes, users (full isolation)
- Docker & Docker Compose
- Node.js 18+
- Python 3.11+
git clone https://github.com/pintaste/Pet-QR-App.git
cd Pet-QR-App
cp .env.example .env
# Edit .env — set DATABASE_URL, SECRET_KEY, and AWS credentialsdocker-compose up -d postgres rediscd backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
alembic upgrade head
uvicorn app.main:app --reload --port 8000cd frontend
npm install
npm run devPet-QR-App/
├── backend/
│ ├── app/
│ │ ├── api/routes/ # Auth, pets, QR codes, tenant admin, super admin
│ │ ├── core/ # Config, security, dependencies
│ │ ├── models/ # SQLModel ORM models
│ │ ├── services/ # Business logic
│ │ └── middleware/ # Tenant routing middleware
│ ├── migrations/ # Alembic migration history
│ └── tests/ # pytest test suite
├── frontend/
│ └── src/
│ ├── components/ # Reusable UI components
│ ├── pages/ # Route pages
│ ├── hooks/ # Custom React hooks
│ ├── services/ # API client layer
│ └── stores/ # Zustand state
├── shared/ # Shared TypeScript types + Zod schemas
├── docs/ # Architecture and deployment docs
└── docker-compose.yml
MIT