How csci-ga-2820-fa26-001/wishlists works
This repository is a Flask wishlist-service starter template, with a small implemented REST workflow rather than a complete product API. A client posts a wishlist; the route parses and validates it, checks for an existing customer/name pair, persists it, and returns serialized JSON. The models represent wishlists and their items, backed by SQLAlchemy. App setup configures the database, routes, error handlers, CLI command, and logging. The README describes a starter skeleton; the source excerpts show only wishlist creation, so other CRUD endpoints are not inferred.
Main entry points: __init__.py Flask setup · routes.py Wishlist routes · wishlist.py Wishlist model · persistent_base.py Persistence base
Components 13
Application runtime
- WSGI entry
wsgi.py - Flask setup
service/__init__.py - App configuration
service/config.py - Logging setup
service/common/log_handlers.py - DB CLI
service/common/cli_commands.py
HTTP service
- Wishlist routes
service/routes.py - Error handlers
service/common/error_handlers.py - HTTP statuses
service/common/status.py
Wishlist domain
- Wishlist model
service/models/wishlist.py - Wishlist item
service/models/item.py - Persistence base
service/models/persistent_base.py
Other components
- API client
- SQL database
Connections 16
- API client → WSGI entry: sends requests
- WSGI entry → Flask setup: creates app
wsgi.py - Flask setup → App configuration: loads settings
service/__init__.py - Flask setup → Logging setup: initializes logging
service/__init__.py - Flask setup → Wishlist routes: imports routes
service/__init__.py - Flask setup → Error handlers: registers handlers
service/__init__.py - Flask setup → DB CLI: registers command
service/__init__.py - Flask setup → SQL database: creates tables
service/__init__.py - Wishlist routes → Wishlist model: queries and saves
service/routes.py - Wishlist routes → HTTP statuses: sets response codes
service/routes.py - Error handlers → HTTP statuses: uses codes
service/common/error_handlers.py - Wishlist model → Persistence base: inherits CRUD
service/models/wishlist.py - Wishlist item → Persistence base: inherits CRUD
service/models/item.py - Wishlist model → Wishlist item: serializes related items
service/models/wishlist.py - Persistence base → SQL database: commits records
service/models/persistent_base.py - DB CLI → SQL database: recreates tables
service/common/cli_commands.py