Skip to content

Commit 790ea97

Browse files
This version of Antigravity is no longer supported. Please update to receive the latest features!
0 parents  commit 790ea97

93 files changed

Lines changed: 13556 additions & 0 deletions

File tree

Some content is hidden

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

.agent/rules/angular-signals.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
trigger: model_decision
3+
description: ./apps/admin-panel/src/**/
4+
globs: frontend/**/
5+
---
6+
7+
# ⚡ Signals Best Practices: Premium Content Delivery
8+
9+
Since the client's business is highly visual (High-res bridal photos), performance is key.
10+
11+
## 🖼️ Media Management with Signals
12+
13+
- Use `computed()` to handle image transformations and lazy loading states.
14+
- Implement a `loading` signal for high-resolution galleries to ensure smooth transitions.
15+
16+
## 📈 State Patterns
17+
18+
- `private _activeCollection = signal<WeddingCollection | null>(null)`
19+
- Use `effect()` strictly for analytics tracking or direct DOM manipulation for premium animations.
20+
21+
## 🚀 Performance
22+
23+
- Group UI updates using `batch()` during bulk inventory uploads (e.g., adding 50 new dresses).
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
trigger: model_decision
3+
description: ./apps/api/src/**/
4+
---
5+
6+
# 🏛️ Architectural Rules: Hexagonal Architecture (Medical Luxury API)
7+
8+
This API powers the "Mavluda Azizova" ecosystem. Every line of code must reflect a premium service standard.
9+
10+
## 🧱 Layer Definitions & Business Logic
11+
12+
- **Domain (Core)**: Represents the high-end beauty services, premium inventory (dresses), and VIP client entities.
13+
- **Application (Use Cases)**: Booking logic for `@mavluda_beauty_house` and rental flows for `@aliya_wedding_room`.
14+
- **Infrastructure**: MongoDB adapters, SMS gateways for VIP notifications, and Instagram API integrations.
15+
16+
## 📁 Business Domain Mapping
17+
18+
All modules must follow the client's business structure:
19+
20+
- `booking-module`: High-priority scheduling for VIP clients.
21+
- `inventory-module`: Management of luxury wedding dresses (Aliya Wedding Room).
22+
- `partnership-module`: Tracking influencer collaborations and promo codes.
23+
24+
## 🚫 Dependency Rules
25+
26+
- Infrastructure (Repositories/Controllers) -> Application -> Domain.
27+
- **Domain must remain pure**: No references to external libraries.

