Skip to content

Commit d1d11e8

Browse files
Reorganize Strapi/Redis/Medusa/Algolia documentation (#473)
* feat: cms integrations improvements * feat: integrations docs improvement * docs: update theming, update starters page * feat: update readme * feat: code reveiw improvemnet * docs: additional resources and information on the default theme * docs: update environment variable table formatting in Medusa.js overview * docs: improve Redis setup instructions and formatting in how-to-setup.md * docs: update local installation instructions for Redis in how-to-setup.md * docs: update features overview for SurveyJS integration, including planned ticket system integration * docs: enhance SurveyJS features documentation * docs: update code block syntax for theme file path in css-themes.md * docs: update Redis configuration docs, fix tables, add Contentful theming guide --------- Co-authored-by: Michal Nowak <michal.nowak@hycom.pl>
1 parent 8f39c25 commit d1d11e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4418
-776
lines changed

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Its flexibility allows for many customizations and lets you build various types
1313
- **Next.js Frontend Starter** – Robust Next.js-based frontend including basic customer portal pages and content management capabilities.
1414
- **API Harmonization Server****Integration layer** for data aggregation, orchestration and normalization. Provides vendor lock-in safeness and better maintainability.
1515
- **TypeScript SDK** – Easily interact with the Harmonization Server in the frontend app or any web, mobile, other TS-based apps.
16+
- **Pre-built Blocks** – 25+ ready-to-use UI blocks with backend logic and SDK clients. Self-contained, reusable components for common features.
1617
- **Pre-built Integrations** – Ready integrations so that you can set up your solution faster.
1718
- **Extensibility** – Customize UI components, add new pages, add new API integrations, adapt to your needs.
1819

@@ -53,31 +54,49 @@ O2S follows a **monorepo structure** using **Turborepo** for managing apps and i
5354

5455
```sh
5556
/apps
56-
/frontend # Next.js frontend
57+
/frontend # Next.js frontend application
5758
/api-harmonization # API Harmonization Server (NestJS)
59+
/docs # Documentation site (Docusaurus)
5860

5961
/packages
60-
/ui # UI component library (shadcn/ui, Tailwind)
62+
/blocks/* # Reusable UI blocks (25+ blocks)
63+
/framework # Core framework modules & SDK
64+
/integrations/* # Integration adapters (Strapi, Contentful, Redis, Algolia, Medusa, Zendesk, mocked)
65+
/modules/* # Feature modules (e.g., surveyjs)
66+
/ui # Base UI component library (shadcn/ui + Tailwind)
67+
/utils/* # Utility packages
68+
/configs/* # Shared configurations
69+
/cli/* # CLI tools (create-o2s-app)
70+
/telemetry # Telemetry package
6171
```
6272

6373
For a detailed breakdown, visit **[Project structure](https://www.openselfservice.com/docs/getting-started/project-structure)**.
6474

6575
## 🖥️ Demo app
6676
[![O2S Demo](apps/docs/static/img/o2s-gh-demo.png)](https://demo.openselfservice.com)
6777

78+
## 🧩 Blocks
79+
80+
O2S includes **25+ pre-built blocks** - self-contained, reusable UI components that represent specific features or page sections. Each block includes backend logic (NestJS), frontend component (React), and SDK client.
81+
82+
Examples: article, article-list, ticket-list, order-details, invoice-list, user-account, and more.
83+
84+
For details, visit **[Blocks documentation](https://www.openselfservice.com/docs/main-components/blocks)**.
85+
6886
## 🔌 Available Integrations
6987

7088
O2S includes pre-built integrations and allows you to extend functionality as needed.
7189

7290
| Integration type/area | Status |
7391
|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------|
74-
| **CMS** |**StrapiCMS** - available<br/> 🔄 **Contentful** - in progress |
92+
| **CMS** |**StrapiCMS** - available<br/> **Contentful** - available |
7593
| **IAM** |**Auth.js** - available<br/> ✅ **Keycloak** - available (not part of O2S, contact us for details) |
7694
| **Cache** |**Redis** - available |
7795
| **Search** |**Algolia** - available |
78-
| **CRM** |**SurveyJS** - ticket submission handling<br/> 🔄 **other CRM solutions** - planned |
96+
| **CRM** |**Zendesk** - available (tickets)<br/> ✅ **SurveyJS** - ticket submission handling<br/> 🔄 **other CRM solutions** - planned |
7997
| **ERP** |**Medusa** - via Medusa plugin adding ERP-like features<br/>🔄 **SAP S/4HANA** - In progress (not part of O2S, contact us for details) |
8098
| **Commerce** | 🔄 **Medusa** - in progress (basic product information, other areas TBD) |
99+
| **Development** |**Mocked** - available (for local development and testing) |
81100

82101

83102
## 🔥 Why Open Self Service?

apps/docs/docs/app-starters/dxp/blocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ For a full list of available blocks, together with their configuration, variants
2323

2424
Each block has its own CMS content type defined so that composing pages using blocks is quite straightforward. To use them in your own CMS, take a look into our CMS integrations, where we have prepared ready-to-use exports:
2525

26-
- resources for [Strapi CMS](../../integrations/cms/strapi/getting-started.md)
26+
- resources for [Strapi CMS](../../integrations/cms/strapi/how-to-setup.md)
2727

2828
## Storybook
2929

apps/docs/docs/app-starters/o2s/blocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For a full list of available blocks, together with their configuration, variants
2626

2727
Each block has its own CMS content type defined so that composing pages using blocks is quite straightforward. To use them in your own CMS, take a look into our CMS integrations, where we have prepared ready-to-use exports:
2828

29-
- resources for [Strapi CMS](../../integrations/cms/strapi/getting-started.md)
29+
- resources for [Strapi CMS](../../integrations/cms/strapi/how-to-setup.md)
3030

3131
## Storybook
3232

apps/docs/docs/integrations/cache/redis.md

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"label": "Redis",
3+
"position": 100,
4+
"link": {
5+
"type": "doc",
6+
"id": "overview"
7+
}
8+
}
9+
10+
11+
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
sidebar_position: 200
3+
---
4+
5+
# Features
6+
7+
## Overview
8+
9+
| Feature | Status | Notes |
10+
|---------|--------|-------|
11+
| Cache Operations || get, set, del |
12+
| TTL Management || Automatic key expiration |
13+
| Conditional Caching || Toggle via CACHE_ENABLED |
14+
| Error Handling || Graceful fallback on failures |
15+
| Framework Integration || Implements Cache.Service |
16+
| CMS Integration || Used by Strapi/Contentful |
17+
18+
## Cache operations
19+
20+
```typescript
21+
interface CacheService {
22+
get(key: string): Promise<string | undefined>;
23+
set(key: string, value: string): Promise<void>;
24+
del(key: string): Promise<void>;
25+
}
26+
```
27+
28+
All operations are no-ops when `CACHE_ENABLED=false` or Redis is unavailable.
29+
30+
## TTL management
31+
32+
- All keys expire after `CACHE_TTL` seconds (default: 300)
33+
- Each key has independent expiration based on when it was set
34+
- No manual TTL management required
35+
36+
## Connection behavior
37+
38+
- Connection established only when `CACHE_ENABLED=true`
39+
- No automatic reconnection on connection loss (restart required)
40+
- All errors are logged but don't crash the application
41+
42+
## CMS integration
43+
44+
CMS integrations cache content using consistent key patterns:
45+
46+
```text
47+
component-{id}-{locale}
48+
page-{id}-{locale}
49+
app-config-{locale}
50+
```
51+
52+
Cache flow:
53+
1. Check cache for content
54+
2. If cached → return immediately
55+
3. If not cached → fetch from CMS API → store in cache → return
56+
57+
## Limitations
58+
59+
- **No auto-reconnection**: Restart required if connection lost
60+
- **String values only**: Objects must be serialized (JSON.stringify or flatted)
61+
- **No tag-based invalidation**: Keys must be deleted manually
62+
- **Single instance**: No built-in Sentinel/Cluster support
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
sidebar_position: 150
3+
---
4+
5+
# How to set up
6+
7+
## Install
8+
9+
```shell
10+
npm install @o2s/integrations.redis --workspace=@o2s/api
11+
```
12+
13+
## Set up Redis instance
14+
15+
You need to set up your own Redis instance. We do not provide a Docker configuration for Redis. For detailed installation and setup instructions, refer to the [official Redis documentation](https://redis.io/docs/).
16+
17+
### Local installation
18+
19+
For local installation instructions, refer to the [official Redis installation guide](https://redis.io/docs/latest/operate/oss_and_stack/install/archive/install-redis/).
20+
21+
### Production
22+
23+
Consider managed services: [Redis Cloud](https://redis.com/cloud), [AWS ElastiCache](https://aws.amazon.com/elasticache/), [Azure Cache](https://azure.microsoft.com/services/cache/), [Google Memorystore](https://cloud.google.com/memorystore).
24+
25+
## Configuration
26+
27+
After installing the package, you need to configure the integration in the `@o2s/configs.integrations` package. This tells the framework to use Redis Cache instead of the default mocked integration.
28+
29+
### Step 1: Update the cache integration config
30+
31+
Open the file `packages/configs/integrations/src/models/cache.ts` and replace the import:
32+
33+
**Before (using mocked integration):**
34+
35+
```typescript
36+
import { Config, Integration } from '@o2s/integrations.mocked/integration';
37+
```
38+
39+
**After (using Redis Cache integration):**
40+
41+
```typescript
42+
import { Config, Integration } from '@o2s/integrations.redis/integration';
43+
```
44+
45+
The complete file should look like this:
46+
47+
```typescript
48+
import { Config, Integration } from '@o2s/integrations.redis/integration';
49+
50+
import { ApiConfig } from '@o2s/framework/modules';
51+
52+
export const CacheIntegrationConfig: ApiConfig['integrations']['cache'] = Config.cache!;
53+
54+
export import Service = Integration.Cache.Service;
55+
```
56+
57+
### Step 2: Verify AppConfig
58+
59+
The `AppConfig` in `apps/api-harmonization/src/app.config.ts` should already reference `Cache.CacheIntegrationConfig`. You don't need to modify this file - it automatically uses the configuration from `@o2s/configs.integrations`.
60+
61+
## Configure environment variables
62+
63+
```env
64+
CACHE_ENABLED=true
65+
CACHE_TTL=3600
66+
CACHE_REDIS_HOST=localhost
67+
CACHE_REDIS_PORT=6379
68+
CACHE_REDIS_PASS=REDIS_PASS
69+
```
70+
71+
### TTL recommendations
72+
73+
- **Short (300-1800s)**: Frequently changing data
74+
- **Medium (1800-7200s)**: CMS content, API responses
75+
- **Long (7200-86400s)**: Static configuration
76+
77+
## Verify connection
78+
79+
Start the API Harmonization server. Successful connection logs:
80+
81+
```log
82+
[REDIS] Successfully connected to redis
83+
```
84+
85+
Test manually:
86+
87+
```shell
88+
redis-cli -h localhost -p 6379 -a REDIS_PASS ping
89+
# Expected: PONG
90+
```
91+
92+
## Troubleshooting
93+
94+
| Problem | Solution |
95+
| ----------------------- | ----------------------------------------------- |
96+
| Cannot connect | Verify Redis is running: `redis-cli ping` |
97+
| Authentication failed | Check `CACHE_REDIS_PASS` matches Redis password |
98+
| Cache returns undefined | Verify `CACHE_ENABLED=true` |
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
sidebar_position: 100
3+
---
4+
5+
# Redis Cache
6+
7+
This integration provides caching capabilities using [Redis](https://redis.io/). It implements the framework's `Cache.Service` interface and is used by CMS integrations (Strapi, Contentful) to cache pages, components, and configuration.
8+
9+
## In this section
10+
11+
- [How to set up](./how-to-setup.md) - Installation and configuration guide
12+
- [Features](./features.md) - Capabilities and cache operations
13+
- [Usage](./usage.md) - Examples and best practices
14+
15+
## Installation
16+
17+
```shell
18+
npm install @o2s/integrations.redis --workspace=@o2s/api
19+
```
20+
21+
## Environment variables
22+
23+
| name | type | description | required | default |
24+
|------------------|---------|-------------------------------------|----------|---------|
25+
| CACHE_ENABLED | boolean | enables/disables cache | no | false |
26+
| CACHE_TTL | number | key expiration time (seconds) | no | 300 |
27+
| CACHE_REDIS_HOST | string | Redis host | yes | - |
28+
| CACHE_REDIS_PORT | number | Redis port | yes | - |
29+
| CACHE_REDIS_PASS | string | Redis password | no | - |
30+
31+
## Quick start
32+
33+
1. Install the package
34+
2. Set up a Redis instance (see [How to set up](./how-to-setup.md))
35+
3. Configure environment variables
36+
4. Set `CACHE_ENABLED=true`

0 commit comments

Comments
 (0)