# aravind56565657/juice-shop-vulnerable architecture

> Architecture diagram of the GitHub repository aravind56565657/juice-shop-vulnerable, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aravind56565657/juice-shop-vulnerable
- Repository: https://github.com/aravind56565657/juice-shop-vulnerable

## Overview

OWASP Juice Shop is an intentionally vulnerable e-commerce web application used for security training, demonstrations, and CTFs. A shopper or learner uses the Angular interface, which calls the Express server for shop and account operations; the server exposes routes backed by Sequelize models and SQLite. Learners can also explore and track security challenges through the scoreboard and hacking-instructor features. The tree, README, and sampled files support this broad map, but many route-to-model and challenge-evaluation details were not sampled, so uncertain connections are omitted.

Main entry points: [`server.ts`](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/server.ts) (Express server), [`frontend/src/app/app.routing.ts`](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/app.routing.ts) (App routing), [`frontend/src/main.ts`](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/main.ts) (Angular app), [`frontend/src/app/basket/basket.component.ts`](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/basket/basket.component.ts) (Shop interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_angular["Angular app<br/>[main.ts]"]
  node_routing["App routing<br/>[app.routing.ts]"]
end

subgraph group_commerce["Shop workflows"]
  node_commerce_ui["Shop interface"]
  node_product_service["Product reviews"]
  node_twofa_ui["Two-factor UI service"]
  node_web3["Web3 features"]
  node_chatbot["Chatbot feature<br/>[chatbot.ts]"]
end

subgraph group_training["Security training"]
  node_scoreboard["Challenge scoreboard"]
  node_instructor["Hacking instructor<br/>[index.ts]"]
end

subgraph group_server["Application server"]
  node_challenge_api["Challenge API<br/>[continueCode.ts]"]
  node_review_api["Review routes"]
  node_auth_api["Two-factor routes<br/>[2fa.ts]"]
  node_server_entry["Express server<br/>[server.ts]"]
end

subgraph group_state["Persistent state"]
  node_challenge_data[("Challenge data<br/>[datacache.ts]")]
  node_models["Domain models<br/>[index.ts]"]
  node_sqlite[("SQLite database<br/>[index.ts]")]
end

node_shopper(("Shopper / learner"))

node_shopper -->|"uses"| node_angular
node_angular -->|"loads routes"| node_routing
node_routing -->|"routes to"| node_commerce_ui
node_commerce_ui -->|"uses reviews"| node_product_service
node_product_service -->|"HTTP requests"| node_review_api
node_shopper -->|"explores challenges"| node_scoreboard
node_scoreboard -->|"challenge requests"| node_challenge_api
node_instructor -->|"uses challenge content"| node_challenge_data
node_server_entry -->|"registers API"| node_review_api
node_server_entry -->|"registers API"| node_auth_api
node_server_entry -->|"registers API"| node_challenge_api
node_server_entry -->|"initializes models"| node_models
node_models -->|"stores records"| node_sqlite
node_twofa_ui -->|"HTTP requests"| node_auth_api
node_routing -.->|"loads module"| node_web3
node_shopper -.->|"uses chatbot"| node_chatbot

click node_angular "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/main.ts"
click node_routing "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/app.routing.ts"
click node_commerce_ui "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/basket/basket.component.ts"
click node_product_service "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/Services/product-review.service.ts"
click node_twofa_ui "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/Services/two-factor-auth-service.ts"
click node_scoreboard "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/score-board/score-board.component.ts"
click node_instructor "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/hacking-instructor/index.ts"
click node_challenge_api "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/routes/continueCode.ts"
click node_review_api "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/routes/showProductReviews.ts"
click node_auth_api "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/routes/2fa.ts"
click node_server_entry "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/server.ts"
click node_challenge_data "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/data/datacache.ts"
click node_models "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/models/index.ts"
click node_sqlite "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/models/index.ts"
click node_web3 "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/wallet-web3/wallet-web3.module.ts"
click node_chatbot "https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/routes/chatbot.ts"

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_angular,node_routing toneBlue
class node_commerce_ui,node_product_service,node_twofa_ui,node_web3,node_chatbot toneAmber
class node_scoreboard,node_instructor toneMint
class node_challenge_api,node_review_api,node_auth_api,node_server_entry toneRose
class node_challenge_data,node_models,node_sqlite,node_shopper toneIndigo
```

## Components

### Web client

- [Angular app](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/main.ts): `frontend/src/main.ts`
- [App routing](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/app.routing.ts): `frontend/src/app/app.routing.ts`

### Shop workflows

- [Shop interface](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/basket/basket.component.ts): `frontend/src/app/basket/basket.component.ts`
- [Product reviews](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/Services/product-review.service.ts): `frontend/src/app/Services/product-review.service.ts`
- [Two-factor UI service](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/Services/two-factor-auth-service.ts): `frontend/src/app/Services/two-factor-auth-service.ts`
- [Web3 features](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/wallet-web3/wallet-web3.module.ts): `frontend/src/app/wallet-web3/wallet-web3.module.ts`
- [Chatbot feature](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/routes/chatbot.ts): `routes/chatbot.ts`

### Security training

- [Challenge scoreboard](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/app/score-board/score-board.component.ts): `frontend/src/app/score-board/score-board.component.ts`
- [Hacking instructor](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/frontend/src/hacking-instructor/index.ts): `frontend/src/hacking-instructor/index.ts`

### Application server

- [Challenge API](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/routes/continueCode.ts): `routes/continueCode.ts`
- [Review routes](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/routes/showProductReviews.ts): `routes/showProductReviews.ts`
- [Two-factor routes](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/routes/2fa.ts): `routes/2fa.ts`
- [Express server](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/server.ts): `server.ts`

### Persistent state

- [Challenge data](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/data/datacache.ts): `data/datacache.ts`
- [Domain models](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/models/index.ts): `models/index.ts`
- [SQLite database](https://github.com/aravind56565657/juice-shop-vulnerable/blob/main/models/index.ts): `models/index.ts`

### Other components

- **Shopper / learner**

## Connections

- Shopper / learner → Angular app: uses
- Angular app → App routing: loads routes
- App routing → Shop interface: routes to
- Shop interface → Product reviews: uses reviews
- Product reviews → Review routes: HTTP requests
- Shopper / learner → Challenge scoreboard: explores challenges
- Challenge scoreboard → Challenge API: challenge requests
- Hacking instructor → Challenge data: uses challenge content
- Express server → Review routes: registers API
- Express server → Two-factor routes: registers API
- Express server → Challenge API: registers API
- Express server → Domain models: initializes models
- Domain models → SQLite database: stores records
- Two-factor UI service → Two-factor routes: HTTP requests
- App routing → Web3 features: loads module
- Shopper / learner → Chatbot feature: uses chatbot