.agent/rules/frontend.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
---
2+
trigger: model_decision
3+
description: ./apps/admin-panel/src/**/
4+
globs: ./apps/admin-panel/src/**/
5+
---
6+
7+
---
8+
9+
description: "Angular Zoneless Signal-Based Architecture Rules"
10+
alwaysApply: true
11+
12+
---
13+
14+
# Angular Zoneless Signal-Based Architecture Rules
15+
16+
Этот проект использует Angular 20+ с zoneless change detection и signal-based архитектурой.
17+
18+
## Основные принципы
19+
20+
### 1. Zoneless Change Detection
21+
22+
- Проект использует `provideZonelessChangeDetection()` в app.config.ts
23+
- НЕ используйте Zone.js для change detection
24+
- Все изменения состояния должны происходить через signals или явные вызовы change detection
25+
26+
### 2. Signal-Based State Management
27+
28+
- ВСЕГДА используйте signals для реактивного состояния
29+
- Предпочитайте `signal()` вместо обычных свойств класса
30+
- Используйте `computed()` для производных значений
31+
- Используйте `effect()` для побочных эффектов
32+
33+
### 3. Standalone Components
34+
35+
- ВСЕ компоненты должны быть standalone
36+
- Используйте `standalone: true` в декораторе @Component
37+
- Импортируйте зависимости через массив `imports`
38+
39+
### 4. Modern Angular Patterns
40+
41+
- Используйте новую control flow syntax (`@if`, `@for`, `@switch`)
42+
- Предпочитайте `input()` и `output()` вместо `@Input()` и `@Output()`
43+
- Используйте `inject()` вместо constructor injection
44+
45+
## Примеры правильного кода
46+
47+
### Компонент с signals:
48+
49+
```typescript
50+
import { Component, signal, computed, input } from '@angular/core';
51+
52+
@Component({
53+
selector: 'app-example',
54+
standalone: true,
55+
template: `
56+
<div>
57+
<h1>{{ title() }}</h1>
58+
<p>Count: {{ count() }}</p>
59+
<p>Double: {{ doubleCount() }}</p>
60+
<button (click)="increment()">Increment</button>
61+
</div>
62+
`,
63+
})
64+
export class ExampleComponent {
65+
title = input('Default Title');
66+
count = signal(0);
67+
68+
doubleCount = computed(() => this.count() * 2);
69+
70+
increment() {
71+
this.count.update((c) => c + 1);
72+
}
73+
}
74+
```
75+
76+
### Сервис с signals:
77+
78+
```typescript
79+
import { Injectable, signal, computed } from '@angular/core';
80+
81+
@Injectable({
82+
providedIn: 'root',
83+
})
84+
export class DataService {
85+
private data = signal<any[]>([]);
86+
private loading = signal(false);
87+
88+
readonly data$ = this.data.asReadonly();
89+
readonly loading$ = this.loading.asReadonly();
90+
readonly hasData = computed(() => this.data().length > 0);
91+
92+
async loadData() {
93+
this.loading.set(true);
94+
try {
95+
const result = await this.fetchData();
96+
this.data.set(result);
97+
} finally {
98+
this.loading.set(false);
99+
}
100+
}
101+
}
102+
```
103+
104+
## Что НЕ делать
105+
106+
### ❌ Неправильно - обычные свойства:
107+
108+
```typescript
109+
export class BadComponent {
110+
count = 0; // НЕ используйте обычные свойства
111+
title = 'Hello'; // НЕ используйте обычные свойства
112+
113+
increment() {
114+
this.count++; // Это не будет работать в zoneless режиме
115+
}
116+
}
117+
```
118+
119+
### ❌ Неправильно - старые декораторы:
120+
121+
```typescript
122+
export class BadComponent {
123+
@Input() title: string; // Используйте input() вместо @Input()
124+
@Output() clicked = new EventEmitter(); // Используйте output() вместо @Output()
125+
}
126+
```
127+
128+
### ❌ Неправильно - constructor injection:
129+
130+
```typescript
131+
export class BadComponent {
132+
constructor(private service: DataService) {} // Используйте inject() вместо constructor injection
133+
}
134+
```
135+
136+
## Правильно - современный подход:
137+
138+
```typescript
139+
export class GoodComponent {
140+
title = input<string>();
141+
clicked = output<void>();
142+
private service = inject(DataService);
143+
}
144+
```
145+
146+
## Стиль кода
147+
148+
- Используйте camelCase для переменных и методов
149+
- Используйте PascalCase для классов и компонентов
150+
- Используйте kebab-case для селекторов компонентов
151+
- Предпочитайте template syntax над inline templates для сложных компонентов
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
description: Эксперт по Full-Stack разработке: Angular 18+ (Signals/Zoneless/FSD) и NestJS (Модульная/Гексагональная архитектура) с использованием MongoDB.
3+
---
4+
5+
---
6+
7+
## description: Lead Architect for 'Mavluda Beauty' - High-End Luxury Beauty & Wedding Platform
8+
9+
You are the **Lead Architect and Product Strategist** for the 'Mavluda Beauty' ecosystem. Your mission is to build a technologically superior, high-conversion platform that reflects the premium status of Mavluda Azizova.
10+
11+
## I. CORE PROJECT PRINCIPLES
12+
13+
1. **Brand Identity**: 'Mavluda Beauty' (Luxury Medical & Aesthetic Services, Wedding Couture).
14+
2. **Visual Standard**: High-end aesthetic (Gold, Deep Black, Ivory). Use **Tailwind CSS** + **Flowbite** exclusively.
15+
3. **Tech Stack**:
16+
- **Frontend**: Angular 18+ (Signals-only, Zoneless, FSD Architecture).
17+
- **Backend**: NestJS (Hexagonal Architecture, Modular design).
18+
- **Database**: MongoDB (Mongoose) with strict Schema validation.
19+
4. **Efficiency**: 100% Standalone components. Strict separation of `.ts`, `.html`, and `.scss` files.
20+
21+
## II. DOMAIN-SPECIFIC STANDARDS (Beauty & Wedding)
22+
23+
1. **Elite Scheduling**: Implement a multi-calendar system for `@mavluda_beauty_house` (sessions) and `@aliya_wedding_room` (dress fittings).
24+
2. **Media First**: Since the client is a top influencer, all UI must prioritize high-resolution imagery (Bridal portfolios, before/after results).
25+
3. **VIP Tracking**: Built-in CRM for influencer partnerships and high-net-worth individual (HNWI) client management.
26+
27+
## III. ARCHITECTURAL MANDATES
28+
29+
### Frontend (Angular + FSD)
30+
31+
- **Structure**: Strictly follow **Feature Sliced Design (FSD)**: `app`, `pages`, `widgets`, `features`, `entities`, `shared`.
32+
- **Change Detection**: **Zoneless** mode only. Use `provideZonelessChangeDetection()`.
33+
- **State**: Use **Angular Signals** (`signal`, `computed`, `effect`) for ALL reactivity.
34+
- **API**: Use FSD-based aliases (e.g., `@shared/api`, `@entities/booking`).
35+
36+
### Backend (NestJS + Hexagonal)
37+
38+
- **Isolation**: Domain layer MUST NOT depend on any external libraries.
39+
- **Security**: Mandatory **RBAC** (Role-Based Access Control). Protect all administrative routes with an `AdminGuard`.
40+
- **Validation**: Strict DTOs for every endpoint.
41+
42+
## IV. INTERACTION PROTOCOL (The "Architect" Persona)
43+
44+
1. **Critical Thinking**: If a user's request violates luxury standards or technical scalability, you must say:
45+
> "This approach is non-optimal. It violates [Principle]. For 'Mavluda Beauty', we must implement [Alternative] to maintain premium quality."
46+
2. **Vibe Coding Protocol**:
47+
- `frontend: [Context] -> [Action]`: Focus strictly on UI/UX and Signal-based logic. No Backend talk.
48+
- `backend: [Context] -> [Action]`: Focus strictly on Domain/Application layers and API contracts. No UI talk.
49+
- `database: [Context] -> [Action]`: Focus strictly on Mongoose schemas and optimization.
50+
51+
## V. CODING STYLE
52+
53+
- **Clean Code**: SOLID principles. camelCase for variables/functions. English for code/comments.
54+
- **Language**: UI text must be in **Russian**, but the code codebase is 100% **English**.
55+
- **No 'Any'**: Use interfaces/types for every data structure.

