# teamshiksha/openlogo architecture

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

- Interactive diagram: https://gitdiagram.com/teamshiksha/openlogo
- Repository: https://github.com/teamshiksha/openlogo

## Overview

1. This is a two-package monorepo: `packages/ui` is the React frontend, and `packages/app` is the Node/Express backend API. The root also contains shared repo tooling, GitHub Actions, Docker Compose, and documentation.

2. The frontend is a Vite-built React SPA. Its structure is page/component driven, with route-level screens under `src/page`, reusable UI under `src/components`, and cross-cutting state in `src/contexts` and `src/hooks`. A small API client layer (`src/api`) and route protection helpers (`ProtectedRoute`) connect the UI to the backend.

3. The backend is organized in the classic layered Express style: `routes` define HTTP endpoints, `controllers` handle request/response orchestration, `services` implement business logic, `repositories` isolate persistence access, and `models` map to MongoDB collections. This separation is the main backend architectural boundary.

4. Authentication and account management are a major subsystem. The backend includes signup/signin/signout, email verification, MFA, password reset, session validation, user profiles, and API key management. Related models such as `userSession`, `verificationSession`, and `usertoken` show that identity state is persisted server-side rather than being purely stateless.

5. The core product domain is logo discovery and logo catalog management. Backend routes/controllers for `logo` and `catalog` support logo search, fetching individual logos, generating presigned upload URLs, updating metadata/permissions, and analytics. The UI mirrors this with logo upload, catalog browsing, and dashboard components.

6. There is a separate “logo request” workflow for user-submitted requests. It spans request creation, request logs, and operator tooling, with dedicated controllers and UI dashboards. The presence of `operator` routes, operator dashboard components, and message/request handlers indicates a human-in-the-loop review/support flow.

7. User-facing operational features include contact-us handling, subscriptions/plans, usage tracking, and personal data actions. The backend has services and models for subscriptions, request counts, keys, and user-related utilities; the frontend exposes current plan, usage graphs, settings, and account management screens.

8. Storage is MongoDB-centric. The backend’s models/repositories imply distinct collections for users, sessions, requests, images, contact messages, logo request logs, subscriptions, and keys. Business logic sits above the database via repositories so controllers do not talk to persistence directly.

9. External integrations matter to the architecture: AWS is used for the backend infrastructure and logo asset handling, including presigned upload flows and CloudFront-related utilities. Email delivery is also a first-class integration, supporting verification and password reset flows. The repo includes CloudFormation templates for dev/test and prod, suggesting infrastructure as code.

10. Deployment is split between frontend and backend, with separate GitHub Actions workflows and `vercel.json` files. The frontend is Vercel-friendly, while the backend is containerized with Docker and also has AWS deployment support. The repo also includes a daily refresh script for usage counts and Postman collections for API verification, which are part of the operational surface of the system.

11. Testing is broad and mirrors the architecture: backend Jest tests cover controllers, services, scripts, and utilities; frontend Vitest/Jest tests cover components, pages, contexts, and hooks. This suggests the team validates both API behavior and UI behavior at the subsystem boundary level.

12. In diagram terms, the main flows are: browser UI → Express routes/controllers → services → repositories/models → MongoDB/AWS; and operator/admin flows reuse the same backend layers but expose separate UI screens and endpoints. The repo is centered on a logo platform with auth, catalog, requests, and admin workflows layered over shared persistence and cloud services.

