How sarthakdasari/codealpha_kartly works
Kartly is a Flask/SQLite storefront. Shoppers browse and inspect products, register or log in, manage a session-backed cart, submit a cash-on-delivery order, and review order history. The browser modules call JSON endpoints through a shared CSRF-aware API client; Flask handles the domain operations and SQLite persists catalog, user, cart, and order data. The README documents category browsing, account, cart, COD, and order-history capabilities. Some template and route details are unsampled, so those links rely on the shown app excerpt or README rather than assumed implementation details.
Main entry points: api.js API client · app.py Flask app · schema.sql SQLite store · database.py Database layer
Components 20
Storefront browser
- Page views
templates - Shared UI
static/js/common.js - API client
static/js/api.js - Product browsing
static/js/products.js - Product details
static/js/product.js - Account access
static/js/auth.js - Cart management
static/js/cart.js - COD checkout
static/js/checkout.js - Account profile
static/js/account.js - Order history
static/js/orders.js
Flask services
- Flask app
app.py - Catalog endpoints
app.py - Identity endpoints
app.py - Cart endpoints
app.py - Order endpoints
app.py
SQLite persistence
- Database layer
database.py - SQLite store
schema.sql - Catalog seed
seed.py
Runtime setup
- App configuration
config.py
Other components
- Shopper
Connections 23
- Shopper → Page views: opens pages
- Page views → Shared UI: loads scripts
- Shared UI → API client: requests identity
static/js/common.js - Product browsing → API client: fetches catalog
static/js/products.js - Product details → API client: fetches product
static/js/product.js - Account access → API client: submits credentials
static/js/auth.js - Cart management → API client: updates cart
static/js/cart.js - COD checkout → API client: places order
static/js/checkout.js - Account profile → API client: uses API
- Order history → API client: uses API
- API client → Flask app: sends requests
static/js/api.js - Flask app → App configuration: loads settings
app.py - Flask app → Database layer: initializes database
app.py - Flask app → Catalog endpoints: routes catalog
app.py - Flask app → Identity endpoints: routes identity
app.py - Flask app → Cart endpoints: routes cart
app.py - Flask app → Order endpoints: routes orders
app.py - Catalog endpoints → SQLite store: queries catalog
app.py - Identity endpoints → SQLite store: reads users
app.py - Cart endpoints → SQLite store: reads and writes
app.py - Order endpoints → SQLite store: records orders
app.py - Database layer → SQLite store: creates schema
database.py - Database layer → Catalog seed: seeds catalog
database.py