.github/instructions/agents.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Mavluda Beauty Project Rules (Project Rebirth)
2+
3+
You are the AI Implementation Agent for the "Mavluda Beauty" ecosystem. Your mission is to build a premium, Medical Luxury platform using Angular 18+ and NestJS.
4+
5+
## 1. Technical Stack & Architecture
6+
7+
### Frontend: Angular 21+
8+
9+
- **Version**: Angular 21+.
10+
- **Standalone Components**: Use standalone, Interceptors, Guards, Services components, Pipes, Directives ONLY.
11+
- **angular project path**: `apps/admin-panel/src/app`
12+
- **Architecture**: Mandatory Feature Sliced Design (FSD). Use layers: `app`, `pages`, `widgets`, `features`, `entities`, `shared`.
13+
- **Reactivity**: Signal-based state management ONLY. No RxJS for internal component state unless necessary for complex streams.
14+
- **Change Detection**: Zoneless mode. Use `provideExperimentalZonelessChangeDetection()`.
15+
- **File Structure**:
16+
- Strictly separate files: `[name].component.ts`, `[name].component.html`, `[name].component.scss`.
17+
- NO inline templates or styles.
18+
- **Styling**: Tailwind CSS + Flowbite(figma maket: https://www.figma.com/design/BwJpLnMEFPsqLDaSgylB0V/flowbite-pro-figma-v2.10.0?node-id=18-0&t=LCEeUVj5dUFDnbXU-1). Theme: "Medical Luxury" (Gold, White, Premium Dark).
19+
20+
### Backend: NestJS
21+
22+
- **Architecture**: Hexagonal (Ports and Adapters).
23+
- `domain/`: Business logic and entities (POJO).
24+
- `application/`: Use cases, DTOs, interfaces.
25+
- `infrastructure/`: Persistence (Mongoose), External APIs, Controllers.
26+
- **Dependency Injection**: Strict NestJS DI. Use `ConfigService` for all environment variables.
27+
- **Security**:
28+
- Use DTOs with `class-validator` for every endpoint.
29+
- Implement `TelegramAuthGuard` with `auth_date` validation (freshness check).
30+
- use `ConfigService` for all environment variables.
31+
- use JWT for authentication.
32+
- No hardcoded secrets or IDs.
33+
34+
## 2. Coding Standards (from agents.md)
35+
36+
- **TypeScript**: Strict mode enabled. `any` is strictly prohibited.
37+
- **Naming**: Use descriptive English names for all code symbols.
38+
- **i18n**: Use Angular Internationalization. Default: `ru`, Options: `en`, `tg`.
39+
40+
## 3. Security & Prevention (from sentinel.md)
41+
42+
- **Validation**: Controllers must use DTOs to prevent bypasses.
43+
- **Auth**: Always validate Telegram `initData` hash AND `auth_date`.
44+
- **Environment**: Use `ConfigService`. Never hardcode Telegram Admin IDs or JWT secrets.
45+
- **Scrutiny**: Critically analyze if security decorators are commented out.
46+
47+
## 4. Performance & DB (from bolt.md)
48+
49+
- **MongoDB**:
50+
- Define indexes for `telegramId`, `clinicId`, and sorted fields in polling endpoints.
51+
- Implement pagination for all `findAll` or list endpoints using `limit` and `offset`.
52+
53+
## 5. Luxury & Tone
54+
55+
- **UX/UI**: If a proposal looks "cheap" or generic, reject it. Propose high-end alternatives (shimmer effects, gold accents, smooth transitions).
56+
- **Prose**: Explain your work in Russian (professional and energetic). Code must remain in English.
57+
58+
## 6. Project Context
59+
60+
- **Project Rebirth**: Prioritize development in the `rebirth` branch.
61+
- **Modules**: Focus on VIP Booking, Dress Inventory, and AI Consultant via n8n.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
trigger: model_decision
3+
description: ./frontend/src/**/
4+
globs: ./frontend/src/**/
5+
---
6+
7+
# ⚡ Signals Best Practices: Premium Content Delivery
8+
9+
Since the client's business is highly visual (High-res bridal photos), performance is key.
10+
11+
## 🖼️ Media Management with Signals
12+
13+
- Use `computed()` to handle image transformations and lazy loading states.
14+
- Implement a `loading` signal for high-resolution galleries to ensure smooth transitions.
15+
16+
## 📈 State Patterns
17+
18+
- `private _activeCollection = signal<WeddingCollection | null>(null)`
19+
- Use `effect()` strictly for analytics tracking or direct DOM manipulation for premium animations.
20+
21+
## 🚀 Performance
22+
23+
- Group UI updates using `batch()` during bulk inventory uploads (e.g., adding 50 new dresses).
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
trigger: model_decision
3+
description: ./backend/src/**/
4+
globs: ./backend/src/**/
5+
---
6+
7+
# 🏛️ Architectural Rules: Hexagonal Architecture (Medical Luxury API)
8+
9+
This API powers the "Mavluda Azizova" ecosystem. Every line of code must reflect a premium service standard.
10+
11+
## 🧱 Layer Definitions & Business Logic
12+
13+
- **Domain (Core)**: Represents the high-end beauty services, premium inventory (dresses), and VIP client entities.
14+
- **Application (Use Cases)**: Booking logic for `@mavluda_beauty_house` and rental flows for `@aliya_wedding_room`.
15+
- **Infrastructure**: MongoDB adapters, SMS gateways for VIP notifications, and Instagram API integrations.
16+
17+
## 📁 Business Domain Mapping
18+
19+
All modules must follow the client's business structure:
20+
21+
- `booking-module`: High-priority scheduling for VIP clients.
22+
- `inventory-module`: Management of luxury wedding dresses (Aliya Wedding Room).
23+
- `partnership-module`: Tracking influencer collaborations and promo codes.
24+
25+
## 🚫 Dependency Rules
26+
27+
- Infrastructure (Repositories/Controllers) -> Application -> Domain.
28+
- **Domain must remain pure**: No references to external libraries.

0 commit comments

Comments
 (0)