# onlyup2219/timecafe architecture

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

- Interactive diagram: https://gitdiagram.com/onlyup2219/timecafe
- Repository: https://github.com/onlyup2219/timecafe

## Overview

TimeCafe is a microservice platform for operating time-cafes. Visitors and staff use the React app through a YARP gateway; the main journey covers authentication, profile setup, venue visits, visit billing, and optional online payment. The services also expose profile-photo moderation, venue catalog and promotion management, and administration/RBAC. The README documents the cross-service event flow and major integrations; sampled source confirms Auth startup wiring and exception auditing, but most service internals were not sampled, so their internal call relationships are omitted.

Main entry points: [`Services/YarpProxy/Program.cs`](https://github.com/onlyup2219/timecafe/blob/master/Services/YarpProxy/Program.cs) (YARP gateway), [`Services/Auth/Auth.TimeCafe.API/Endpoints`](https://github.com/onlyup2219/timecafe/tree/master/Services/Auth/Auth.TimeCafe.API/Endpoints) (Auth and RBAC), [`Services/UserProfile/UserProfile.TimeCafe.API`](https://github.com/onlyup2219/timecafe/tree/master/Services/UserProfile/UserProfile.TimeCafe.API) (User profiles), [`Services/Billing/Billing.TimeCafe.Application/CQRS`](https://github.com/onlyup2219/timecafe/tree/master/Services/Billing/Billing.TimeCafe.Application/CQRS) (Balances and transactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_web["React web app<br/>[App.tsx]"]
  node_gateway["YARP gateway<br/>[Program.cs]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth["Auth and RBAC<br/>[Endpoints]"]
  node_authdata[("Auth database")]
  node_communications["Email and SMS<br/>[Services]"]
  node_profile["User profiles"]
  node_profiledata[("Profile database")]
  node_photos["Photo storage"]
  node_moderation["Photo moderation"]
end

subgraph group_venue["Venue operations"]
  node_venueops["Tariffs, themes, promotions<br/>[CQRS]"]
  node_visits["Visit management<br/>[Visits]"]
  node_venuedata[("Venue database")]
end

subgraph group_billing["Billing and audit"]
  node_billing["Balances and transactions<br/>[CQRS]"]
  node_payments["Invoices and payments<br/>[Payments]"]
  node_billingdata[("Billing database")]
  node_audit["Audit log service<br/>[Program.cs]"]
  node_auditdata[("Audit database")]
end

subgraph group_platform["Shared infrastructure"]
  node_rabbit["RabbitMQ"]
  node_redis[("Redis cache")]
end

node_visitor(("Visitor / staff"))
node_s3[("S3 storage")]
node_sightengine["Sightengine"]
node_stripe["Stripe"]

node_visitor -->|"uses"| node_web
node_web -->|"API calls"| node_gateway
node_gateway -->|"routes"| node_auth
node_gateway -->|"routes"| node_profile
node_gateway -->|"routes"| node_venueops
node_gateway -->|"routes"| node_visits
node_gateway -->|"routes"| node_billing
node_gateway -->|"routes"| node_payments
node_auth -->|"reads / writes"| node_authdata
node_auth -->|"sends notifications"| node_communications
node_auth -->|"publishes registration"| node_rabbit
node_rabbit -->|"delivers registration"| node_profile
node_profile -->|"reads / writes"| node_profiledata
node_profile -->|"stores photos"| node_photos
node_photos -->|"uploads"| node_s3
node_profile -.->|"moderates photos"| node_moderation
node_moderation -->|"checks photos"| node_sightengine
node_venueops -->|"reads / writes"| node_venuedata
node_visits -->|"reads / writes"| node_venuedata
node_visits -->|"publishes visit events"| node_rabbit
node_rabbit -->|"delivers visit events"| node_billing
node_billing -->|"reads / writes"| node_billingdata
node_payments -->|"creates checkout"| node_stripe
node_billing -->|"caches reads"| node_redis
node_auth -->|"caches permissions"| node_redis
node_profile -->|"caches data"| node_redis
node_visits -.->|"requests billing"| node_billing
node_audit -.->|"stores logs"| node_auditdata
node_auth -.->|"publishes audit events"| node_audit

click node_web "https://github.com/onlyup2219/timecafe/blob/master/WebApp/timecafe.react.ui/src/App.tsx"
click node_gateway "https://github.com/onlyup2219/timecafe/blob/master/Services/YarpProxy/Program.cs"
click node_auth "https://github.com/onlyup2219/timecafe/tree/master/Services/Auth/Auth.TimeCafe.API/Endpoints"
click node_authdata "https://github.com/onlyup2219/timecafe/blob/master/Services/Auth/Auth.TimeCafe.Infrastructure/Data/ApplicationDbContext.cs"
click node_communications "https://github.com/onlyup2219/timecafe/tree/master/Services/Auth/Auth.TimeCafe.Infrastructure/Services"
click node_profile "https://github.com/onlyup2219/timecafe/tree/master/Services/UserProfile/UserProfile.TimeCafe.API"
click node_profiledata "https://github.com/onlyup2219/timecafe/tree/master/Services/UserProfile/UserProfile.TimeCafe.Infrastructure"
click node_photos "https://github.com/onlyup2219/timecafe/blob/master/Services/UserProfile/UserProfile.TimeCafe.Infrastructure/Services/S3ProfilePhotoStorage.cs"
click node_moderation "https://github.com/onlyup2219/timecafe/blob/master/Services/UserProfile/UserProfile.TimeCafe.Infrastructure/Services/SightenginePhotoModerationService.cs"
click node_venueops "https://github.com/onlyup2219/timecafe/tree/master/Services/Venue/Venue.TimeCafe.Application/CQRS"
click node_visits "https://github.com/onlyup2219/timecafe/tree/master/Services/Venue/Venue.TimeCafe.Application/CQRS/Visits"
click node_venuedata "https://github.com/onlyup2219/timecafe/tree/master/Services/Venue/Venue.TimeCafe.Infrastructure"
click node_billing "https://github.com/onlyup2219/timecafe/tree/master/Services/Billing/Billing.TimeCafe.Application/CQRS"
click node_payments "https://github.com/onlyup2219/timecafe/tree/master/Services/Billing/Billing.TimeCafe.Application/CQRS/Payments"
click node_billingdata "https://github.com/onlyup2219/timecafe/blob/master/Services/Billing/Billing.TimeCafe.Infrastructure/Data/ApplicationDbContext.cs"
click node_audit "https://github.com/onlyup2219/timecafe/blob/master/Services/Audit/Audit.TimeCafe.API/Program.cs"
click node_auditdata "https://github.com/onlyup2219/timecafe/blob/master/Services/Audit/Audit.TimeCafe.Infrastructure/Data/ApplicationDbContext.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_web,node_gateway toneBlue
class node_auth,node_authdata,node_communications,node_profile,node_profiledata,node_photos,node_moderation,node_s3 toneAmber
class node_venueops,node_visits,node_venuedata toneMint
class node_billing,node_payments,node_billingdata,node_audit,node_auditdata toneRose
class node_rabbit,node_redis,node_visitor,node_sightengine,node_stripe toneIndigo
```

## Components

### Client experience

- [React web app](https://github.com/onlyup2219/timecafe/blob/master/WebApp/timecafe.react.ui/src/App.tsx): `WebApp/timecafe.react.ui/src/App.tsx`
- [YARP gateway](https://github.com/onlyup2219/timecafe/blob/master/Services/YarpProxy/Program.cs): `Services/YarpProxy/Program.cs`

### Identity and profiles

- [Auth and RBAC](https://github.com/onlyup2219/timecafe/tree/master/Services/Auth/Auth.TimeCafe.API/Endpoints): `Services/Auth/Auth.TimeCafe.API/Endpoints`
- [Auth database](https://github.com/onlyup2219/timecafe/blob/master/Services/Auth/Auth.TimeCafe.Infrastructure/Data/ApplicationDbContext.cs): `Services/Auth/Auth.TimeCafe.Infrastructure/Data/ApplicationDbContext.cs`
- [Email and SMS](https://github.com/onlyup2219/timecafe/tree/master/Services/Auth/Auth.TimeCafe.Infrastructure/Services): `Services/Auth/Auth.TimeCafe.Infrastructure/Services`
- [User profiles](https://github.com/onlyup2219/timecafe/tree/master/Services/UserProfile/UserProfile.TimeCafe.API): `Services/UserProfile/UserProfile.TimeCafe.API`
- [Profile database](https://github.com/onlyup2219/timecafe/tree/master/Services/UserProfile/UserProfile.TimeCafe.Infrastructure): `Services/UserProfile/UserProfile.TimeCafe.Infrastructure`
- [Photo storage](https://github.com/onlyup2219/timecafe/blob/master/Services/UserProfile/UserProfile.TimeCafe.Infrastructure/Services/S3ProfilePhotoStorage.cs): `Services/UserProfile/UserProfile.TimeCafe.Infrastructure/Services/S3ProfilePhotoStorage.cs`
- [Photo moderation](https://github.com/onlyup2219/timecafe/blob/master/Services/UserProfile/UserProfile.TimeCafe.Infrastructure/Services/SightenginePhotoModerationService.cs): `Services/UserProfile/UserProfile.TimeCafe.Infrastructure/Services/SightenginePhotoModerationService.cs`

### Venue operations

- [Tariffs, themes, promotions](https://github.com/onlyup2219/timecafe/tree/master/Services/Venue/Venue.TimeCafe.Application/CQRS): `Services/Venue/Venue.TimeCafe.Application/CQRS`
- [Visit management](https://github.com/onlyup2219/timecafe/tree/master/Services/Venue/Venue.TimeCafe.Application/CQRS/Visits): `Services/Venue/Venue.TimeCafe.Application/CQRS/Visits`
- [Venue database](https://github.com/onlyup2219/timecafe/tree/master/Services/Venue/Venue.TimeCafe.Infrastructure): `Services/Venue/Venue.TimeCafe.Infrastructure`

### Billing and audit

- [Balances and transactions](https://github.com/onlyup2219/timecafe/tree/master/Services/Billing/Billing.TimeCafe.Application/CQRS): `Services/Billing/Billing.TimeCafe.Application/CQRS`
- [Invoices and payments](https://github.com/onlyup2219/timecafe/tree/master/Services/Billing/Billing.TimeCafe.Application/CQRS/Payments): `Services/Billing/Billing.TimeCafe.Application/CQRS/Payments`
- [Billing database](https://github.com/onlyup2219/timecafe/blob/master/Services/Billing/Billing.TimeCafe.Infrastructure/Data/ApplicationDbContext.cs): `Services/Billing/Billing.TimeCafe.Infrastructure/Data/ApplicationDbContext.cs`
- [Audit log service](https://github.com/onlyup2219/timecafe/blob/master/Services/Audit/Audit.TimeCafe.API/Program.cs): `Services/Audit/Audit.TimeCafe.API/Program.cs`
- [Audit database](https://github.com/onlyup2219/timecafe/blob/master/Services/Audit/Audit.TimeCafe.Infrastructure/Data/ApplicationDbContext.cs): `Services/Audit/Audit.TimeCafe.Infrastructure/Data/ApplicationDbContext.cs`

### Shared infrastructure

- **RabbitMQ**
- **Redis cache**

### Other components

- **Visitor / staff**
- **S3 storage**
- **Sightengine**
- **Stripe**

## Connections

- Visitor / staff → React web app: uses
- React web app → YARP gateway: API calls
- YARP gateway → Auth and RBAC: routes
- YARP gateway → User profiles: routes
- YARP gateway → Tariffs, themes, promotions: routes
- YARP gateway → Visit management: routes
- YARP gateway → Balances and transactions: routes
- YARP gateway → Invoices and payments: routes
- Auth and RBAC → Auth database: reads / writes
- Auth and RBAC → Email and SMS: sends notifications
- Auth and RBAC → RabbitMQ: publishes registration
- RabbitMQ → User profiles: delivers registration
- User profiles → Profile database: reads / writes
- User profiles → Photo storage: stores photos
- Photo storage → S3 storage: uploads
- User profiles → Photo moderation: moderates photos
- Photo moderation → Sightengine: checks photos (evidence: `Services/UserProfile/UserProfile.TimeCafe.Infrastructure/Services/SightenginePhotoModerationService.cs`)
- Tariffs, themes, promotions → Venue database: reads / writes
- Visit management → Venue database: reads / writes
- Visit management → RabbitMQ: publishes visit events
- RabbitMQ → Balances and transactions: delivers visit events
- Balances and transactions → Billing database: reads / writes
- Invoices and payments → Stripe: creates checkout
- Balances and transactions → Redis cache: caches reads
- Auth and RBAC → Redis cache: caches permissions
- User profiles → Redis cache: caches data
- Visit management → Balances and transactions: requests billing
- Audit log service → Audit database: stores logs
- Auth and RBAC → Audit log service: publishes audit events
