How dharanidh75/croonfit works
Purpose and Top-Level Entry Points
Croonfit is a full-stack apparel-commerce application with a customer storefront, checkout/order flows, wishlist, and a separate admin interface. The frontend boots through croonfit_web/frontend/src/main.jsx and composes routes/application state in croonfit_web/frontend/src/App.jsx. The backend API application is entered at croonfit_web/backend/app/main.py.
Storefront Presentation and Navigation
The customer-facing SPA organizes commerce and marketing pages—home, listings/categories, product detail, cart, checkout, account, orders, and wishlist—under croonfit_web/frontend/src/pages. Reusable product presentation and selection behavior sit behind page boundaries in croonfit_web/frontend/src/components/product/ProductCard.jsx, croonfit_web/frontend/src/components/product/ProductGallery.jsx, and croonfit_web/frontend/src/components/product/SizeSelector.jsx. Catalogue imagery is served from croonfit_web/frontend/public/images/catalogue.
Frontend State and API Boundary
The frontend’s API integration is centralized in croonfit_web/frontend/src/lib/api.js; this is the primary boundary between browser UI/state and backend HTTP endpoints. Client-side shared state is rooted at croonfit_web/frontend/src/store/index.js. Checkout-specific UI collects customer/payment inputs and constructs order context through croonfit_web/frontend/src/components/checkout/CheckoutForm.jsx and croonfit_web/frontend/src/components/checkout/PaymentForm.jsx.
Backend API and Domain Services
The Python backend exposes domain-oriented API modules for authentication, catalog, orders, payments, wishlist, and administration: croonfit_web/backend/app/api/auth.py, croonfit_web/backend/app/api/products.py, and croonfit_web/backend/app/api/orders.py. croonfit_web/backend/app/config.py holds application configuration, while croonfit_web/backend/app/core/security.py and croonfit_web/backend/app/core/admin_auth.py establish customer/admin security boundaries. A payments endpoint exists at croonfit_web/backend/app/api/payments.py; no specific payment provider is identifiable from the tree.
Persistence and Business Data
Persistent business entities are modeled separately for users, products, orders, wishlists, and admins, including croonfit_web/backend/app/models/user.py, croonfit_web/backend/app/models/product.py, and croonfit_web/backend/app/models/order.py. The database access boundary is croonfit_web/backend/app/database.py; the committed croonfit_web/backend/croonfit.db indicates SQLite is the current material datastore. API payload contracts are represented in schema modules such as croonfit_web/backend/app/schemas/product.py and croonfit_web/backend/app/schemas/order.py. croonfit_web/backend/seed.py is the apparent catalog/data bootstrap path.
Administrative Surface
Administration is a distinct frontend area with protected routing/layout and operational pages for dashboard, products, orders, inventory, customers, billing, analytics, CMS, and discounts. Its primary shell and authorization gate are croonfit_web/frontend/src/components/admin/AdminLayout.jsx and croonfit_web/frontend/src/components/admin/AdminProtectedRoute.jsx; product management flows are under croonfit_web/frontend/src/pages/admin/AdminProducts.jsx and croonfit_web/frontend/src/pages/admin/products/ProductForm.jsx. This surface depends on the backend’s separate admin authentication and admin API boundary.
Runtime and Asset Pipeline
The browser application is a Vite-based React frontend, evidenced by croonfit_web/frontend/package.json and croonfit_web/frontend/vite.config.js. The backend is Python with dependencies declared in croonfit_web/backend/requirements.txt. An input apparel catalogue PDF, Croon.fit - Blank Apparel Catalogue Oct 25.pdf, plus croonfit_web/frontend/extract_images.py, suggests a local asset-extraction workflow that populates storefront catalogue images rather than an external product-information service.
Main entry points: pages Commerce pages · App.jsx App routes and state composition · api.js Frontend API client · main.py API application
Components 19
Customer storefront
- React bootstrap
croonfit_web/frontend/src/main.jsx - App routes and state composition
croonfit_web/frontend/src/App.jsx - Commerce pages · Home, catalogue, product, cart, checkout, account, orders, and wishlist.
croonfit_web/frontend/src/pages - Product presentation
croonfit_web/frontend/src/components/product/ProductCard.jsx - Checkout and payment forms
croonfit_web/frontend/src/components/checkout/CheckoutForm.jsx - Client shared state
croonfit_web/frontend/src/store/index.js - Frontend API client
croonfit_web/frontend/src/lib/api.js
Admin surface
- Admin protected shell
croonfit_web/frontend/src/components/admin/AdminLayout.jsx - Admin product management
croonfit_web/frontend/src/pages/admin/AdminProducts.jsx
Backend API
- API application
croonfit_web/backend/app/main.py - Customer commerce APIs · Authentication, products, orders, payments, and wishlist endpoints.
croonfit_web/backend/app/api/products.py - Admin API security · Separates administrator access from customer authentication.
croonfit_web/backend/app/core/admin_auth.py - Commerce domain models · Users, products, orders, wishlists, and admins.
croonfit_web/backend/app/models/product.py - API payload schemas
croonfit_web/backend/app/schemas/product.py
Data and assets
- Database access
croonfit_web/backend/app/database.py - Croonfit SQLite database
croonfit_web/backend/croonfit.db - Catalogue images
croonfit_web/frontend/public/images/catalogue - Catalogue asset extraction · Extracts imagery from the supplied apparel catalogue PDF.
croonfit_web/frontend/extract_images.py - Catalog data bootstrap
croonfit_web/backend/seed.py
Connections 21
- React bootstrap → App routes and state composition: mounts
- App routes and state composition → Commerce pages: routes to
- App routes and state composition → Client shared state: uses
- Commerce pages → Product presentation: renders
- Commerce pages → Checkout and payment forms: uses
- Commerce pages → Frontend API client: loads and mutates data
- Checkout and payment forms → Frontend API client: submits orders and payments
- Frontend API client → API application: HTTP requests
- App routes and state composition → Admin protected shell: hosts admin routes
- Admin protected shell → Admin product management: protects
- Admin product management → Frontend API client: manages via
- API application → Customer commerce APIs: serves
- API application → Admin API security: enforces admin access
- Customer commerce APIs → API payload schemas: validates payloads
- Customer commerce APIs → Commerce domain models: operates on
- Admin API security → Commerce domain models: authorizes administration
- Commerce domain models → Database access: persists through
- Database access → Croonfit SQLite database: reads and writes
- Catalog data bootstrap → Database access: initializes
- Catalogue asset extraction → Catalogue images: populates
- Commerce pages → Catalogue images: serves product imagery