Skip to content

Commit 4648c48

Browse files
pinkroosteraiclaude
andcommitted
docs: update architecture diagrams and guides for Valkey cache
Add Valkey to architecture diagrams in README.md and docs/architecture.md. Add VALKEY_URL to configuration.md environment variables table. Update deployment-guide.md service count (3→4) with Valkey description. Update development-setup.md to mention Valkey startup and localhost:6379. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 9441cd2 commit 4648c48

5 files changed

Lines changed: 24 additions & 19 deletions

File tree

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,19 @@ Clarive focuses on **prompt authoring, refinement, and team management**. If you
136136

137137
## Architecture
138138

139-
One container: nginx serves the frontend and proxies `/api/` to the .NET backend.
139+
One container: nginx serves the frontend and proxies `/api/` to the .NET backend. PostgreSQL and Valkey run as separate Docker services.
140140

141141
```
142142
:8080 (nginx)
143143
┌─────────────────────────────────┐ ┌──────────────┐
144144
│ Clarive Container │ │ PostgreSQL │
145145
│ ┌──────────┐ ┌────────────┐ │────▶│ 16 │
146-
│ │ nginx │──▶│ .NET 10 API│ │ │ │
147-
│ │ (frontend)│ │ (backend) │ │ └──────────────┘
148-
│ └──────────┘ └────────────┘ │
149-
│ supervisor │
150-
└─────────────────────────────────┘
146+
│ │ nginx │──▶│ .NET 10 API│ │ └──────────────┘
147+
│ │ (frontend)│ │ (backend) │ │
148+
│ └──────────┘ └────────────┘ │────▶┌──────────────┐
149+
│ supervisor │ │ Valkey 8 │
150+
└─────────────────────────────────┘ │ (cache) │
151+
└──────────────┘
151152
```
152153

153154
For the full tech stack, project structure, and design details, see [docs/architecture.md](docs/architecture.md).

docs/architecture.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
Clarive is a multi-tenant platform for managing, versioning, and AI-enhancing LLM prompts. A React frontend talks to a C# backend, backed by PostgreSQL. Everything ships as a single container.
5+
Clarive is a multi-tenant platform for managing, versioning, and AI-enhancing LLM prompts. A React frontend talks to a C# backend, backed by PostgreSQL and Valkey. Everything ships as a single container with separate database and cache services.
66

77
## System Diagram
88

@@ -20,16 +20,16 @@ Clarive is a multi-tenant platform for managing, versioning, and AI-enhancing LL
2020
│ (React) │ │ (ASP.NET) │
2121
└──────────┘ └─────┬─────┘
2222
23-
┌─────────────┼─────────────┐
24-
│ │
25-
┌─────▼─────┐ ┌───▼────┐ ┌────────────┐
26-
│ PostgreSQL │ │ AI │ │ Google │
27-
16 │ │ (OpenAI │ │ OAuth │
28-
│ │ │ compat) │ │ │
29-
└────────────┘ └─────────┘ └─────────────┘
23+
┌────────────┬───┴───┬─────────────┐
24+
│ │
25+
┌─────▼─────┐ ┌───▼───┐ ┌─▼───────┐ ┌────────────┐
26+
│ PostgreSQL │ │Valkey │ │ AI │ │ Google │
27+
16 │ │ 8 │ │ (OpenAI │ │ OAuth │
28+
│ │(cache)│ │ compat) │ │ │
29+
└────────────┘ └───────┘ └─────────┘ └─────────────┘
3030
```
3131

32-
Nginx serves the React build and proxies `/api/` to the .NET backend. Supervisor manages both processes inside the container.
32+
Nginx serves the React build and proxies `/api/` to the .NET backend. Supervisor manages both processes inside the container. PostgreSQL and Valkey run as separate Docker services.
3333

3434
## Tech Stack
3535

@@ -40,11 +40,12 @@ Nginx serves the React build and proxies `/api/` to the .NET backend. Supervisor
4040
| Backend | C# ASP.NET Core 10 Minimal APIs |
4141
| ORM | EF Core 10 (Npgsql) with 25 entity configurations |
4242
| Database | PostgreSQL 16 with EF Core migrations |
43+
| Cache | Valkey 8 (distributed cache with AOF persistence), tenant-scoped TenantCacheService |
4344
| Auth | JWT (15-min access) + rotating refresh tokens (7-day), Google OIDC, API keys |
4445
| AI | Any OpenAI-compatible provider via Microsoft.Extensions.AI, agent-based orchestration |
4546
| Search | Tavily web search integration for research-backed generation |
4647
| Testing | xUnit + Testcontainers (backend), Vitest (frontend unit), Playwright (E2E) |
47-
| Infra | Docker Compose, Makefile (35+ commands), single unified container |
48+
| Infra | Docker Compose (app + PostgreSQL + Valkey), Makefile (35+ commands) |
4849

4950
## Components
5051

docs/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ These are the only settings you need in your `.env` file. Run `make setup` to ge
3131
| `JWT_ISSUER` | JWT issuer claim | `Clarive` |
3232
| `JWT_AUDIENCE` | JWT audience claim | `Clarive` |
3333
| `ASPNETCORE_ENVIRONMENT` | ASP.NET environment | `Production` |
34+
| `VALKEY_URL` | Valkey cache connection (host:port) | `valkey:6379` |
3435

3536
> **Note:** `CORS_ORIGINS` is the only application setting that requires a container restart. Everything else can be changed at runtime through the dashboard.
3637

docs/deployment-guide.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ make db-reset # Destroy all database volumes (with confi
6161

6262
## Docker Architecture
6363

64-
The compose file (`deploy/docker-compose.yml`) defines three services:
64+
The compose file (`deploy/docker-compose.yml`) defines four services:
6565

6666
- **postgres** — PostgreSQL 16 with health check
67+
- **valkey** — Valkey 8 cache with AOF persistence, 256MB maxmemory, allkeys-lru eviction
6768
- **backend** — ASP.NET Core API (internal port 5000, not exposed to host)
6869
- **frontend** — React app served by nginx (port 8080), proxies `/api/` to backend
6970

70-
All services communicate over Docker's default network. Only port 8080 is exposed to the host.
71+
All services communicate over Docker's default network. Only port 8080 is exposed to the host. Valkey and PostgreSQL are internal-only.
7172

7273
```
7374
Browser → :8080 (nginx)

docs/development-setup.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ Development runs entirely in Docker with hot reload. No local SDKs needed.
1717
git clone https://github.com/pinkroosterai/Clarive.git
1818
cd Clarive
1919
make setup # generates .env with dev defaults
20-
make dev # starts postgres, backend, and frontend with hot reload
20+
make dev # starts postgres, valkey, backend, and frontend with hot reload
2121
```
2222

2323
Open **http://localhost:8080**. The Vite dev server proxies `/api/` requests to the backend.
2424

2525
- Frontend hot reloads via Vite HMR
2626
- Backend hot reloads via `dotnet watch`
2727
- PostgreSQL is accessible on `localhost:5433` (mapped from container port 5432)
28+
- Valkey cache is accessible on `localhost:6379`
2829

2930
## Building from Source
3031

0 commit comments

Comments
 (0)