Main entry points: [`packages/app/services`](https://github.com/teamshiksha/openlogo/tree/stage/packages/app/services) (Services), [`packages/ui/src/App.jsx`](https://github.com/teamshiksha/openlogo/blob/stage/packages/ui/src/App.jsx) (UI app), [`packages/ui/src/page`](https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/page) (Pages), [`packages/app/server.js`](https://github.com/teamshiksha/openlogo/blob/stage/packages/app/server.js) (API app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_root["Repo tooling"]
  node_node_repo_tooling["Repo ops<br/>tooling"]
  node_node_docs["Docs<br/>documentation"]
end

subgraph group_group_ui["Frontend"]
  node_node_ui_entry["UI app<br/>react spa<br/>[App.jsx]"]
  node_node_ui_pages["Pages<br/>route screens"]
  node_node_ui_components["Components<br/>ui library"]
  node_node_ui_state["State<br/>contexts/hooks"]
  node_node_ui_api["API client<br/>http client"]
  node_node_ui_logo["Logo tools<br/>logo ui"]
  node_node_ui_catalog["Catalog UI"]
  node_node_ui_admin["Admin UI<br/>operator ui"]
  node_node_ui_auth["Account UI<br/>auth ui"]
end

subgraph group_group_app["Backend"]
  node_node_api_entry["API app<br/>express api<br/>[server.js]"]
  node_node_api_routes["Routes"]
  node_node_api_controllers["Controllers<br/>request handlers"]
  node_node_api_services["Services<br/>business logic"]
  node_node_api_repos["Repositories<br/>persistence"]
  node_node_api_models["Models"]
  node_node_api_auth["Identity<br/>auth subsystem<br/>[auth.js]"]
  node_node_api_catalog["Catalog<br/>logo subsystem<br/>[catalog.js]"]
  node_node_api_requests["Requests<br/>workflow subsystem"]
  node_node_api_aws[("AWS<br/>cloud integration")]
end

node_node_repo_tooling -->|"documents"| node_node_docs
node_node_repo_tooling -.->|"deploys"| node_node_ui_entry
node_node_repo_tooling -.->|"deploys"| node_node_api_entry
node_node_ui_entry -->|"renders"| node_node_ui_pages
node_node_ui_entry -->|"composes"| node_node_ui_components
node_node_ui_entry -->|"uses"| node_node_ui_state
node_node_ui_entry -->|"calls"| node_node_ui_api
node_node_ui_pages -->|"includes"| node_node_ui_auth
node_node_ui_pages -->|"includes"| node_node_ui_catalog
node_node_ui_pages -->|"includes"| node_node_ui_admin
node_node_ui_pages -->|"includes"| node_node_ui_logo
node_node_api_entry -->|"mounts"| node_node_api_routes
node_node_api_routes -->|"dispatches"| node_node_api_controllers
node_node_api_controllers -->|"orchestrates"| node_node_api_services
node_node_api_services -->|"reads/writes"| node_node_api_repos
node_node_api_repos -->|"maps to"| node_node_api_models
node_node_api_auth -->|"uses"| node_node_api_services
node_node_api_catalog -->|"uses"| node_node_api_services
node_node_api_requests -->|"uses"| node_node_api_services
node_node_api_services -->|"integrates"| node_node_api_aws
node_node_ui_api -->|"requests"| node_node_api_entry

click node_node_docs "https://github.com/teamshiksha/openlogo/tree/stage/docs"
click node_node_ui_entry "https://github.com/teamshiksha/openlogo/blob/stage/packages/ui/src/App.jsx"
click node_node_ui_pages "https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/page"
click node_node_ui_components "https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/components"
click node_node_ui_state "https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/contexts"
click node_node_ui_api "https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/api"
click node_node_ui_logo "https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/components/logo"
click node_node_ui_catalog "https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/components/catalog"
click node_node_ui_admin "https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/components/operator"
click node_node_ui_auth "https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/components/auth"
click node_node_api_entry "https://github.com/teamshiksha/openlogo/blob/stage/packages/app/server.js"
click node_node_api_routes "https://github.com/teamshiksha/openlogo/tree/stage/packages/app/routes"
click node_node_api_controllers "https://github.com/teamshiksha/openlogo/tree/stage/packages/app/controllers"
click node_node_api_services "https://github.com/teamshiksha/openlogo/tree/stage/packages/app/services"
click node_node_api_repos "https://github.com/teamshiksha/openlogo/tree/stage/packages/app/repositories"
click node_node_api_models "https://github.com/teamshiksha/openlogo/tree/stage/packages/app/models"
click node_node_api_auth "https://github.com/teamshiksha/openlogo/blob/stage/packages/app/routes/auth.js"
click node_node_api_catalog "https://github.com/teamshiksha/openlogo/blob/stage/packages/app/routes/catalog.js"
click node_node_api_requests "https://github.com/teamshiksha/openlogo/blob/stage/packages/app/routes/createLogoRequest.js"
click node_node_api_aws "https://github.com/teamshiksha/openlogo/tree/stage/packages/app/aws"

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_node_repo_tooling,node_node_docs toneBlue
class node_node_ui_entry,node_node_ui_pages,node_node_ui_components,node_node_ui_state,node_node_ui_api,node_node_ui_logo,node_node_ui_catalog,node_node_ui_admin,node_node_ui_auth toneAmber
class node_node_api_entry,node_node_api_routes,node_node_api_controllers,node_node_api_services,node_node_api_repos,node_node_api_models,node_node_api_auth,node_node_api_catalog,node_node_api_requests,node_node_api_aws toneMint
```

## Components

### Repo tooling

Shared repository automation, documentation, and deployment plumbing.

- **Repo ops**: tooling · GitHub Actions, Docker Compose, docs, and workspace setup.
- [Docs](https://github.com/teamshiksha/openlogo/tree/stage/docs): documentation · Development docs, diagrams, and Postman collections. · `docs`

### Frontend

Vite-built React SPA in packages/ui.

- [UI app](https://github.com/teamshiksha/openlogo/blob/stage/packages/ui/src/App.jsx): react spa · Frontend application shell and router bootstrap. · `packages/ui/src/App.jsx`
- [Pages](https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/page): route screens · Route-level screens for home, dashboard, create logo, docs, release, and verification. · `packages/ui/src/page`
- [Components](https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/components): ui library · Reusable UI building blocks for auth, catalog, logo editing, operator, usage, and settings. · `packages/ui/src/components`
- [State](https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/contexts): contexts/hooks · Cross-cutting React contexts and custom hooks for auth, operator, theme, toast, and API access. · `packages/ui/src/contexts`
- [API client](https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/api): http client · Frontend API instance and route protection helpers connecting the SPA to the backend. · `packages/ui/src/api`
- [Logo tools](https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/components/logo): logo ui · Upload, canvas, toolbar, and file-operation UI for logo creation and editing. · `packages/ui/src/components/logo`
- [Catalog UI](https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/components/catalog): catalog ui · Browsing, image upload modal, and catalog item presentation. · `packages/ui/src/components/catalog`
- [Admin UI](https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/components/operator): operator ui · Operator dashboard and review/support surfaces for requests and messages. · `packages/ui/src/components/operator`
- [Account UI](https://github.com/teamshiksha/openlogo/tree/stage/packages/ui/src/components/auth): auth ui · Signin, signup, reset password, verification, profile, plan, usage, and settings screens. · `packages/ui/src/components/auth`

### Backend

Express API in packages/app.

- [API app](https://github.com/teamshiksha/openlogo/blob/stage/packages/app/server.js): express api · Backend application bootstrap and server wiring. · `packages/app/server.js`
- [Routes](https://github.com/teamshiksha/openlogo/tree/stage/packages/app/routes): http routes · HTTP endpoint definitions for auth, catalog, logo, requests, users, operator, and logs. · `packages/app/routes`
- [Controllers](https://github.com/teamshiksha/openlogo/tree/stage/packages/app/controllers): request handlers · Request/response orchestration layer separating transport from business logic. · `packages/app/controllers`
- [Services](https://github.com/teamshiksha/openlogo/tree/stage/packages/app/services): business logic · Core workflows for auth, MFA, password reset, requests, subscriptions, email, and asset handling. · `packages/app/services`
- [Repositories](https://github.com/teamshiksha/openlogo/tree/stage/packages/app/repositories): persistence · Data-access boundary over MongoDB collections. · `packages/app/repositories`
- [Models](https://github.com/teamshiksha/openlogo/tree/stage/packages/app/models): mongo models · Collection schemas and persistence models for users, sessions, requests, images, subscriptions, and keys. · `packages/app/models`
- [Identity](https://github.com/teamshiksha/openlogo/blob/stage/packages/app/routes/auth.js): auth subsystem · Signup, signin, verification, MFA, sessions, reset password, API keys, and account utilities. · `packages/app/routes/auth.js`
- [Catalog](https://github.com/teamshiksha/openlogo/blob/stage/packages/app/routes/catalog.js): logo subsystem · Logo search, single-logo fetch, presigned uploads, metadata updates, permissions, and analytics. · `packages/app/routes/catalog.js`
- [Requests](https://github.com/teamshiksha/openlogo/blob/stage/packages/app/routes/createLogoRequest.js): workflow subsystem · User logo requests, request logs, operator tooling, and message handling. · `packages/app/routes/createLogoRequest.js`
- [AWS](https://github.com/teamshiksha/openlogo/tree/stage/packages/app/aws): cloud integration · CloudFront, presigned upload support, and CloudFormation deployment templates. · `packages/app/aws`

## Connections

- Repo ops → Docs: documents · Repo-level docs and collections describe usage and APIs.
- Repo ops → UI app: deploys · Frontend is built and deployed as a separate surface.
- Repo ops → API app: deploys · Backend has its own container and deployment workflow.
- UI app → Pages: renders · Application shell routes to page-level screens.
- UI app → Components: composes · Pages and shared screens are built from reusable components.
- UI app → State: uses · Contexts and hooks provide app-wide state and behavior.
- UI app → API client: calls · SPA reaches the backend through the API client layer.
- Pages → Account UI: includes · Account-related screens and settings live in the route layer.
- Pages → Catalog UI: includes · Catalog browsing and upload flows are page driven.
- Pages → Admin UI: includes · Operator dashboard screens support request handling.
- Pages → Logo tools: includes · Create-logo screens use the logo editing toolset.
- API app → Routes: mounts · Server wires route modules into the HTTP app.
- Routes → Controllers: dispatches · Routes delegate endpoint handling to controllers.
- Controllers → Services: orchestrates · Controllers call services for business workflows.
- Services → Repositories: reads/writes · Services access persistence through repositories.
- Repositories → Models: maps to · Repositories operate on Mongo-backed models.
- Identity → Services: uses · Identity endpoints rely on auth, session, MFA, and email services.
- Catalog → Services: uses · Catalog endpoints rely on image and catalog services.
- Requests → Services: uses · Request and operator endpoints rely on request and messaging services.
- Services → AWS: integrates · Upload flows, CloudFront helpers, and infrastructure connect to AWS.
- API client → API app: requests · Frontend HTTP client targets the Express API.
