How slmakomazi/autospares works
Autospares is a parts-catalog storefront backed by Sanity CMS. A visitor browses products; the Angular app loads catalog data through SanityService, then supports text search and filtering by category, parts brand, vehicle fitment, and price, with fallback data if loading fails. The Studio defines the content types editors use to maintain that catalog. The sampled code shows the app-to-service fetch calls and schema definitions; the storefront template and Studio configuration were not excerpted, so their internal wiring is limited to relationships indicated by the source index.
Main entry points: index.ts Schema registry · sanity.ts Sanity fetch service · product.ts Product schema · app.ts Catalog UI and filters
Components 15
Storefront
- Catalog UI and filters
web/src/app/app.ts - Angular bootstrap
web/src/main.ts - App configuration
web/src/app/app.config.ts - Sanity fetch service
web/src/app/services/sanity.ts - Sanity connection settings
web/src/environments/environment.ts
Catalog Data
- Catalog data types
web/src/app/models/spares.model.ts
Sanity CMS
- Schema registry
studio/schemaTypes/index.ts - Product schema
studio/schemaTypes/product.ts - Category schema
studio/schemaTypes/category.ts - Brand schema
studio/schemaTypes/brand.ts - Vehicle model schema
studio/schemaTypes/carModel.ts - Block content schema
studio/schemaTypes/blockContent.ts - Studio configuration
studio/sanity.config.ts
Other components
- Catalog visitor
- Sanity platform
Connections 18
- Catalog visitor → Catalog UI and filters: browses catalog
- Angular bootstrap → App configuration: loads config
web/src/main.ts - Angular bootstrap → Catalog UI and filters: bootstraps
web/src/main.ts - Catalog UI and filters → Sanity fetch service: requests catalog
web/src/app/app.ts - Catalog UI and filters → Catalog data types: uses types
web/src/app/app.ts - Sanity fetch service → Catalog data types: types results
web/src/app/services/sanity.ts - Sanity fetch service → Sanity connection settings: reads settings
web/src/app/services/sanity.ts - Sanity fetch service → Sanity platform: fetches records
web/src/app/services/sanity.ts - Studio configuration → Schema registry: registers schemas
studio/sanity.config.ts - Schema registry → Product schema: includes schema
studio/schemaTypes/index.ts - Schema registry → Category schema: includes schema
studio/schemaTypes/index.ts - Schema registry → Brand schema: includes schema
studio/schemaTypes/index.ts - Schema registry → Vehicle model schema: includes schema
studio/schemaTypes/index.ts - Schema registry → Block content schema: includes schema
studio/schemaTypes/index.ts - Product schema → Category schema: references category
studio/schemaTypes/product.ts - Product schema → Brand schema: references brand
studio/schemaTypes/product.ts - Product schema → Vehicle model schema: references fitment
studio/schemaTypes/product.ts - Vehicle model schema → Brand schema: references manufacturer
studio/schemaTypes/carModel.ts