budrobundy69 / budrobundy69/openapi-angular-spring-example

🧩 Integrate OpenAPI TypeScript Client into Angular 19 with Signals

Đang mở
#21 0 bình luận 0 reaction 1 người được giao Được @budrobundy69 nhận Xem trên GitHub
🎨 frontend 🛠️ setup
Ngôn ngữ chính
HTML
Star
0
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 🧩 Integrate OpenAPI TypeScript Client into Angular 19 with Signals

**Goal:** Use the generated OpenAPI TS client to communicate with the backend, and manage state using Angular Signals and SignalStore.

---

### ✅ Tasks

#### 1. Setup SignalStore

- [ ] Create a signal store (`apiStore`) in `frontend/src/app/stores/`
- [ ] Store loading state, errors, and response data
- [ ] Export actions for component usage

#### 2. Create ApiService Wrapper

- [ ] Create `api.service.ts` in `frontend/src/app/services/`
- [ ] Inject OpenAPI-generated services (e.g., `DefaultService`)
- [ ] Wrap service methods to return observables or promises
- [ ] Handle and log HTTP errors gracefully

#### 3. Create Example Feature

- [ ] Create a component that:
- [ ] Triggers an API call using the store
- [ ] Displays loading/error/success state
- [ ] Uses Signals for UI updates

#### 4. Optional: Add Test Coverage

- [ ] Unit test the SignalStore and ApiService
- [ ] Mock OpenAPI responses

---

### 📁 Suggested Structure

frontend/
├── src/
│ ├── app/
│ │ ├── api/ # OpenAPI-generated
│ │ ├── services/
│ │ │ └── api.service.ts
│ │ ├── stores/
│ │ │ └── api.store.ts
│ │ └── features/
│ │ └── sample/
│ │ └── sample.component.ts

---

### 🔜 Next Steps (Separate Issues)

- Add tests to CI
- Extend SignalStore pattern across features
- Trigger OpenAPI client generation automatically in CI
- Cloud Foundry deploy with OpenAPI client

---

**Labels:** `🔄 openapi`, `🧱 frontend`, `🌐 angular`, `📦 integration`, `⚡ state`, `🧪 test`
**Milestone:** `M1 - Backend MVP`
**Project:** `OpenAPI Angular Spring Example`

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.