Skip to content

Commit f77ac02

Browse files
committed
docs: Add comprehensive documentation for Custom Views in Pagoda
1 parent 0b45eaf commit f77ac02

File tree

1 file changed

+125
-1
lines changed

1 file changed

+125
-1
lines changed

docs/content/advanced/custom_view.md

+125-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,128 @@ title: CustomView
33
weight: 0
44
---
55

6-
(TBD)
6+
# Custom View
7+
8+
## Overview
9+
10+
Custom Views in Pagoda allow developers to extend the standard UI with their own React-based interfaces. This feature enables you to create specialized views that leverage Pagoda's core functionality while providing tailored user experiences for specific use cases.
11+
12+
By using Custom Views, you can build interfaces that:
13+
- Present data in specialized formats
14+
- Implement domain-specific workflows
15+
- Integrate with Pagoda's data model and ACL system
16+
- Provide alternative navigation or interaction patterns
17+
18+
## What You Can Do with Custom Views
19+
20+
Custom Views enable you to:
21+
22+
- **Create specialized interfaces**: Build custom dashboards, data visualizations, or domain-specific tools
23+
- **Integrate with Pagoda's core**: Access and manipulate data using Pagoda's data models and services
24+
- **Implement custom logic**: Add business logic specific to your use case
25+
- **Extend the UI**: Provide alternative ways to view and interact with your data
26+
27+
## Relationship with Pagoda Core
28+
29+
Custom Views are built as React applications that integrate with Pagoda through the `PagodaProvider` component. This provider gives your Custom View access to:
30+
31+
- Pagoda's data models (Entity-Attribute-Value pattern)
32+
- Authentication and authorization
33+
- Search capabilities
34+
- Other core services
35+
36+
The Pagoda Core (`@dmm-com/pagoda-core`) is bundled as a library that your Custom View can import and use, allowing you to focus on building your specific interface rather than reimplementing core functionality. This package is hosted on GitHub Registry at [https://github.com/dmm-com/pagoda/pkgs/npm/pagoda-core](https://github.com/dmm-com/pagoda/pkgs/npm/pagoda-core).
37+
38+
> **Note**: Since `@dmm-com/pagoda-core` is hosted on GitHub Registry, you'll need to configure npm to access GitHub packages. Make sure you have appropriate GitHub access and authentication set up before installing the package.
39+
40+
## Getting Started with Custom View Development
41+
42+
### Prerequisites
43+
44+
- Node.js (v16 or later)
45+
- npm (v7 or later)
46+
- Basic knowledge of React and TypeScript
47+
- GitHub access (for installing `@dmm-com/pagoda-core` from GitHub Registry)
48+
49+
### Step 1: Configure npm for GitHub Registry
50+
51+
Before installing dependencies, configure npm to access the GitHub Registry:
52+
53+
```bash
54+
# Create or edit .npmrc in your project root
55+
echo "@dmm-com:registry=https://npm.pkg.github.com" >> .npmrc
56+
57+
# Authenticate with GitHub (you'll need a personal access token with appropriate permissions)
58+
npm login --registry=https://npm.pkg.github.com --scope=@dmm-com
59+
```
60+
61+
### Step 2: Clone the Example Project
62+
63+
Start by cloning the example Custom View project:
64+
65+
```bash
66+
git clone https://github.com/syucream/pagoda-customview-example
67+
cd pagoda-customview-example
68+
```
69+
70+
### Step 3: Install Dependencies
71+
72+
Install the required dependencies:
73+
74+
```bash
75+
npm install
76+
```
77+
78+
### Step 4: Run the Development Server
79+
80+
Start the development server:
81+
82+
```bash
83+
npm run dev
84+
```
85+
86+
This will:
87+
- Start a local development server (typically at http://localhost:5173)
88+
- Enable hot module replacement for quick development
89+
- Watch for file changes and automatically rebuild
90+
91+
### Step 5: Understand the Project Structure
92+
93+
The example project demonstrates:
94+
- How to use the `PagodaProvider` to integrate with Pagoda
95+
- Basic project structure for a Custom View
96+
- How to access Pagoda's core functionality
97+
98+
### Step 6: Build Your Custom View
99+
100+
When building your own Custom View:
101+
102+
1. Wrap your application with `PagodaProvider`
103+
2. Use Pagoda's core services to access and manipulate data
104+
3. Implement your custom UI components
105+
4. Add any additional business logic specific to your use case
106+
107+
### Step 7: Build for Production
108+
109+
When ready to deploy:
110+
111+
```bash
112+
npm run build
113+
```
114+
115+
This will create a production-ready build of your Custom View that can be integrated with Pagoda.
116+
117+
## Development Notes
118+
119+
- The development server supports hot reloading - changes will be reflected immediately in the browser
120+
- TypeScript errors will be shown in both the terminal and browser console
121+
- The application integrates with Pagoda Core for base functionality
122+
123+
## Example Use Cases
124+
125+
- **Specialized Data Visualization**: Create custom charts or graphs for your data
126+
- **Domain-Specific Workflows**: Implement guided workflows for specific business processes
127+
- **Alternative Navigation**: Provide different ways to browse and search your data
128+
- **Integration with External Systems**: Connect Pagoda data with other systems or APIs
129+
130+
By leveraging Custom Views, you can extend Pagoda's capabilities while maintaining the benefits of its core data management and ACL systems.

0 commit comments

Comments
 (0)