# dheeraj8601/cakestudio architecture

> Architecture diagram of the GitHub repository dheeraj8601/cakestudio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dheeraj8601/cakestudio
- Repository: https://github.com/dheeraj8601/cakestudio

## Overview

CakeStudio is a full-stack cake-commerce platform. Customers browse and customize cakes, manage a cart, check out using COD or Stripe, and track orders; administrators manage catalog, orders, users, and reviews. The React app communicates with an ASP.NET Core REST API, whose documented service and repository layers access SQL Server through Entity Framework Core. The README documents payment, authentication, invoice, email, and background-processing capabilities; some corresponding source files were not sampled, so those links are documented rather than inferred from code.

Main entry points: [`backend/CakeStudio.API/Program.cs`](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Program.cs) (ASP.NET API), [`backend/CakeStudio.Infrastructure/Services/AuthService.cs`](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Infrastructure/Services/AuthService.cs) (Authentication service), [`CakeStudio_React/src/App.jsx`](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/App.jsx) (React application), [`backend/CakeStudio.Persistence/DbContext/CakeStudioDbContext.cs`](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Persistence/DbContext/CakeStudioDbContext.cs) (EF Core context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Customer Web"]
  node_react["React application<br/>[App.jsx]"]
  node_routes["Page routing<br/>[Route.js]"]
  node_adminroutes["Admin routing<br/>[adminRoutes.js]"]
  node_clientservice["API client<br/>[Service.js]"]
  node_shopping["Shopping &amp; checkout"]
  node_accounts["Customer accounts"]
  node_adminops["Admin console<br/>[Orders.jsx]"]
end

subgraph group_api["API &amp; Security"]
  node_api["ASP.NET API<br/>[Program.cs]"]
  node_authcontroller["Auth endpoints<br/>[AuthController.cs]"]
  node_authservice["Authentication service<br/>[AuthService.cs]"]
end

subgraph group_commerce["Commerce Operations"]
  node_catalog["Catalog endpoints"]
  node_orders["Order endpoints<br/>[OrderController.cs]"]
  node_payments["Payment processing<br/>[PaymentService.cs]"]
  node_webhooks["Stripe webhooks"]
  node_reviewsapi["Review endpoints"]
  node_reviewservice["Review rules<br/>[ReviewService.cs]"]
  node_invoices["PDF invoices"]
end

subgraph group_data["Persistence"]
  node_reviewrepo["Review repository"]
  node_dbcontext["EF Core context"]
  node_entities["Commerce entities<br/>[Entities]"]
  node_tokens["Refresh tokens<br/>[RefreshToken.cs]"]
  node_sql[("SQL Server")]
end

subgraph group_integrations["External Services"]
  node_stripe["Stripe"]
  node_google["Google identity"]
  node_email["Email service"]
  node_background["Background jobs"]
end

node_customer(("Customer"))
node_admin(("Administrator"))

node_customer -->|"shops with"| node_react
node_admin -->|"manages through"| node_react
node_react -->|"routes pages"| node_routes
node_routes -.->|"uses API"| node_clientservice
node_adminroutes -->|"routes admin"| node_adminops
node_react -->|"calls REST API"| node_api
node_shopping -.->|"requests data"| node_clientservice
node_accounts -.->|"requests account data"| node_clientservice
node_adminops -.->|"requests admin data"| node_clientservice
node_api -->|"hosts endpoints"| node_authcontroller
node_authcontroller -->|"delegates auth"| node_authservice
node_authservice -->|"rotates tokens"| node_tokens
node_api -.->|"routes catalog"| node_catalog
node_api -.->|"routes orders"| node_orders
node_api -->|"routes reviews"| node_reviewsapi
node_reviewsapi -->|"delegates reviews"| node_reviewservice
node_reviewservice -->|"uses repository"| node_reviewrepo
node_reviewrepo -->|"queries context"| node_dbcontext
node_api -->|"configures EF"| node_dbcontext
node_dbcontext -->|"maps entities"| node_entities
node_dbcontext -->|"persists data"| node_sql
node_orders -.->|"initiates payment"| node_payments
node_webhooks -->|"handles events"| node_payments
node_payments -->|"creates sessions"| node_stripe
node_stripe -->|"sends events"| node_webhooks
node_authservice -->|"validates identity"| node_google
node_authservice -.->|"sends messages"| node_email
node_background -->|"processes email"| node_email
node_orders -.->|"requests invoices"| node_invoices
node_invoices -->|"emails invoices"| node_email

click node_react "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/App.jsx"
click node_routes "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/routes/Route.js"
click node_adminroutes "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/routes/adminRoutes.js"
click node_clientservice "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/services/Service.js"
click node_shopping "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/components/Checkout/CheckoutComponent.jsx"
click node_accounts "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/components/MyAccount/MyAccountLayout.jsx"
click node_adminops "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/components/Admin/Orders/Orders.jsx"
click node_api "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Program.cs"
click node_authcontroller "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/AuthController.cs"
click node_authservice "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Infrastructure/Services/AuthService.cs"
click node_catalog "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/CakeCatalogController.cs"
click node_orders "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/OrderController.cs"
click node_payments "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Infrastructure/Services/PaymentService.cs"
click node_webhooks "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/StripeWebhookController.cs"
click node_reviewsapi "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/ReviewController.cs"
click node_reviewservice "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Infrastructure/Services/ReviewService.cs"
click node_reviewrepo "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Infrastructure/Repositories/ReviewRepository.cs"
click node_dbcontext "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Persistence/DbContext/CakeStudioDbContext.cs"
click node_entities "https://github.com/dheeraj8601/cakestudio/tree/CakeStudioDevelopment/backend/CakeStudio.Persistence/Entities"
click node_tokens "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Persistence/Entities/RefreshToken.cs"
click node_invoices "https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/InvoiceController.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_react,node_routes,node_adminroutes,node_clientservice,node_shopping,node_accounts,node_adminops toneBlue
class node_api,node_authcontroller,node_authservice toneAmber
class node_catalog,node_orders,node_payments,node_webhooks,node_reviewsapi,node_reviewservice,node_invoices toneMint
class node_reviewrepo,node_dbcontext,node_entities,node_tokens,node_sql toneRose
class node_stripe,node_google,node_email,node_background,node_customer,node_admin toneIndigo
```

## Components

### Customer Web

- [React application](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/App.jsx): `CakeStudio_React/src/App.jsx`
- [Page routing](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/routes/Route.js): `CakeStudio_React/src/routes/Route.js`
- [Admin routing](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/routes/adminRoutes.js): `CakeStudio_React/src/routes/adminRoutes.js`
- [API client](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/services/Service.js): `CakeStudio_React/src/services/Service.js`
- [Shopping & checkout](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/components/Checkout/CheckoutComponent.jsx): `CakeStudio_React/src/components/Checkout/CheckoutComponent.jsx`
- [Customer accounts](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/components/MyAccount/MyAccountLayout.jsx): `CakeStudio_React/src/components/MyAccount/MyAccountLayout.jsx`
- [Admin console](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/CakeStudio_React/src/components/Admin/Orders/Orders.jsx): `CakeStudio_React/src/components/Admin/Orders/Orders.jsx`

### API & Security

- [ASP.NET API](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Program.cs): `backend/CakeStudio.API/Program.cs`
- [Auth endpoints](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/AuthController.cs): `backend/CakeStudio.API/Controllers/AuthController.cs`
- [Authentication service](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Infrastructure/Services/AuthService.cs): `backend/CakeStudio.Infrastructure/Services/AuthService.cs`

### Commerce Operations

- [Catalog endpoints](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/CakeCatalogController.cs): `backend/CakeStudio.API/Controllers/CakeCatalogController.cs`
- [Order endpoints](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/OrderController.cs): `backend/CakeStudio.API/Controllers/OrderController.cs`
- [Payment processing](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Infrastructure/Services/PaymentService.cs): `backend/CakeStudio.Infrastructure/Services/PaymentService.cs`
- [Stripe webhooks](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/StripeWebhookController.cs): `backend/CakeStudio.API/Controllers/StripeWebhookController.cs`
- [Review endpoints](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/ReviewController.cs): `backend/CakeStudio.API/Controllers/ReviewController.cs`
- [Review rules](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Infrastructure/Services/ReviewService.cs): `backend/CakeStudio.Infrastructure/Services/ReviewService.cs`
- [PDF invoices](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.API/Controllers/InvoiceController.cs): `backend/CakeStudio.API/Controllers/InvoiceController.cs`

### Persistence

- [Review repository](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Infrastructure/Repositories/ReviewRepository.cs): `backend/CakeStudio.Infrastructure/Repositories/ReviewRepository.cs`
- [EF Core context](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Persistence/DbContext/CakeStudioDbContext.cs): `backend/CakeStudio.Persistence/DbContext/CakeStudioDbContext.cs`
- [Commerce entities](https://github.com/dheeraj8601/cakestudio/tree/CakeStudioDevelopment/backend/CakeStudio.Persistence/Entities): `backend/CakeStudio.Persistence/Entities`
- [Refresh tokens](https://github.com/dheeraj8601/cakestudio/blob/CakeStudioDevelopment/backend/CakeStudio.Persistence/Entities/RefreshToken.cs): `backend/CakeStudio.Persistence/Entities/RefreshToken.cs`
- **SQL Server**

### External Services

- **Stripe**
- **Google identity**
- **Email service**
- **Background jobs**

### Other components

- **Customer**
- **Administrator**

## Connections

- Customer → React application: shops with
- Administrator → React application: manages through
- React application → Page routing: routes pages (evidence: `CakeStudio_React/src/App.jsx`)
- Page routing → API client: uses API
- Admin routing → Admin console: routes admin (evidence: `CakeStudio_React/src/routes/adminRoutes.js`)
- React application → ASP.NET API: calls REST API
- Shopping & checkout → API client: requests data
- Customer accounts → API client: requests account data
- Admin console → API client: requests admin data
- ASP.NET API → Auth endpoints: hosts endpoints
- Auth endpoints → Authentication service: delegates auth (evidence: `backend/CakeStudio.API/Controllers/AuthController.cs`)
- Authentication service → Refresh tokens: rotates tokens (evidence: `backend/CakeStudio.Infrastructure/Services/AuthService.cs`)
- ASP.NET API → Catalog endpoints: routes catalog
- ASP.NET API → Order endpoints: routes orders
- ASP.NET API → Review endpoints: routes reviews (evidence: `backend/CakeStudio.API/Controllers/ReviewController.cs`)
- Review endpoints → Review rules: delegates reviews (evidence: `backend/CakeStudio.API/Controllers/ReviewController.cs`)
- Review rules → Review repository: uses repository (evidence: `backend/CakeStudio.Infrastructure/Services/ReviewService.cs`)
- Review repository → EF Core context: queries context (evidence: `backend/CakeStudio.Infrastructure/Repositories/ReviewRepository.cs`)
- ASP.NET API → EF Core context: configures EF (evidence: `backend/CakeStudio.API/Program.cs`)
- EF Core context → Commerce entities: maps entities (evidence: `backend/CakeStudio.Persistence/DbContext/CakeStudioDbContext.cs`)
- EF Core context → SQL Server: persists data
- Order endpoints → Payment processing: initiates payment
- Stripe webhooks → Payment processing: handles events (evidence: `backend/CakeStudio.API/Controllers/StripeWebhookController.cs`)
- Payment processing → Stripe: creates sessions
- Stripe → Stripe webhooks: sends events
- Authentication service → Google identity: validates identity (evidence: `backend/CakeStudio.Infrastructure/Services/AuthService.cs`)
- Authentication service → Email service: sends messages
- Background jobs → Email service: processes email
- Order endpoints → PDF invoices: requests invoices
- PDF invoices → Email service: emails invoices
