How eshaabbasi/weasleyswizard_backend works
Weasleys’ Wizard Wheezes is a FastAPI marketplace backend for customers, shop owners, and admins. Customers authenticate, browse products from approved shops, and can review or favorite products; checkout validates stock and discounts, creates an order, and updates inventory. Owners manage shops and products and fulfill orders, while admins oversee shops, products, orders, and reviews. The map includes API routing, authorization, domain models, and persistence. Some subsystem links are supported by README descriptions or SOURCE INDEX references; unsampled implementations are not inferred beyond those sources.
Main entry points: main.py FastAPI application · orders.py Checkout and orders · reviews.py Reviews and favorites · database.py Database sessions
Components 21
API and access
- FastAPI application
main.py - Accounts
controllers/users.py - Token authentication
dependencies/get_current_user.py - Role authorization
dependencies/require_role.py - Request and response schemas
serializers
Marketplace workflows
- Shop administration
controllers/shops.py - Product catalog
controllers/products.py - Checkout and orders
controllers/orders.py - Reviews and favorites
controllers/reviews.py
Domain and persistence
- Database sessions
database.py - Environment settings
config/environment.py - Model base
models/base.py - User records
models/user.py - Shop records
models/shop.py - Product records
models/product.py - Order records
models/order.py - Order item records
models/item.py - Review records
models/review.py
Media integration
- Image uploads
controllers/uploads.py - Cloudinary
Other components
- Marketplace users
Connections 47
- Marketplace users → FastAPI application: uses API
README.md - FastAPI application → Accounts: routes to
main.py - FastAPI application → Shop administration: routes to
main.py - FastAPI application → Product catalog: routes to
main.py - FastAPI application → Checkout and orders: routes to
main.py - FastAPI application → Reviews and favorites: routes to
main.py - FastAPI application → Image uploads: routes to
main.py - Accounts → Database sessions: uses sessions
controllers/users.py - Accounts → User records: queries users
controllers/users.py - Shop administration → Database sessions: uses sessions
controllers/shops.py - Shop administration → Shop records: queries shops
controllers/shops.py - Shop administration → User records: checks owners
controllers/shops.py - Product catalog → Database sessions: uses sessions
controllers/products.py - Product catalog → Product records: queries products
controllers/products.py - Product catalog → Shop records: checks shops
controllers/products.py - Checkout and orders → Database sessions: uses sessions
controllers/orders.py - Checkout and orders → Order records: creates orders
controllers/orders.py - Checkout and orders → Order item records: creates items
controllers/orders.py - Checkout and orders → Product records: checks stock
controllers/orders.py - Checkout and orders → Shop records: filters shop orders
controllers/orders.py - Reviews and favorites → Database sessions: uses sessions
controllers/reviews.py - Reviews and favorites → Review records: reads and writes
controllers/reviews.py - Reviews and favorites → Product records: checks products
controllers/reviews.py - Reviews and favorites → User records: checks reviewers
controllers/reviews.py - Accounts → Request and response schemas: uses schemas
controllers/users.py - Shop administration → Request and response schemas: uses schemas
controllers/shops.py - Product catalog → Request and response schemas: uses schemas
controllers/products.py - Checkout and orders → Request and response schemas: uses schemas
controllers/orders.py - Reviews and favorites → Request and response schemas: uses schemas
controllers/reviews.py - Accounts → Role authorization: checks access
- Shop administration → Role authorization: checks access
controllers/shops.py - Product catalog → Role authorization: checks access
controllers/products.py - Checkout and orders → Role authorization: checks access
controllers/orders.py - Reviews and favorites → Role authorization: checks access
controllers/reviews.py - Role authorization → Token authentication: requires user
dependencies/require_role.py - Token authentication → Database sessions: loads user
dependencies/get_current_user.py - Token authentication → User records: queries user
dependencies/get_current_user.py - Database sessions → Environment settings: reads database URL
database.py - User records → Environment settings: reads token secret
models/user.py - FastAPI application → Model base: creates tables
main.py - User records → Model base: extends model base
models/user.py - Shop records → Model base: extends model base
models/shop.py - Product records → Model base: extends model base
models/product.py - Order records → Model base: extends model base
models/order.py - Order item records → Model base: extends model base
models/item.py - Review records → Model base: extends model base
models/review.py - Image uploads → Cloudinary: uploads images
README.md