Skip to content

Commit e8a8136

Browse files
authored
feat: Storybook (#215)
* feat: integrate Storybook into the project - Updated ESLint configuration to extend Storybook recommendations. - Added Storybook-related entries to .gitignore to exclude log files and static builds. - Enhanced package.json with new Storybook scripts for development and building. - Updated pnpm-lock.yaml to include new Storybook dependencies. - Refactored the Home component to redirect to the Storybook introduction page. * feat: enhance README with new features and Storybook integration - Added Storybook badge and documentation for component development. - Expanded feature list to include visual page builder, Docker support, and development tools. - Updated project overview with new dependencies and improved descriptions. - Removed outdated src/README.md file to streamline documentation. * feat: enhance README and CI/CD integration for Storybook - Added detailed CI/CD integration section in README, outlining automatic building, testing, Docker deployment, and artifact storage. - Updated access instructions for Storybook in development and Docker environments. - Included a new job in the Docker workflow to build Storybook during CI processes. - Removed outdated blog posts and authors from the documentation to streamline content. * chore: remove Storybook testing step from CI workflow - Eliminated the 'Test Storybook' step from the GitHub Actions workflow to streamline the CI process. - Updated package.json to remove the 'test-storybook' script, reflecting the changes in the CI configuration. * refactor: remove TestCarouselPage component - Deleted the TestCarouselPage component from the test-carousel directory to streamline the codebase. - This component was previously used for testing the CarouselBlock but is no longer necessary.
1 parent 5c50b36 commit e8a8136

65 files changed

Lines changed: 6711 additions & 4367 deletions

Some content is hidden

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

.github/workflows/docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ jobs:
6262

6363
- name: Build
6464
run: pnpm run build
65+
- name: Build Storybook
66+
run: pnpm run build-storybook
6567
- name: Bump version and release
6668
env:
6769
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/storybook.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Storybook CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths:
7+
- "src/**/*.stories.@(js|jsx|ts|tsx)"
8+
- "src/**/*.mdx"
9+
- "src/.storybook/**"
10+
- "src/components/**"
11+
- "src/stories/**"
12+
pull_request:
13+
branches: [ "main" ]
14+
paths:
15+
- "src/**/*.stories.@(js|jsx|ts|tsx)"
16+
- "src/**/*.mdx"
17+
- "src/.storybook/**"
18+
- "src/components/**"
19+
- "src/stories/**"
20+
21+
jobs:
22+
storybook:
23+
defaults:
24+
run:
25+
working-directory: ./src
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Install Node.js
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: 22
38+
39+
- uses: pnpm/action-setup@v2
40+
name: Install pnpm
41+
id: pnpm-install
42+
with:
43+
version: 9
44+
run_install: false
45+
46+
- name: Get pnpm store directory
47+
id: pnpm-cache
48+
shell: bash
49+
run: |
50+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
51+
52+
- uses: actions/cache@v3
53+
name: Setup pnpm cache
54+
with:
55+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
56+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
57+
restore-keys: |
58+
${{ runner.os }}-pnpm-store-
59+
60+
- name: Install dependencies
61+
run: pnpm install
62+
63+
- name: Build Storybook
64+
run: pnpm run build-storybook
65+
66+
- name: Upload Storybook build artifacts
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: storybook-static
70+
path: src/storybook-static
71+
retention-days: 30
72+
73+
storybook-docker:
74+
defaults:
75+
run:
76+
working-directory: ./src
77+
runs-on: ubuntu-latest
78+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
79+
needs: storybook
80+
81+
steps:
82+
- name: Checkout
83+
uses: actions/checkout@v4
84+
85+
- name: Log in to GitHub Container Registry
86+
uses: docker/login-action@v3
87+
with:
88+
registry: ghcr.io
89+
username: ${{ github.actor }}
90+
password: ${{ secrets.GITHUB_TOKEN }}
91+
92+
- name: Set up Docker Buildx
93+
uses: docker/setup-buildx-action@v3
94+
95+
- name: Build and push Storybook Docker image
96+
uses: docker/build-push-action@v4
97+
with:
98+
context: ./src
99+
file: ./src/Dockerfile.storybook
100+
push: true
101+
tags: |
102+
ghcr.io/${{ github.repository }}/storybook:latest
103+
ghcr.io/${{ github.repository }}/storybook:${{ github.sha }}
104+
cache-from: type=gha
105+
cache-to: type=gha,mode=max
106+
107+

README.md

Lines changed: 150 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
[![Next.js](https://img.shields.io/badge/Next.js-black?style=flat&logo=next.js&logoColor=white)](https://nextjs.org/)
66
[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
77
[![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-38B2AC?style=flat&logo=tailwind-css&logoColor=white)](https://tailwindcss.com/)
8+
[![Storybook](https://img.shields.io/badge/Storybook-FF4785?style=flat&logo=storybook&logoColor=white)](https://storybook.js.org/)
89

9-
A modern, high-performance React UI implementation for the [ABP Framework](https://abp.io/). This project serves as a drop-in replacement for the default Angular UI, offering improved performance, better SEO capabilities, and a more modern development experience.
10+
A modern, high-performance React UI implementation for the [ABP Framework](https://abp.io/). This project serves as a drop-in replacement for the default Angular UI, offering improved performance, better SEO capabilities, and a more modern development experience with advanced features like visual page building and component documentation.
1011

1112
## 📋 Table of Contents
1213

@@ -20,6 +21,9 @@ A modern, high-performance React UI implementation for the [ABP Framework](https
2021
- [Configuration](#configuration)
2122
- [Running the Project](#running-the-project)
2223
- [📚 Project Overview](#-project-overview)
24+
- [🎨 Visual Page Builder](#-visual-page-builder)
25+
- [📖 Storybook](#-storybook)
26+
- [🐳 Docker Support](#-docker-support)
2327
- [📊 Performance](#-performance)
2428
- [🤝 Contributing](#-contributing)
2529
- [💬 Support](#-support)
@@ -34,15 +38,17 @@ Check out the live demo at [https://abpreact.antosubash.com/](https://abpreact.a
3438
## ✨ Features
3539

3640
- 🎨 **Modern UI/UX**
37-
- Responsive design
41+
- Responsive design with Tailwind CSS v4
3842
- Dark/Light theme support
39-
- Tailwind CSS styling
43+
- Modern component library with Radix UI
44+
- Beautiful animations and transitions
4045

4146
- 🔐 **Authentication & Authorization**
4247
- Login/Logout functionality
4348
- User registration
4449
- Password recovery
4550
- Role-based access control
51+
- OpenID Connect support
4652

4753
- 🌐 **Multi-tenant Support**
4854
- Tenant management
@@ -55,11 +61,26 @@ Check out the live demo at [https://abpreact.antosubash.com/](https://abpreact.a
5561
- Permission management
5662
- Profile management
5763

64+
- 📝 **Content Management System (CMS)**
65+
- Visual page builder with Puck editor
66+
- Drag-and-drop interface
67+
- Rich text editing
68+
- Component library
69+
- Page templates and layouts
70+
5871
- ⚙️ **System Features**
5972
- Multilingual support
6073
- Theme customization
6174
- Settings management
6275
- Feature management
76+
- Email configuration
77+
78+
- 🧪 **Development Tools**
79+
- Storybook for component documentation
80+
- TypeScript for type safety
81+
- ESLint and Prettier for code quality
82+
- Husky for git hooks
83+
- Vitest for testing
6384

6485
## 🚀 Getting Started
6586

@@ -122,20 +143,123 @@ pnpm install
122143
pnpm dev
123144
```
124145

146+
4. (Optional) Start Storybook for component development:
147+
148+
```bash
149+
pnpm storybook
150+
```
151+
125152
## 📚 Project Overview
126153

127154
ABP React is built with modern web technologies:
128155

129-
- [Next.js](https://nextjs.org/) - React framework for production
156+
- [Next.js 15](https://nextjs.org/) - React framework for production
130157
- [TypeScript](https://www.typescriptlang.org/) - Type-safe JavaScript
131-
- [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework
158+
- [Tailwind CSS v4](https://tailwindcss.com/) - Utility-first CSS framework
159+
- [Radix UI](https://www.radix-ui.com/) - Accessible component primitives
160+
- [TanStack Query](https://tanstack.com/query) - Data fetching and caching
161+
- [React Hook Form](https://react-hook-form.com/) - Form management
162+
- [Zod](https://zod.dev/) - Schema validation
132163

133164
The project aims to provide a production-ready React UI for ABP Framework applications, focusing on:
134165

135166
- Performance optimization
136167
- SEO friendliness
137168
- Modern development experience
138169
- Full ABP Framework integration
170+
- Visual content creation
171+
172+
## 🎨 Visual Page Builder
173+
174+
ABP React includes a powerful visual page builder powered by [Puck](https://measured.co/puck):
175+
176+
- **Drag-and-Drop Interface**: Create pages visually without coding
177+
- **Component Library**: Pre-built components for common UI patterns
178+
- **Responsive Design**: Built-in responsive design tools
179+
- **Real-time Preview**: See changes instantly as you build
180+
- **Template System**: Save and reuse page layouts
181+
182+
### Available Components
183+
184+
- Hero sections
185+
- Text blocks and headings
186+
- Image galleries and carousels
187+
- Cards and containers
188+
- Buttons and forms
189+
- Grid layouts and spacers
190+
- And many more...
191+
192+
## 📖 Storybook
193+
194+
The project includes comprehensive component documentation with Storybook:
195+
196+
```bash
197+
# Start Storybook development server
198+
pnpm storybook
199+
200+
# Build Storybook for production
201+
pnpm build-storybook
202+
203+
# Run Storybook tests
204+
pnpm test-storybook
205+
```
206+
207+
Storybook provides:
208+
- Interactive component documentation
209+
- Component testing and validation
210+
- Design system guidelines
211+
- Accessibility testing
212+
- Visual regression testing
213+
214+
### CI/CD Integration
215+
216+
Storybook is fully integrated into the CI/CD pipeline:
217+
218+
- **Automatic Building**: Storybook is built on every push to main and pull request
219+
- **Testing**: Storybook tests run automatically to ensure component quality
220+
- **Docker Deployment**: Storybook is containerized and deployed to GitHub Container Registry
221+
- **Artifact Storage**: Storybook build artifacts are stored for 30 days
222+
223+
#### CI Workflow Features:
224+
225+
1. **Storybook Build Job**: Builds and tests Storybook on every change
226+
2. **Docker Image**: Creates and pushes Storybook Docker image to GHCR
227+
228+
#### Accessing Storybook:
229+
230+
- **Development**: `http://localhost:6006` (run `pnpm storybook`)
231+
- **Docker**: `http://localhost:80` (run `docker run -p 80:80 ghcr.io/your-repo/storybook:latest`)
232+
- **CI Artifacts**: Download Storybook build artifacts from GitHub Actions
233+
234+
## 🐳 Docker Support
235+
236+
ABP React includes Docker support for easy deployment:
237+
238+
### Main Application
239+
240+
```bash
241+
# Build the application
242+
docker build -t abp-react .
243+
244+
# Run the application
245+
docker run -p 3000:3000 abp-react
246+
```
247+
248+
### Storybook
249+
250+
```bash
251+
# Build Storybook
252+
docker build -f Dockerfile.storybook -t abp-react-storybook .
253+
254+
# Run Storybook
255+
docker run -p 80:80 abp-react-storybook
256+
```
257+
258+
The Docker setup includes:
259+
- Multi-stage builds for optimization
260+
- Nginx configuration for production
261+
- Security headers and caching
262+
- Non-root user execution
139263

140264
## 📊 Performance
141265

@@ -161,6 +285,25 @@ Please ensure your code:
161285
- Updates documentation as needed
162286
- Passes all CI checks
163287

288+
### Development Scripts
289+
290+
```bash
291+
# Development
292+
pnpm dev # Start development server
293+
pnpm build # Build for production
294+
pnpm start # Start production server
295+
pnpm lint # Run ESLint
296+
pnpm format # Format code with Prettier
297+
298+
# Storybook
299+
pnpm storybook # Start Storybook
300+
pnpm build-storybook # Build Storybook
301+
pnpm test-storybook # Test Storybook
302+
303+
# API Generation
304+
pnpm gen-api # Generate API client from OpenAPI spec
305+
```
306+
164307
## 💬 Support
165308

166309
For support, please:
@@ -182,6 +325,8 @@ Special thanks to:
182325
- [Next.js](https://nextjs.org/) - The framework
183326
- [TypeScript](https://www.typescriptlang.org/) - The language
184327
- [Tailwind CSS](https://tailwindcss.com/) - The styling
328+
- [Puck](https://measured.co/puck) - The visual page builder
329+
- [Storybook](https://storybook.js.org/) - The component documentation
185330

186331
## 👥 Contributors
187332

docs/blog/2019-05-28-first-blog-post.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
---
22
slug: first-blog-post
33
title: First Blog Post
4-
authors:
5-
name: Gao Wei
6-
title: Docusaurus Core Team
7-
url: https://github.com/wgao19
8-
image_url: https://github.com/wgao19.png
94
tags: [hola, docusaurus]
105
---
116

0 commit comments

Comments
 (0)