# vic778/jumia-api architecture

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

- Interactive diagram: https://gitdiagram.com/vic778/jumia-api
- Repository: https://github.com/vic778/jumia-api

## Overview

JUMIA is a Rails e-commerce backend exposing JSON APIs for users and a hierarchical product catalog, with an ActiveAdmin interface for administration. The principal workflow is a client request routed to a resource controller, which reads or changes domain records and returns JSON. The routes and sampled controllers establish several catalog stages; the README documents additional commerce and product capabilities. Some controllers, models, and integrations are unsampled, so their internal calls are not inferred.

Main entry points: [`config/routes.rb`](https://github.com/vic778/jumia-api/blob/develop/config/routes.rb) (API routes), [`app/controllers/drawers_controller.rb`](https://github.com/vic778/jumia-api/blob/develop/app/controllers/drawers_controller.rb) (Drawers API), [`app/controllers/posts_controller.rb`](https://github.com/vic778/jumia-api/blob/develop/app/controllers/posts_controller.rb) (Posts API), [`app/controllers/categories_controller.rb`](https://github.com/vic778/jumia-api/blob/develop/app/controllers/categories_controller.rb) (Categories API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and catalog"]
  node_routes["API routes<br/>[routes.rb]"]
  node_category_api["Categories API"]
  node_subcategory_api["Subcategories API"]
  node_drawer_api["Drawers API"]
  node_post_api["Posts API"]
  node_spec_api["Specifications API"]
  node_box_api["Boxes API<br/>[box_controller.rb]"]
  node_feature_api["Key features API"]
  node_serializers["JSON serializers"]
end

subgraph group_identity["Identity and access"]
  node_identity_api["User and sessions API"]
  node_user_model["Users and roles<br/>[user.rb]"]
  node_permissions["Authorization"]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin interface<br/>[dashboard.rb]"]
  node_admin_categories["Category administration<br/>[category.rb]"]
end

subgraph group_domain["Commerce domain"]
  node_category_model["Categories<br/>[category.rb]"]
  node_subcategory_model["Subcategories<br/>[sub_category.rb]"]
  node_drawer_model["Drawers<br/>[drawer.rb]"]
  node_post_model["Products and posts<br/>[post.rb]"]
  node_spec_model["Specifications<br/>[specification.rb]"]
  node_box_model["Product boxes<br/>[box.rb]"]
  node_feature_model["Key features<br/>[key_feature.rb]"]
  node_cart_model["Cart and line items<br/>[cart.rb]"]
end

subgraph group_persistence["Persistence"]
  node_db[("PostgreSQL")]
end

node_client(("API client"))

node_client -->|"sends request"| node_routes
node_routes -->|"routes to"| node_category_api
node_routes -->|"routes to"| node_subcategory_api
node_routes -->|"routes to"| node_drawer_api
node_routes -->|"routes to"| node_post_api
node_routes -->|"routes to"| node_spec_api
node_routes -->|"routes to"| node_box_api
node_routes -->|"routes to"| node_feature_api
node_routes -->|"routes to"| node_identity_api
node_category_api -->|"reads and updates"| node_category_model
node_drawer_api -->|"reads and updates"| node_drawer_model
node_drawer_api -->|"finds parent"| node_subcategory_model
node_post_api -->|"reads and updates"| node_post_model
node_post_api -->|"finds parent"| node_drawer_model
node_spec_api -->|"loads records"| node_box_model
node_spec_api -->|"loads records"| node_feature_model
node_identity_api -.->|"authenticates users"| node_user_model
node_admin_ui -.->|"provides management"| node_admin_categories
node_admin_categories -.->|"manages categories"| node_category_model
node_category_api -->|"checks access"| node_permissions
node_drawer_api -->|"checks access"| node_permissions
node_post_api -->|"checks access"| node_permissions
node_category_model -.->|"persists records"| node_db
node_user_model -.->|"persists records"| node_db

click node_routes "https://github.com/vic778/jumia-api/blob/develop/config/routes.rb"
click node_category_api "https://github.com/vic778/jumia-api/blob/develop/app/controllers/categories_controller.rb"
click node_subcategory_api "https://github.com/vic778/jumia-api/blob/develop/app/controllers/sub_categories_controller.rb"
click node_drawer_api "https://github.com/vic778/jumia-api/blob/develop/app/controllers/drawers_controller.rb"
click node_post_api "https://github.com/vic778/jumia-api/blob/develop/app/controllers/posts_controller.rb"
click node_spec_api "https://github.com/vic778/jumia-api/blob/develop/app/controllers/specifications_controller.rb"
click node_box_api "https://github.com/vic778/jumia-api/blob/develop/app/controllers/box_controller.rb"
click node_feature_api "https://github.com/vic778/jumia-api/blob/develop/app/controllers/key_features_controller.rb"
click node_serializers "https://github.com/vic778/jumia-api/tree/develop/app/serializers"
click node_identity_api "https://github.com/vic778/jumia-api/blob/develop/app/controllers/sessions_controller.rb"
click node_user_model "https://github.com/vic778/jumia-api/blob/develop/app/models/user.rb"
click node_permissions "https://github.com/vic778/jumia-api/blob/develop/app/controllers/permissions_controller.rb"
click node_admin_ui "https://github.com/vic778/jumia-api/blob/develop/app/admin/dashboard.rb"
click node_admin_categories "https://github.com/vic778/jumia-api/blob/develop/app/admin/category.rb"
click node_category_model "https://github.com/vic778/jumia-api/blob/develop/app/models/category.rb"
click node_subcategory_model "https://github.com/vic778/jumia-api/blob/develop/app/models/sub_category.rb"
click node_drawer_model "https://github.com/vic778/jumia-api/blob/develop/app/models/drawer.rb"
click node_post_model "https://github.com/vic778/jumia-api/blob/develop/app/models/post.rb"
click node_spec_model "https://github.com/vic778/jumia-api/blob/develop/app/models/specification.rb"
click node_box_model "https://github.com/vic778/jumia-api/blob/develop/app/models/box.rb"
click node_feature_model "https://github.com/vic778/jumia-api/blob/develop/app/models/key_feature.rb"
click node_cart_model "https://github.com/vic778/jumia-api/blob/develop/app/models/cart.rb"

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_routes,node_category_api,node_subcategory_api,node_drawer_api,node_post_api,node_spec_api,node_box_api,node_feature_api,node_serializers,node_client toneBlue
class node_identity_api,node_user_model,node_permissions toneAmber
class node_admin_ui,node_admin_categories toneMint
class node_category_model,node_subcategory_model,node_drawer_model,node_post_model,node_spec_model,node_box_model,node_feature_model,node_cart_model toneRose
class node_db toneIndigo
```

## Components

### API and catalog

- [API routes](https://github.com/vic778/jumia-api/blob/develop/config/routes.rb): `config/routes.rb`
- [Categories API](https://github.com/vic778/jumia-api/blob/develop/app/controllers/categories_controller.rb): `app/controllers/categories_controller.rb`
- [Subcategories API](https://github.com/vic778/jumia-api/blob/develop/app/controllers/sub_categories_controller.rb): `app/controllers/sub_categories_controller.rb`
- [Drawers API](https://github.com/vic778/jumia-api/blob/develop/app/controllers/drawers_controller.rb): `app/controllers/drawers_controller.rb`
- [Posts API](https://github.com/vic778/jumia-api/blob/develop/app/controllers/posts_controller.rb): `app/controllers/posts_controller.rb`
- [Specifications API](https://github.com/vic778/jumia-api/blob/develop/app/controllers/specifications_controller.rb): `app/controllers/specifications_controller.rb`
- [Boxes API](https://github.com/vic778/jumia-api/blob/develop/app/controllers/box_controller.rb): `app/controllers/box_controller.rb`
- [Key features API](https://github.com/vic778/jumia-api/blob/develop/app/controllers/key_features_controller.rb): `app/controllers/key_features_controller.rb`
- [JSON serializers](https://github.com/vic778/jumia-api/tree/develop/app/serializers): `app/serializers`

### Identity and access

- [User and sessions API](https://github.com/vic778/jumia-api/blob/develop/app/controllers/sessions_controller.rb): `app/controllers/sessions_controller.rb`
- [Users and roles](https://github.com/vic778/jumia-api/blob/develop/app/models/user.rb): `app/models/user.rb`
- [Authorization](https://github.com/vic778/jumia-api/blob/develop/app/controllers/permissions_controller.rb): `app/controllers/permissions_controller.rb`

### Administration

- [Admin interface](https://github.com/vic778/jumia-api/blob/develop/app/admin/dashboard.rb): `app/admin/dashboard.rb`
- [Category administration](https://github.com/vic778/jumia-api/blob/develop/app/admin/category.rb): `app/admin/category.rb`

### Commerce domain

- [Categories](https://github.com/vic778/jumia-api/blob/develop/app/models/category.rb): `app/models/category.rb`
- [Subcategories](https://github.com/vic778/jumia-api/blob/develop/app/models/sub_category.rb): `app/models/sub_category.rb`
- [Drawers](https://github.com/vic778/jumia-api/blob/develop/app/models/drawer.rb): `app/models/drawer.rb`
- [Products and posts](https://github.com/vic778/jumia-api/blob/develop/app/models/post.rb): `app/models/post.rb`
- [Specifications](https://github.com/vic778/jumia-api/blob/develop/app/models/specification.rb): `app/models/specification.rb`
- [Product boxes](https://github.com/vic778/jumia-api/blob/develop/app/models/box.rb): `app/models/box.rb`
- [Key features](https://github.com/vic778/jumia-api/blob/develop/app/models/key_feature.rb): `app/models/key_feature.rb`
- [Cart and line items](https://github.com/vic778/jumia-api/blob/develop/app/models/cart.rb): `app/models/cart.rb`

### Persistence

- **PostgreSQL**

### Other components

- **API client**

## Connections

- API client → API routes: sends request (evidence: `config/routes.rb`)
- API routes → Categories API: routes to (evidence: `config/routes.rb`)
- API routes → Subcategories API: routes to (evidence: `config/routes.rb`)
- API routes → Drawers API: routes to (evidence: `config/routes.rb`)
- API routes → Posts API: routes to (evidence: `config/routes.rb`)
- API routes → Specifications API: routes to (evidence: `config/routes.rb`)
- API routes → Boxes API: routes to (evidence: `config/routes.rb`)
- API routes → Key features API: routes to (evidence: `config/routes.rb`)
- API routes → User and sessions API: routes to (evidence: `config/routes.rb`)
- Categories API → Categories: reads and updates (evidence: `app/controllers/categories_controller.rb`)
- Drawers API → Drawers: reads and updates (evidence: `app/controllers/drawers_controller.rb`)
- Drawers API → Subcategories: finds parent (evidence: `app/controllers/drawers_controller.rb`)
- Posts API → Products and posts: reads and updates (evidence: `app/controllers/posts_controller.rb`)
- Posts API → Drawers: finds parent (evidence: `app/controllers/posts_controller.rb`)
- Specifications API → Product boxes: loads records (evidence: `app/controllers/specifications_controller.rb`)
- Specifications API → Key features: loads records (evidence: `app/controllers/specifications_controller.rb`)
- User and sessions API → Users and roles: authenticates users
- Admin interface → Category administration: provides management
- Category administration → Categories: manages categories
- Categories API → Authorization: checks access (evidence: `app/controllers/categories_controller.rb`)
- Drawers API → Authorization: checks access (evidence: `app/controllers/drawers_controller.rb`)
- Posts API → Authorization: checks access (evidence: `app/controllers/posts_controller.rb`)
- Categories → PostgreSQL: persists records
- Users and roles → PostgreSQL: persists records
