Skip to content

Commit 6eeb4f1

Browse files
committed
Add full-vehicle fitment seed, fix Trailer Hitches icon, update README
- Add seed script 18: generate fitment mappings for all 1,747 vehicles (previously only covered IDs 1-388, leaving ~1,300 vehicles empty) - Fix Trailer Hitches category icon from invalid 'tow' to 'rv_hookup' - Update README with live demo link, architecture diagrams, design decisions, data model, Azure deployment info, and developer bio - Add MongoDB Q&A seed script and data (330 entries)
1 parent 81565d5 commit 6eeb4f1

5 files changed

Lines changed: 381 additions & 24 deletions

File tree

README.md

Lines changed: 146 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,72 @@
1-
# FitSpec — Vehicle Parts Fitment Finder
1+
# FitSpec — Automotive Parts Fitment & Recommendation Engine
22

3-
Full-stack automotive parts fitment application built with **Angular 21**, **ASP.NET Core 10**, **SQL Server**, and **MongoDB**. Provides verified compatibility data for aftermarket parts, accessories, and modifications across 150+ products and 30 brands.
3+
**[Live Demo → fitspec.natedev.io](https://fitspec.natedev.io)**
4+
5+
FitSpec solves the automotive aftermarket's core conversion problem: getting the right part on the right vehicle, every time. Users select their vehicle by year, make, model, and trim, then browse a catalog of verified-compatible parts across multiple categories — with AI-powered recommendations, install guides, and a fitment assistant built in.
6+
7+
The fitment data model reflects how aftermarket automotive parts actually work: year/make/model/trim specificity, receiver classes, bulb types, wiring configurations, and cross-category compatibility patterns. Every architectural decision maps to a real e-commerce outcome.
8+
9+
---
410

511
## Tech Stack
612

7-
| Layer | Technology |
8-
|-------|-----------|
9-
| Frontend | Angular 21 (standalone components, signals, Material 3) |
10-
| Backend | ASP.NET Core 10, Dapper + EF Core, API versioning |
11-
| SQL Database | SQL Server 2022 (vehicles, products, fitment mappings, orders) |
12-
| Document Store | MongoDB 7 (reviews, product catalog, Q&A) |
13-
| ML | ML.NET (product recommendations) |
14-
| Real-time | SignalR (inventory updates) |
15-
| AI | Claude API (fitment assistant, install guides) |
16-
| Infrastructure | Docker Compose (4 containers), nginx reverse proxy |
13+
| Layer | Technology | Why |
14+
|-------|-----------|-----|
15+
| **Frontend** | Angular 21 (standalone components, signals, Material 3) | Enterprise-standard SPA framework with custom theming |
16+
| **Backend** | ASP.NET Core 10, Dapper + EF Core, API versioning | Current release, production-grade REST API |
17+
| **SQL Database** | SQL Server 2022 / Azure SQL | Relational fitment data with stored procedures via Dapper for performance-critical queries |
18+
| **Document Store** | MongoDB 7 / Atlas | Flexible schema for reviews, Q&A, and category-specific product metadata |
19+
| **ML** | ML.NET (matrix factorization) | In-process recommendations with no external API dependencies |
20+
| **Real-time** | SignalR | Inventory push updates |
21+
| **AI** | Anthropic Claude API | Fitment assistant chat, dynamic install guides, certificates, spec sheets |
22+
| **Infrastructure** | Docker Compose (local), Azure App Service + Static Web Apps (prod) | Full production deployment with CI/CD |
23+
24+
---
1725

1826
## Architecture
1927

28+
### Production (Azure)
29+
30+
```
31+
┌─────────────────────────────────────────────────────────────────────┐
32+
│ Azure Static Web Apps │
33+
│ Angular 21 SPA (CDN + SSL) │
34+
│ fitspec.natedev.io │
35+
└──────────────────────────────┬──────────────────────────────────────┘
36+
│ HTTPS
37+
38+
┌─────────────────────────────────────────────────────────────────────┐
39+
│ Azure App Service (B1) │
40+
│ ASP.NET Core .NET 10 Web API │
41+
│ fitspec-api.azurewebsites.net │
42+
│ │
43+
│ ┌──────────────┐ ┌──────────────┐ ┌───────────────────────────┐ │
44+
│ │ Controllers │ │ ML.NET │ │ Claude API Integration │ │
45+
│ │ & Middleware │ │ Prediction │ │ (Fitment Assistant, │ │
46+
│ │ │ │ Engine │ │ Install Guides, │ │
47+
│ │ │ │ │ │ Certificates) │ │
48+
│ └──────┬───────┘ └──────┬───────┘ └───────────────────────────┘ │
49+
│ │ │ │
50+
│ ┌──────┴─────────────────┴──────────────────────────────────────┐ │
51+
│ │ Data Access Layer (Dapper + EF Core) │ │
52+
│ └──────┬──────────────────────────────────┬─────────────────────┘ │
53+
└─────────┼──────────────────────────────────┼───────────────────────┘
54+
│ │
55+
▼ ▼
56+
┌──────────────────────┐ ┌──────────────────────┐
57+
│ Azure SQL Database │ │ MongoDB Atlas (M0) │
58+
│ │ │ │
59+
│ • Vehicles (1,747) │ │ • Product Reviews │
60+
│ • Products (150) │ │ • Q&A Threads (330) │
61+
│ • FitmentMappings │ │ • Extended Catalog │
62+
│ (174,295) │ │ Metadata │
63+
│ • Orders (4,500) │ │ │
64+
│ • Stored Procedures │ │ │
65+
└──────────────────────┘ └──────────────────────┘
66+
```
67+
68+
### Local Development (Docker Compose)
69+
2070
```
2171
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
2272
│ Angular UI │────▶│ nginx :80 │────▶│ .NET API │
@@ -31,7 +81,7 @@ Full-stack automotive parts fitment application built with **Angular 21**, **ASP
3181
└───────────┘ └───────────┘
3282
```
3383

34-
The Angular app is served by nginx, which also reverse-proxies `/api/` and `/hubs/` requests to the .NET API container. All API calls from the frontend use relative URLs (`/api/v1/...`).
84+
---
3585

3686
## Features
3787

@@ -58,16 +108,50 @@ The Angular app is served by nginx, which also reverse-proxies `/api/` and `/hub
58108
21. **Dark Mode** — System-aware theme toggle with CSS custom properties
59109
22. **Global Search** — Header autocomplete with typeahead
60110

61-
## Prerequisites
111+
---
112+
113+
## Design Decisions
114+
115+
### Polyglot Persistence (SQL Server + MongoDB)
116+
Fitment data is deeply relational — vehicles, products, and their many-to-many compatibility mappings require referential integrity and performant joins. Reviews, Q&A, and extended product metadata have variable schemas (a hitch and a headlight have completely different spec sheets) and are naturally document-oriented. Using both databases is an intentional architectural choice, not complexity for its own sake.
117+
118+
### Dapper + EF Core Hybrid
119+
Dapper handles the performance-critical fitment queries via stored procedures — these power the core user experience and need to be fast. EF Core handles migrations, schema management, and simpler CRUD operations where developer velocity matters more than raw query speed. This reflects how production .NET applications actually make data access decisions.
120+
121+
### ML.NET Over External APIs
122+
The recommendation engine runs entirely within the .NET ecosystem using ML.NET, with no external API dependencies or Python services. The trained model is loaded once at startup and serves predictions in-process, keeping response times low.
123+
124+
---
125+
126+
## Data Model
127+
128+
The core schema centers on the `FitmentMappings` junction table, which links vehicles to compatible products. This many-to-many relationship is the heart of the application.
129+
130+
```
131+
Makes (30) ──┐
132+
├── Vehicles (1,747) ──── FitmentMappings (174,295) ──── Products (150)
133+
Models (180) ┘ │
134+
Categories (20)
135+
136+
Orders (4,500) ──── OrderItems (7,464) → ML.NET Training Data
137+
```
138+
139+
Stored procedures (`sp_GetCompatibleProducts`, `sp_GetVehicleCascade`, `sp_GetCategoryBreakdown`) handle the performance-critical fitment queries via Dapper.
140+
141+
---
142+
143+
## Quick Start
144+
145+
### Prerequisites
62146

63147
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
64148
- [Git](https://git-scm.com/)
65149

66-
## Quick Start
150+
### Run the Full Stack
67151

68152
1. **Clone the repository**
69153
```bash
70-
git clone https://github.com/<your-username>/fitspec.git
154+
git clone https://github.com/NateDevIO/fitspec.git
71155
cd fitspec
72156
```
73157

@@ -99,16 +183,44 @@ The Angular app is served by nginx, which also reverse-proxies `/api/` and `/hub
99183
- API (Swagger): [http://localhost:5062/swagger](http://localhost:5062/swagger) (development only)
100184
- Admin panel: [http://localhost:4200/admin](http://localhost:4200/admin)
101185

186+
### Run Tests
187+
188+
```bash
189+
dotnet test tests/FitSpec.Tests
190+
```
191+
192+
---
193+
194+
## Azure Deployment
195+
196+
FitSpec is deployed on Azure's free and low-cost tiers:
197+
198+
| Service | Resource | Tier | Monthly Cost |
199+
|---------|----------|------|-------------|
200+
| API | Azure App Service | B1 Basic | ~$13 |
201+
| Frontend | Azure Static Web Apps | Free | $0 |
202+
| SQL Database | Azure SQL | Free (32GB) | $0 |
203+
| Document DB | MongoDB Atlas | M0 Free (512MB) | $0 |
204+
| **Total** | | | **~$13/mo** |
205+
206+
CI/CD is handled by GitHub Actions workflows:
207+
- **FitSpec CI** — builds and tests on every push
208+
- **Deploy API to Azure** — publishes to App Service on pushes to `src/`
209+
- **Azure Static Web Apps CI/CD** — auto-deploys the Angular SPA
210+
211+
---
212+
102213
## Project Structure
103214

104215
```
105216
fitspec/
106217
├── docker-compose.yml # 4-service orchestration
107218
├── .env # Secrets (gitignored)
219+
├── .github/workflows/ # CI/CD pipeline definitions
108220
├── scripts/
109221
│ └── setup-dev.sh # Database setup & seeding
110222
├── infra/
111-
│ └── seed/ # SQL + MongoDB seed scripts
223+
│ └── seed/ # SQL + MongoDB seed scripts (00-18)
112224
├── src/
113225
│ ├── FitSpec.API/ # ASP.NET Core 10 API
114226
│ │ ├── Controllers/ # REST endpoints (versioned)
@@ -126,7 +238,8 @@ fitspec/
126238
│ │ └── features/ # Feature components
127239
│ ├── nginx.conf # Reverse proxy config
128240
│ └── Dockerfile
129-
└── tests/ # Test projects
241+
└── tests/
242+
└── FitSpec.Tests/ # xUnit unit & integration tests
130243
```
131244

132245
## Configuration
@@ -140,14 +253,12 @@ fitspec/
140253
| `ConnectionStrings__MongoDb` | MongoDB connection string | Set in docker-compose.yml |
141254
| `AllowedOrigins__0` | CORS allowed origin | Defaults to `http://localhost:4200` |
142255

143-
### Azure Deployment
144-
145256
When deploying to Azure, configure these as **App Settings** or environment variables:
146257

147258
- `ConnectionStrings__DefaultConnection` — Azure SQL connection string
148-
- `ConnectionStrings__MongoDb`Azure Cosmos DB (MongoDB API) or MongoDB Atlas connection string
259+
- `ConnectionStrings__MongoDb` — MongoDB Atlas connection string
149260
- `CLAUDE_API_KEY` — Anthropic API key
150-
- `AllowedOrigins__0` — Your Azure app URL (e.g., `https://fitspec.azurewebsites.net`)
261+
- `AllowedOrigins__0` — Your Azure app URL (e.g., `https://fitspec.natedev.io`)
151262

152263
The `.env` file is gitignored and must be recreated in each environment.
153264

@@ -205,6 +316,18 @@ docker compose down # Stop containers (keep data)
205316
docker compose down -v # Stop and delete volumes (reset databases)
206317
```
207318

319+
---
320+
321+
## About the Developer
322+
323+
Built by **Nate Allen** — a software engineer with 12+ years of e-commerce experience who understands that fitment accuracy is the difference between a conversion and a return.
324+
325+
- **Portfolio:** [natedev.io](https://natedev.io)
326+
- **LinkedIn:** [linkedin.com/in/natedev](https://linkedin.com/in/natedev)
327+
- **GitHub:** [github.com/NateDevIO](https://github.com/NateDevIO)
328+
329+
---
330+
208331
## License
209332

210-
This is a portfolio project. All rights reserved.
333+
This project is a portfolio demonstration and is not intended for commercial use.

infra/seed/04-categories.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ INSERT INTO Categories (Id, Name, Slug, Icon, ParentCategoryId, SortOrder) VALUE
1414

1515
-- Towing Subcategories (ParentCategoryId = 1)
1616
INSERT INTO Categories (Id, Name, Slug, Icon, ParentCategoryId, SortOrder) VALUES
17-
(5, 'Trailer Hitches', 'trailer-hitches', 'tow', 1, 1),
17+
(5, 'Trailer Hitches', 'trailer-hitches', 'rv_hookup', 1, 1),
1818
(6, 'Wiring Harnesses', 'wiring-harnesses', 'cable', 1, 2),
1919
(7, 'Ball Mounts', 'ball-mounts', 'sports_soccer', 1, 3),
2020
(8, 'Brake Controllers', 'brake-controllers', 'speed', 1, 4);

0 commit comments

Comments
 (0)