Skip to content

Commit a21c693

Browse files
authored
Merge pull request #200 from linuxfoundation/agaete/backstage-docs
fix(docs): copy README into docs/index.md
2 parents 0210ee6 + ed4e636 commit a21c693

File tree

1 file changed

+356
-1
lines changed

1 file changed

+356
-1
lines changed

docs/index.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/index.md

Lines changed: 356 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,356 @@
1+
# LFX One
2+
3+
This is a monorepo for the LFX One application, built
4+
with Angular 19 and experimental zoneless change detection.
5+
6+
## What's inside?
7+
8+
### Apps and Packages
9+
10+
- `apps/lfx-one`: Angular 19 SSR application with zoneless change detection and
11+
direct PrimeNG UI components
12+
13+
The app is 100% [TypeScript](https://www.typescriptlang.org/).
14+
15+
### Architecture
16+
17+
- **Frontend**: Angular 19 with experimental zoneless change detection, Angular
18+
Signals, PrimeNG components, Tailwind CSS
19+
- **UI Framework**: PrimeNG 19 with custom LFX UI Core preset and Tailwind CSS integration
20+
- **Styling**: Tailwind CSS v3 with PrimeUI plugin, CSS layers architecture,
21+
Google Fonts (Open Sans + Roboto Slab)
22+
- **Icons**: Font Awesome Pro via kits (no npm packages)
23+
- **Backend**: Express.js server with Angular 19 SSR, Auth0 authentication, Pino logging
24+
- **Infrastructure**: PM2 process management for production deployment
25+
26+
### Development Tools
27+
28+
This has comprehensive development tooling:
29+
30+
- **[TypeScript](https://www.typescriptlang.org/)** for static type checking with strict configuration
31+
- **[ESLint](https://eslint.org/)** for code linting with Angular 19 specific rules
32+
- **[Prettier](https://prettier.io)** for code formatting with Tailwind class sorting
33+
- **[Turborepo](https://turborepo.com/)** for efficient monorepo builds and caching
34+
- **[PM2](https://pm2.keymetrics.io/)** for production process management
35+
36+
## Contributing
37+
38+
Please read our [Contributing Guide](CONTRIBUTING.md) for details on our code
39+
of conduct, development process, and how to submit pull requests.
40+
41+
## Development
42+
43+
### Getting Started
44+
45+
#### Prerequisites
46+
47+
- **Node.js** v22+ (specified in package.json)
48+
- **Yarn** v4.9.2+ package manager
49+
- **Auth0 Account** for authentication setup
50+
- **Supabase Project** for user profile email management
51+
52+
#### Environment Setup
53+
54+
1. **Copy the environment template:**
55+
56+
```bash
57+
cp apps/lfx-one/.env.example apps/lfx-one/.env
58+
```
59+
60+
2. **Configure required environment variables:**
61+
62+
**Auth0 Configuration:**
63+
- Set `PCC_AUTH0_CLIENT_ID` and `PCC_AUTH0_CLIENT_SECRET`
64+
- Local Development: The default client ID is `lfx` and you can get the client secret from the k8s via `k get secrets authelia-clients -n lfx -o jsonpath='{.data.lfx}' | base64 --decode`
65+
- Update `PCC_AUTH0_ISSUER_BASE_URL` with your Auth0 domain
66+
- Local Development: `https://auth.k8s.orb.local`
67+
- Configure `PCC_AUTH0_AUDIENCE` for your API
68+
- Local Development: `http://lfx-api.k8s.orb.local/`
69+
- Set `PCC_AUTH0_SECRET` to a sufficiently long random string (32+ characters)
70+
- Generate a random 32 characters long string
71+
72+
**M2M (Machine-to-Machine) Authentication:**
73+
- Set `M2M_AUTH_CLIENT_ID` and `M2M_AUTH_CLIENT_SECRET` for server-side API calls
74+
- Configure `M2M_AUTH_ISSUER_BASE_URL` (typically same as Auth0 base URL)
75+
- Set `M2M_AUTH_AUDIENCE` to match your API audience
76+
77+
**Supabase Configuration:**
78+
- Create a project in [Supabase](https://supabase.com)
79+
- Get your project URL and anon key from Project Settings → API
80+
- Set `SUPABASE_URL` and `POSTGRES_API_KEY`
81+
- Used exclusively for user profile email management
82+
83+
**Microservice Configuration:**
84+
- Set `LFX_V2_SERVICE` to your query service endpoint
85+
- Local Development: `http://lfx-api.k8s.orb.local`
86+
87+
**AI Service Configuration (Optional):**
88+
- Set `AI_PROXY_URL` to your LiteLLM proxy endpoint for meeting agenda generation
89+
- Provide a valid API key in `AI_API_KEY`
90+
91+
**NATS Configuration:**
92+
- Set `NATS_URL` for internal messaging system (typically in Kubernetes environments)
93+
- Local Development: `nats://lfx-platform-nats.lfx.svc.cluster.local:4222`
94+
95+
**Testing Configuration (Optional):**
96+
- Set `TEST_USERNAME` and `TEST_PASSWORD` for automated E2E testing
97+
98+
**Local Development:**
99+
- Set `NODE_TLS_REJECT_UNAUTHORIZED=0` when using Authelia for local authentication
100+
101+
#### Install and Run
102+
103+
```bash
104+
# Install dependencies
105+
yarn install
106+
107+
# Start development server (Angular dev server)
108+
yarn start
109+
110+
# Build the application
111+
yarn build
112+
113+
# Run tests
114+
yarn test
115+
```
116+
117+
### Code Quality Commands
118+
119+
```bash
120+
# Linting
121+
yarn lint # Lint and auto-fix all packages
122+
yarn lint:check # Check linting without fixing
123+
124+
# Formatting
125+
yarn format # Format code with Prettier
126+
yarn format:check # Check formatting without fixing
127+
128+
# Testing
129+
yarn test # Run unit tests
130+
yarn test:watch # Run tests in watch mode
131+
```
132+
133+
### Common Commands
134+
135+
```bash
136+
# Development
137+
yarn start # Start Angular dev server (ng serve)
138+
yarn build # Build the application
139+
yarn watch # Build in watch mode
140+
141+
# Production
142+
yarn serve:ssr # Serve SSR application locally
143+
yarn start:prod # Start with PM2 in production
144+
yarn reload:prod # Zero-downtime reload
145+
yarn logs:prod # View PM2 logs
146+
```
147+
148+
### Working with the application
149+
150+
You can run commands for the application using Turborepo filters:
151+
152+
```bash
153+
# Start the Angular app
154+
yarn start --filter=lfx-one
155+
156+
# Build the Angular app
157+
yarn build --filter=lfx-one
158+
159+
# Run tests for the app
160+
yarn test --filter=lfx-one
161+
162+
# Lint the app
163+
yarn lint --filter=lfx-one
164+
```
165+
166+
## Project Structure
167+
168+
```text
169+
lfx-one/
170+
├── apps/
171+
│ └── lfx-one/ # Angular 19 SSR application
172+
│ ├── src/app/config/ # Tailwind custom configurations
173+
│ │ └── styles/ # Colors and font-size configurations
174+
│ ├── eslint.config.mjs # Angular-specific ESLint rules
175+
│ ├── .prettierrc # Prettier with Tailwind integration
176+
│ └── tailwind.config.js # Tailwind with PrimeUI plugin
177+
├── docs/ # Architecture and deployment documentation
178+
├── turbo.json # Turborepo pipeline configuration
179+
├── ecosystem.config.js # PM2 production configuration
180+
└── package.json # Root workspace configuration
181+
```
182+
183+
## Key Features
184+
185+
### Angular 19 with Zoneless Change Detection
186+
187+
- **Experimental zoneless change detection** for improved performance
188+
- **Angular Signals** for reactive state management (preferred over RxJS)
189+
- **Standalone components** with explicit imports
190+
- **Component prefix**: All components use `lfx-` prefix (enforced by ESLint)
191+
192+
### CSS Architecture
193+
194+
- **CSS Layers**: Organized layer system (`tailwind-base, primeng, tailwind-utilities`)
195+
- **PrimeNG Integration**: Custom preset using LFX UI Core design system
196+
- **Tailwind CSS**: Utility-first styling with PrimeUI plugin integration
197+
- **Custom Fonts**: Google Fonts (Open Sans + Roboto Slab) with CSS variables
198+
199+
### Direct PrimeNG Usage
200+
201+
- **PrimeNG Components**: Direct integration of PrimeNG components with LFX theming
202+
- **Custom Styling**: PrimeNG components styled with LFX UI Core design system
203+
- **Template Support**: Full access to PrimeNG template functionality
204+
- **Type Safety**: Full TypeScript support with PrimeNG type definitions
205+
206+
### Code Quality
207+
208+
- **ESLint**: Angular 19 specific rules with import organization and naming conventions
209+
- **Prettier**: Automatic code formatting with Tailwind class sorting
210+
- **TypeScript**: Strict configuration with path mappings (`@app/*`, `@config/*`)
211+
- **Testing**: Angular testing framework with comprehensive coverage
212+
213+
## Deployment
214+
215+
The application supports deployment with PM2:
216+
217+
1. **Node.js with PM2**: Production process management with clustering and
218+
zero-downtime deployments
219+
220+
See the [deployment documentation](docs/deployment.md) for detailed instructions.
221+
222+
## 📚 Documentation
223+
224+
### Architecture Documentation
225+
226+
Comprehensive documentation organized by domain:
227+
228+
#### 🎨 [Frontend Architecture](docs/architecture/frontend/)
229+
230+
- **[Angular Patterns](docs/architecture/frontend/angular-patterns.md)** - Zoneless change detection, SSR, and Angular 19 features
231+
- **[Component Architecture](docs/architecture/frontend/component-architecture.md)** - PrimeNG wrappers, layout patterns, and component hierarchy
232+
- **[Styling System](docs/architecture/frontend/styling-system.md)** - CSS layers, Tailwind configuration, and LFX UI Core
233+
- **[State Management](docs/architecture/frontend/state-management.md)** - Angular Signals patterns and service architecture
234+
- **[Performance](docs/architecture/frontend/performance.md)** - SSR optimization, build strategies, and monitoring
235+
236+
#### 🖥 [Backend Architecture](docs/architecture/backend/)
237+
238+
- **[SSR Server](docs/architecture/backend/ssr-server.md)** - Express.js configuration and Angular 19 SSR integration
239+
- **[Authentication](docs/architecture/backend/authentication.md)** - Auth0 integration with express-openid-connect
240+
- **[Logging & Monitoring](docs/architecture/backend/logging-monitoring.md)** - Pino logging, structured logs, and health monitoring
241+
- **[Deployment](docs/deployment.md)** - PM2 configuration and production deployment
242+
243+
#### 📦 [Shared Architecture](docs/architecture/shared/)
244+
245+
- **[Package Architecture](docs/architecture/shared/package-architecture.md)** - Shared interfaces, constants, and TypeScript types
246+
- **[Development Workflow](docs/architecture/shared/development-workflow.md)** - Turborepo configuration and monorepo patterns
247+
248+
#### 🧪 [Testing Architecture](docs/architecture/testing/)
249+
250+
- **[E2E Testing](docs/architecture/testing/e2e-testing.md)** - Playwright configuration and user workflow testing
251+
- **[Testing Best Practices](docs/architecture/testing/testing-best-practices.md)** - Testing patterns and implementation guide
252+
253+
### Quick Start Guides
254+
255+
- **[📋 Architecture Navigation Hub](docs/architecture/README.md)** - Complete architecture documentation guide
256+
- **[⚡ Development Setup](CLAUDE.md)** - Claude Code assistant instructions and patterns
257+
- **[🧪 Testing Guide](docs/architecture/testing/e2e-testing.md)** - Comprehensive E2E testing with Playwright
258+
259+
## Development Workflow
260+
261+
### Before Committing
262+
263+
Always run these commands before committing code:
264+
265+
```bash
266+
yarn lint # Fix code linting issues
267+
yarn format # Format code consistently
268+
yarn test # Ensure all tests pass
269+
yarn build # Verify build succeeds
270+
271+
# Use the GitHub CI job to check license headers
272+
act -W .github/workflows/license-header-check.yml # Verify license headers, requires container runtime
273+
274+
# Use the GitHub CI job to check markdown formatting
275+
act -W .github/workflows/markdown-lint.yml # Check markdown formatting
276+
```
277+
278+
**Note**: All source files must include the proper license header. See the [Contributing Guide](CONTRIBUTING.md#license-headers) for details.
279+
280+
### Component Development
281+
282+
```bash
283+
# Generate new component (will use lfx- prefix automatically)
284+
ng generate component my-feature --standalone
285+
286+
# Generate service
287+
ng generate service my-service
288+
289+
# Generate guard
290+
ng generate guard my-guard
291+
```
292+
293+
### Using PrimeNG Components
294+
295+
```typescript
296+
// Import PrimeNG modules directly in your components
297+
import { ButtonModule } from 'primeng/button';
298+
import { CardModule } from 'primeng/card';
299+
300+
@Component({
301+
selector: 'lfx-example',
302+
imports: [ButtonModule, CardModule],
303+
templateUrl: './example.component.html',
304+
styleUrl: './example.component.scss',
305+
})
306+
export class ExampleComponent {}
307+
```
308+
309+
```html
310+
<!-- example.component.html -->
311+
<p-card header="Example Card">
312+
<p-button label="Click me" severity="primary"></p-button>
313+
</p-card>
314+
```
315+
316+
## Technology Stack
317+
318+
### Frontend
319+
320+
- **Angular 19** with experimental zoneless change detection
321+
- **Angular Signals** for state management
322+
- **PrimeNG 19** UI component library with custom LFX preset
323+
- **Tailwind CSS v3** with PrimeUI plugin
324+
- **LFX UI Core** design system integration
325+
- **Font Awesome Pro** icons (via kits)
326+
- **Google Fonts** (Open Sans + Roboto Slab)
327+
328+
### Backend & Infrastructure
329+
330+
- **Express.js** server with Angular 19 SSR
331+
- **Auth0** authentication with express-openid-connect
332+
- **Pino** high-performance structured logging
333+
- **PM2** for production process management and clustering
334+
335+
## Useful Links
336+
337+
Learn more about the technologies used:
338+
339+
- **[Turborepo Documentation](https://turborepo.com/docs)** - Monorepo build system
340+
- **[Angular Documentation](https://angular.io/docs)** - Angular framework
341+
- **[Angular Signals](https://angular.io/guide/signals)** - Reactive programming with Signals
342+
- **[PrimeNG Components](https://primeng.org/)** - UI component library
343+
- **[Tailwind CSS](https://tailwindcss.com/)** - Utility-first CSS framework
344+
- **[LFX UI Core](https://github.com/linuxfoundation/lfx-ui-core)** - Linux Foundation design system
345+
- **[PM2 Documentation](https://pm2.keymetrics.io/docs/)** - Process manager for Node.js
346+
347+
## License
348+
349+
Copyright The Linux Foundation and each contributor to LFX.
350+
351+
This project’s source code is licensed under the MIT License. A copy of the
352+
license is available in LICENSE.
353+
354+
This project’s documentation is licensed under the Creative Commons Attribution
355+
4.0 International License \(CC-BY-4.0\). A copy of the license is available in
356+
LICENSE-docs.

0 commit comments

Comments
 (0)