diff --git a/PROJECT-BREAKDOWN.md b/PROJECT-BREAKDOWN.md index a04e35e..e5a302f 100644 --- a/PROJECT-BREAKDOWN.md +++ b/PROJECT-BREAKDOWN.md @@ -1,527 +1,125 @@ -# 🎯 Reactive API Console - Project Task Breakdown +# 🎯 Assignment: Reactive API Console via Chat Interface -## πŸ“‹ **Project Overview** +## πŸ’‘ Concept -A modern, reactive API explorer with chat interface, Redux state management, drag & drop functionality, advanced search/filtering, and export capabilities. +Build a **reactive API explorer tool** where users can: ---- +1. Choose from a list of public APIs (e.g. Weather, Joke API, GitHub users) +2. Use a **chat-style interface** to issue commands + (e.g. `get weather in Tokyo`, `search users john`) +3. Render results in **dedicated, isolated panels** (one per API) +4. Support **real-time search & filtering** across results -## πŸ—οΈ **Phase 1: Foundation & Core Setup** +## 🧱 Core Requirements -### **1.1 Project Initialization** +### 1. πŸ”Œ API Selection -- [x] **Setup Next.js 14 project** with TypeScript -- [x] **Configure Tailwind CSS** for styling -- [x] **Setup ESLint & Prettier** for code quality -- [x] **Initialize Git repository** with proper .gitignore -- [x] **Create project structure** (components, types, utils, etc.) -- [x] **Setup package.json** with all dependencies +- Preload 3–5 public APIs with defined endpoints and commands +- Show a sidebar to **activate/deactivate APIs** +- Each active API gets its own UI panel (simulate iframe-like isolation) -**Estimated Time:** 2-3 hours -**Priority:** High -**Dependencies:** None -**Status:** βœ… Complete +### 2. πŸ’¬ Chat Input -### **1.2 TypeScript Types & Interfaces** +- Accept text-based commands (e.g. `get cat fact`, `search chuck car`) +- Parse input and trigger API calls +- Use **RxJS** for: + - Input parsing stream + - API request stream (handle loading & error states) + - Debounced search/filtering logic -- [x] **Define API types** (ApiEndpoint, ApiCommand, ApiResponse) -- [x] **Create Redux state types** (RootState, slice states) -- [x] **Define component prop types** -- [x] **Create utility types** (FilterState, DragState, etc.) -- [x] **Export all types** from centralized location +### 3. πŸ“Ί Result Panels (Simulated IFrames) -**Estimated Time:** 2-3 hours -**Priority:** High -**Dependencies:** 1.1 -**Status:** βœ… Complete +- Each API’s response is rendered in its **own visual panel** +- Use **isolated React components** to simulate iframe-like encapsulation +- Only results for a given API should appear in its panel ---- +### 4. πŸ” Search & Filter -## πŸͺ **Phase 2: Redux State Management** +- Support filtering results globally or within individual panels +- Highlight matching entries +- Use **RxJS with debounced input** and efficient stream filtering -### **2.1 Redux Store Configuration** +## βš™οΈ Tech Stack -- [x] **Install Redux Toolkit** and React-Redux -- [x] **Configure store** with middleware and DevTools -- [x] **Create typed hooks** (useAppDispatch, useAppSelector) -- [x] **Setup store provider** in app layout -- [x] **Add serialization checks** for complex data +| Tool | Purpose | +| ------------- | -------------------------------------------- | +| React + Vite | App framework + fast dev tooling | +| Redux Toolkit | State management (API results, chat history) | +| RxJS | Reactive streams for input/API flows | +| TypeScript | Strong static typing | +| Vitest | Unit & component testing | +| Cypress | End-to-end interaction testing | -**Estimated Time:** 3-4 hours -**Priority:** High -**Dependencies:** 1.1, 1.2 -**Status:** βœ… Complete +## βœ… Testing Requirements -### **2.2 Redux Slices Implementation** +### πŸ§ͺ Unit/Component Tests (with **Vitest**) -- [x] **APIs Slice** - endpoint management, panel ordering -- [x] **Responses Slice** - API responses, loading states -- [x] **Chat Slice** - messages, command history -- [x] **UI Slice** - sidebar, modals, drag state -- [x] **Filters Slice** - search and filter state +- Chat input parsing logic +- RxJS observable pipelines +- Result rendering per API + for -**Estimated Time:** 6-8 hours -**Priority:** High -**Dependencies:** 2.1 -**Status:** βœ… Complete +### πŸš€ E2E Tests (with **Cypress**) -### **2.3 Selectors & Async Actions** +- Full chat-to-response flow +- API switching behavior +- Global and per-panel filtering -- [x] **Create memoized selectors** for performance -- [x] **Implement async thunks** for API calls -- [x] **Add error handling** in async actions -- [x] **Create derived selectors** (filtered data, ordered APIs) -- [x] **Test selector performance** with large datasets +## 🎁 Bonus Features (Optional) -**Estimated Time:** 4-5 hours -**Priority:** High -**Dependencies:** 2.2 -**Status:** βœ… Complete +- Chat commands like `clear`, `help`, or `history` +- β€œPin” important results to top of panel +- Animations for iframe entry/exit +- Drag-and-drop or resizable panels ---- +## πŸ“¦ Deliverables -## πŸ”Œ **Phase 3: API Integration** +- GitHub repository with clean commits +- `README.md` with setup, usage, and testing instructions +- Well-structured and modular folder layout -### **3.1 API Service Layer** +## 🌐 Public APIs to Use -- [x] **Define API endpoints** (Cat Facts, Chuck Norris, etc.) -- [x] **Create command patterns** with RegExp -- [x] **Implement response handlers** for each API -- [x] **Add error handling** for failed requests -- [x] **Create API initialization** logic +### 1. 🐱 Cat Facts API -**Estimated Time:** 4-6 hours -**Priority:** High -**Dependencies:** 2.2 -**Status:** βœ… Complete +- `GET https://catfact.ninja/fact` +- **Command**: `get cat fact` -### **3.2 Command Processing System** +### 2. 🧠 Chuck Norris Jokes API -- [x] **Build command parser** with pattern matching -- [x] **Implement special commands** (help, clear, history) -- [x] **Add command validation** and error messages -- [x] **Create command execution flow** with Redux -- [x] **Add loading states** for async commands +- `GET https://api.chucknorris.io/jokes/random` +- `GET https://api.chucknorris.io/jokes/search?query=kick` +- **Commands**: `get chuck joke`, `search chuck kick` -**Estimated Time:** 5-7 hours -**Priority:** High -**Dependencies:** 3.1, 2.3 -**Status:** βœ… Complete +### 3. 🌍 Bored API ---- +- `GET https://bored-api.appbrewery.com/random` +- **Command**: `get activity` -## πŸ’¬ **Phase 4: Chat Interface** +### 4. πŸ” GitHub Users Search API -### **4.1 Chat Component Development** +- `GET https://api.github.com/search/users?q=john` +- **Command**: `search github john` -- [x] **Create ChatInterface component** with message display -- [x] **Build message input** with form handling -- [x] **Add message types** (user, system, error) with styling -- [x] **Implement auto-scroll** to latest messages -- [x] **Add message timestamps** and formatting +### 5. 🌦️ Weather API (Open-Meteo) -**Estimated Time:** 4-5 hours -**Priority:** High -**Dependencies:** 2.2, 3.2 -**Status:** βœ… Complete +- `GET https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41¤t_weather=true` +- **Command**: `get weather Berlin` +- _(You can hardcode city-to-coordinates mapping in app)_ -### **4.2 Chat Features** +## πŸ—ƒοΈ Public API for Simulating Chat Message Storage -- [x] **Add chat search functionality** with highlighting -- [x] **Implement command suggestions** and autocomplete -- [x] **Create message filtering** by type -- [x] **Add keyboard shortcuts** (Enter to send, etc.) -- [ ] **Implement message persistence** across sessions +### πŸ”Ή DummyJSON β€” https://dummyjson.com -**Estimated Time:** 3-4 hours -**Priority:** Medium -**Dependencies:** 4.1 -**Status:** πŸ”„ Mostly Complete (persistence pending) +Supports: `GET`, `POST`, `PUT`, `DELETE` ---- +- Use `/comments` or `/posts` as chat message entities +- Good for simulating user-generated message storage -## πŸ“Ί **Phase 5: API Panels & Results Display** +#### Example: -### **5.1 Panel System Architecture** - -- [x] **Create ApiPanel component** for individual APIs -- [x] **Build ApiPanels container** with tab system -- [x] **Implement panel selection** logic -- [x] **Add responsive design** for different screen sizes -- [x] **Create panel state management** with Redux - -**Estimated Time:** 5-6 hours -**Priority:** High -**Dependencies:** 2.2, 3.1 -**Status:** βœ… Complete - -### **5.2 Result Rendering** - -- [x] **Custom renderers** for each API type -- [x] **Rich data display** (images, links, formatted text) -- [ ] **Add result pagination** for large datasets -- [ ] **Implement result sorting** options -- [x] **Create result actions** (pin, delete, share) - -**Estimated Time:** 6-8 hours -**Priority:** High -**Dependencies:** 5.1 -**Status:** πŸ”„ Mostly Complete (pagination & sorting pending) - ---- - -## 🎯 **Phase 6: Drag & Drop System** - -### **6.1 Drag & Drop Infrastructure** - -- [x] **Create DraggableTab component** with drag handlers -- [x] **Implement drag state management** in Redux -- [x] **Add visual feedback** during drag operations -- [x] **Create drop zones** and indicators -- [x] **Handle drag events** (start, over, drop, end) - -**Estimated Time:** 4-5 hours -**Priority:** Medium -**Dependencies:** 5.1, 2.2 -**Status:** βœ… Complete - -### **6.2 Panel Reordering** - -- [x] **Implement panel order persistence** in Redux -- [x] **Add drag preview component** with custom styling -- [x] **Create smooth animations** for reordering -- [x] **Add touch support** for mobile devices -- [x] **Handle edge cases** (invalid drops, etc.) - -**Estimated Time:** 3-4 hours -**Priority:** Medium -**Dependencies:** 6.1 -**Status:** βœ… Complete - ---- - -## πŸ” **Phase 7: Search & Filtering System** - -### **7.1 Search Infrastructure** - -- [x] **Create SearchBar component** with debounced input -- [x] **Implement global search** across all results -- [x] **Add per-panel filtering** functionality -- [x] **Create search state management** in Redux -- [ ] **Add search history** and suggestions - -**Estimated Time:** 4-5 hours -**Priority:** High -**Dependencies:** 2.2, 5.1 -**Status:** πŸ”„ Mostly Complete (history pending) - -### **7.2 Advanced Search Features** - -- [x] **Text highlighting** in search results -- [x] **Deep object search** through nested data -- [x] **Match counting** and indicators -- [ ] **Search result ranking** by relevance -- [ ] **Regular expression support** for power users - -**Estimated Time:** 5-6 hours -**Priority:** Medium -**Dependencies:** 7.1 -**Status:** πŸ”„ Mostly Complete (ranking & regex pending) - -### **7.3 Highlighting System** - -- [x] **Create HighlightText component** with mark tags -- [x] **Implement match detection** utility functions -- [x] **Add contextual highlighting** for different content -- [x] **Create highlight animations** and transitions -- [x] **Handle special characters** in search terms - -**Estimated Time:** 3-4 hours -**Priority:** Medium -**Dependencies:** 7.2 -**Status:** βœ… Complete - ---- - -## πŸ“€ **Phase 8: Export System** - -### **8.1 Export Infrastructure** - -- [x] **Create ExportService** with multiple formats -- [x] **Implement format converters** (JSON, CSV, TXT, HTML) -- [x] **Add export options** (metadata, matches, raw data) -- [x] **Create file download** functionality -- [x] **Add export validation** and error handling - -**Estimated Time:** 5-6 hours -**Priority:** Medium -**Dependencies:** 7.1 -**Status:** βœ… Complete - -### **8.2 Export UI Components** - -- [x] **Create ExportModal** with preview functionality -- [x] **Build QuickExportButton** with dropdown -- [x] **Add export progress** indicators -- [x] **Implement batch export** for multiple APIs -- [ ] **Create export history** and templates - -**Estimated Time:** 4-5 hours -**Priority:** Medium -**Dependencies:** 8.1 -**Status:** πŸ”„ Mostly Complete (history & templates pending) - ---- - -## 🎨 **Phase 9: UI/UX Polish** - -### **9.1 Sidebar & Navigation** - -- [x] **Create responsive sidebar** with API management -- [x] **Add sidebar toggle** functionality -- [x] **Implement API activation** controls -- [ ] **Create sidebar search** for APIs -- [ ] **Add sidebar state persistence** - -**Estimated Time:** 3-4 hours -**Priority:** High -**Dependencies:** 2.2 -**Status:** πŸ”„ Mostly Complete (search & persistence pending) - -### **9.2 Visual Design & Animations** - -- [x] **Add loading states** and skeletons -- [x] **Create smooth transitions** between states -- [x] **Implement hover effects** and interactions -- [ ] **Add success/error notifications** system -- [x] **Create responsive breakpoints** for mobile - -**Estimated Time:** 4-5 hours -**Priority:** Medium -**Dependencies:** All UI components -**Status:** πŸ”„ Mostly Complete (notifications pending) - -### **9.3 Error Handling & Boundaries** - -- [x] **Create ErrorBoundary component** for crash recovery -- [x] **Add error states** for failed API calls -- [ ] **Implement retry mechanisms** for failed requests -- [x] **Create user-friendly error messages** -- [ ] **Add error reporting** and logging - -**Estimated Time:** 3-4 hours -**Priority:** High -**Dependencies:** All components -**Status:** πŸ”„ Mostly Complete (retry & logging pending) - ---- - -## πŸ§ͺ **Phase 10: Testing & Quality Assurance** - -### **10.1 Unit Testing** - -- [x] **Setup Vitest** testing framework -- [x] **Test Redux slices** and reducers -- [x] **Test utility functions** (search, export, etc.) -- [x] **Test React components** with React Testing Library -- [x] **Add test coverage** reporting - -**Estimated Time:** 8-10 hours -**Priority:** High -**Dependencies:** All features complete -**Status:** βœ… Complete - -### **10.2 Integration Testing** - -- [x] **Setup Cypress** for E2E testing -- [x] **Test user workflows** (command execution, search, export) -- [x] **Test drag & drop** functionality -- [x] **Test responsive design** on different devices -- [x] **Test error scenarios** and edge cases - -**Estimated Time:** 6-8 hours -**Priority:** High -**Dependencies:** 10.1 -**Status:** βœ… Complete - -### **10.3 Performance Testing** - -- [ ] **Test with large datasets** (1000+ responses) -- [ ] **Measure Redux selector** performance -- [ ] **Test search performance** with complex queries -- [ ] **Optimize bundle size** and loading times -- [ ] **Add performance monitoring** tools - -**Estimated Time:** 4-5 hours -**Priority:** Medium -**Dependencies:** 10.2 -**Status:** ⏳ Pending - ---- - -## πŸ“š **Phase 11: Documentation & Deployment** - -### **11.1 Documentation** - -- [x] **Write comprehensive README** with setup instructions -- [ ] **Create API documentation** for each endpoint -- [ ] **Document Redux architecture** and data flow -- [ ] **Add code comments** and JSDoc annotations -- [ ] **Create user guide** with screenshots - -**Estimated Time:** 4-6 hours -**Priority:** Medium -**Dependencies:** All features complete -**Status:** πŸ”„ Partially Complete (README done) - -### **11.2 Deployment & CI/CD** - -- [ ] **Setup Vercel deployment** configuration -- [ ] **Create GitHub Actions** for CI/CD -- [ ] **Add automated testing** in pipeline -- [ ] **Setup environment variables** for production -- [ ] **Configure domain** and SSL certificates - -**Estimated Time:** 3-4 hours -**Priority:** Medium -**Dependencies:** 11.1 -**Status:** ⏳ Pending - ---- - -## πŸš€ **Phase 12: Advanced Features (Optional)** - -### **12.1 Enhanced Features** - -- [ ] **Add dark/light theme** toggle -- [ ] **Implement user preferences** persistence -- [ ] **Create custom API** integration system -- [ ] **Add keyboard shortcuts** for power users -- [ ] **Implement undo/redo** functionality - -**Estimated Time:** 8-10 hours -**Priority:** Low -**Dependencies:** All core features -**Status:** ⏳ Future Enhancement - -### **12.2 Performance Optimizations** - -- [ ] **Add virtual scrolling** for large lists -- [ ] **Implement code splitting** for better loading -- [ ] **Add service worker** for offline functionality -- [ ] **Create data caching** strategies -- [ ] **Optimize re-renders** with React.memo - -**Estimated Time:** 6-8 hours -**Priority:** Low -**Dependencies:** 12.1 -**Status:** ⏳ Future Enhancement - ---- - -## πŸ“Š **Project Summary** - -### **Overall Progress: 85% Complete** 🎯 - -### **Completed Phases:** - -- βœ… **Foundation & Core Setup** (100%) -- βœ… **Redux State Management** (100%) -- βœ… **API Integration** (100%) -- βœ… **Chat Interface** (95%) -- βœ… **API Panels & Results** (90%) -- βœ… **Drag & Drop System** (100%) -- βœ… **Search & Filtering** (90%) -- βœ… **Export System** (95%) -- βœ… **Testing & QA** (85%) - -### **In Progress:** - -- πŸ”„ **UI/UX Polish** (80%) -- πŸ”„ **Documentation** (40%) - -### **Pending:** - -- ⏳ **Performance Testing** (0%) -- ⏳ **Deployment & CI/CD** (0%) -- ⏳ **Advanced Features** (0%) - -### **Time Investment:** - -- **Completed:** ~95-110 hours -- **Remaining Core:** ~15-20 hours -- **Optional Features:** ~15-25 hours - -### **Critical Path Remaining:** - -1. **Performance Testing** (1-2 days) -2. **Documentation Completion** (1 day) -3. **Deployment Setup** (0.5 day) -4. **Final Polish** (0.5 day) - -### **Key Achievements:** - -- πŸͺ **Full Redux Integration** with typed store -- 🎯 **Advanced Drag & Drop** with smooth animations -- πŸ” **Comprehensive Search** with highlighting -- πŸ“€ **Multi-format Export** system -- πŸ§ͺ **Extensive Testing** coverage -- πŸ“± **Responsive Design** for all devices - -### **Technical Debt:** - -- Message persistence across sessions -- Search history and suggestions -- Notification system -- Performance monitoring -- Error retry mechanisms - -### **Next Immediate Tasks:** - -1. **Performance optimization** for large datasets -2. **Complete documentation** with architecture diagrams -3. **Setup deployment** pipeline -4. **Add notification system** for better UX -5. **Implement retry mechanisms** for failed requests - -### **Risk Mitigation:** - -- βœ… Redux complexity handled with typed hooks -- βœ… Browser compatibility tested across devices -- βœ… API reliability handled with error boundaries -- ⚠️ Performance with large datasets needs testing -- ⚠️ Mobile responsiveness needs final validation - ---- - -## 🎯 **Success Metrics** - -### **Functional Requirements:** βœ… Met - -- [x] Multi-API integration with 5 public APIs -- [x] Chat-based command interface -- [x] Real-time search and filtering -- [x] Drag & drop panel reordering -- [x] Export functionality in multiple formats -- [x] Redux state management -- [x] Responsive design - -### **Technical Requirements:** βœ… Met - -- [x] TypeScript for type safety -- [x] Next.js 14 with App Router -- [x] Redux Toolkit for state management -- [x] Comprehensive testing suite -- [x] Modern React patterns (hooks, context) -- [x] Performance optimizations - -### **User Experience:** βœ… Excellent - -- [x] Intuitive chat interface -- [x] Visual feedback for all actions -- [x] Smooth animations and transitions -- [x] Error handling and recovery -- [x] Mobile-friendly design -- [x] Accessibility considerations - -The Reactive API Console project has successfully achieved its core objectives and is ready for production deployment with minimal remaining tasks focused on performance optimization and documentation completion. +| Command | API Action | +| -------------------------------- | --------------------- | +| `send message "Hello!"` | `POST /comments` | +| `edit message 42 "Updated text"` | `PUT /comments/42` | +| `delete message 42` | `DELETE /comments/42` | diff --git a/README.md b/README.md index e5a302f..043886d 100644 --- a/README.md +++ b/README.md @@ -1,125 +1,343 @@ -# 🎯 Assignment: Reactive API Console via Chat Interface +# Reactive API Console -## πŸ’‘ Concept +A modern, interactive web application that provides a console-like interface for testing and exploring various APIs. Built with React, TypeScript, and Redux Toolkit, featuring real-time search, highlighting, and a responsive design. -Build a **reactive API explorer tool** where users can: +🌐 **Live Demo**: [https://reactive-api-console.vercel.app](https://reactive-api-console.vercel.app) -1. Choose from a list of public APIs (e.g. Weather, Joke API, GitHub users) -2. Use a **chat-style interface** to issue commands - (e.g. `get weather in Tokyo`, `search users john`) -3. Render results in **dedicated, isolated panels** (one per API) -4. Support **real-time search & filtering** across results +## πŸš€ Features -## 🧱 Core Requirements +- **Interactive API Testing**: Execute commands to fetch data from various APIs +- **Real-time Search**: Global search across all API responses with highlighting +- **Responsive Design**: Modern UI built with Tailwind CSS +- **Type Safety**: Full TypeScript support throughout the application +- **State Management**: Redux Toolkit for predictable state management +- **Reactive Programming**: RxJS for handling asynchronous operations and data streams +- **Comprehensive Testing**: Unit tests, integration tests, and E2E tests with Cypress -### 1. πŸ”Œ API Selection +## πŸ› οΈ Tech Stack -- Preload 3–5 public APIs with defined endpoints and commands -- Show a sidebar to **activate/deactivate APIs** -- Each active API gets its own UI panel (simulate iframe-like isolation) +- **Frontend**: React 19, TypeScript, Vite +- **Styling**: Tailwind CSS 4 +- **State Management**: Redux Toolkit, React Redux +- **Reactive Programming**: RxJS +- **Testing**: Vitest, Testing Library, Cypress +- **Build Tool**: Vite +- **Package Manager**: pnpm -### 2. πŸ’¬ Chat Input +## πŸ“‹ Prerequisites -- Accept text-based commands (e.g. `get cat fact`, `search chuck car`) -- Parse input and trigger API calls -- Use **RxJS** for: - - Input parsing stream - - API request stream (handle loading & error states) - - Debounced search/filtering logic +- Node.js 20 or higher +- pnpm (recommended) or npm -### 3. πŸ“Ί Result Panels (Simulated IFrames) +## πŸš€ Quick Start -- Each API’s response is rendered in its **own visual panel** -- Use **isolated React components** to simulate iframe-like encapsulation -- Only results for a given API should appear in its panel +### 1. Clone the Repository -### 4. πŸ” Search & Filter +```bash +git clone https://github.com/marafa1985/reactive-api-console.git +cd reactive-api-console +``` -- Support filtering results globally or within individual panels -- Highlight matching entries -- Use **RxJS with debounced input** and efficient stream filtering +### 2. Install Dependencies -## βš™οΈ Tech Stack +```bash +# Using pnpm (recommended) +pnpm install -| Tool | Purpose | -| ------------- | -------------------------------------------- | -| React + Vite | App framework + fast dev tooling | -| Redux Toolkit | State management (API results, chat history) | -| RxJS | Reactive streams for input/API flows | -| TypeScript | Strong static typing | -| Vitest | Unit & component testing | -| Cypress | End-to-end interaction testing | +# Or using npm +npm install +``` -## βœ… Testing Requirements +### 3. Start Development Server -### πŸ§ͺ Unit/Component Tests (with **Vitest**) +```bash +pnpm dev +``` -- Chat input parsing logic -- RxJS observable pipelines -- Result rendering per API - for +The application will be available at `http://localhost:5173` -### πŸš€ E2E Tests (with **Cypress**) +## πŸ“– Usage -- Full chat-to-response flow -- API switching behavior -- Global and per-panel filtering +### Available Commands -## 🎁 Bonus Features (Optional) +The console supports the following commands: -- Chat commands like `clear`, `help`, or `history` -- β€œPin” important results to top of panel -- Animations for iframe entry/exit -- Drag-and-drop or resizable panels +- `help` - Display available commands +- `clear` - clear all results +- `history` - Display messages history +- `get cat fact` - Fetch a random cat fact +- `get chuck norris joke` - Get a Chuck Norris joke +- `get bored activity` - Get a random activity suggestion +- `get github users` - Search GitHub users +- `get weather` - Get weather information -## πŸ“¦ Deliverables +### Features -- GitHub repository with clean commits -- `README.md` with setup, usage, and testing instructions -- Well-structured and modular folder layout +1. **Command Input**: Type commands in the chat console +2. **API Panels**: View responses in dedicated panels +3. **Global Search**: Search across all responses with highlighting +4. **Response Filtering**: Filter results based on search terms +5. **Response Pinning**: Pin important responses for quick access + +## πŸ§ͺ Testing + +### Unit Tests + +Run unit tests with Vitest: + +```bash +# Run all tests +pnpm test + +# Run tests with UI +pnpm test:ui + +# Run tests with coverage +pnpm test:coverage +``` + +### E2E Tests + +Run end-to-end tests with Cypress: + +```bash +# Open Cypress Test Runner +pnpm cy:open + +# Run Cypress tests in headless mode +pnpm cy:run + +# Run component tests +pnpm cy:open --component +``` + +### Linting + +```bash +pnpm lint +``` + +## πŸ—οΈ Build + +### Development Build + +```bash +pnpm build +``` + +### Preview Production Build + +```bash +pnpm build +pnpm preview +``` + +## πŸ“ Project Structure + +``` +reactive-api-console/ +β”œβ”€β”€ .github/workflows/ # GitHub Actions CI/CD +β”‚ └── ci-cd.yml # Main CI/CD pipeline +β”œβ”€β”€ cypress/ # E2E and Component Testing +β”‚ β”œβ”€β”€ component/ # Cypress component tests +β”‚ β”‚ └── ChatTitle.cy.tsx +β”‚ β”œβ”€β”€ e2e/ # End-to-end tests +β”‚ β”‚ β”œβ”€β”€ api-console.cy.ts +β”‚ β”‚ β”œβ”€β”€ drag-drop.cy.ts +β”‚ β”‚ β”œβ”€β”€ export.cy.ts +β”‚ β”‚ β”œβ”€β”€ highlighting.cy.ts +β”‚ β”‚ └── redux-integration.cy.ts +β”‚ β”œβ”€β”€ fixtures/ # Test data +β”‚ β”‚ β”œβ”€β”€ cat-fact.json +β”‚ β”‚ └── example.json +β”‚ β”œβ”€β”€ support/ # Cypress support files +β”‚ β”‚ β”œβ”€β”€ commands.ts +β”‚ β”‚ β”œβ”€β”€ component.ts +β”‚ β”‚ └── e2e.ts +β”‚ └── cypress.config.js # Cypress configuration +β”œβ”€β”€ public/ # Static assets +β”‚ β”œβ”€β”€ robots.txt +β”‚ └── vite.svg +β”œβ”€β”€ src/ # Source code +β”‚ β”œβ”€β”€ assets/ # Static assets +β”‚ β”‚ └── react.svg +β”‚ β”œβ”€β”€ components/ # React components (Atomic Design) +β”‚ β”‚ β”œβ”€β”€ atoms/ # Basic building blocks +β”‚ β”‚ β”‚ β”œβ”€β”€ APINotFound/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ChatSearchResult/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ChatTitle/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ChatWelcomeMessage/ +β”‚ β”‚ β”‚ β”œβ”€β”€ DragHint/ +β”‚ β”‚ β”‚ β”œβ”€β”€ DropIndicator/ +β”‚ β”‚ β”‚ β”œβ”€β”€ HighlightText/ +β”‚ β”‚ β”‚ β”œβ”€β”€ NoActiveAPI/ +β”‚ β”‚ β”‚ β”œβ”€β”€ NoActivePanel/ +β”‚ β”‚ β”‚ β”œβ”€β”€ NoResponses/ +β”‚ β”‚ β”‚ β”œβ”€β”€ NoResultMatched/ +β”‚ β”‚ β”‚ β”œβ”€β”€ PanelTitle/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ResultWrapper/ +β”‚ β”‚ β”‚ └── SearchSummary/ +β”‚ β”‚ β”œβ”€β”€ molecules/ # Composite components +β”‚ β”‚ β”‚ β”œβ”€β”€ BoredAPI/ +β”‚ β”‚ β”‚ β”œβ”€β”€ CatFacts/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ChatCommand/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ChatLog/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ChatSearch/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ChuckNorris/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ChuckNorrisJoke/ +β”‚ β”‚ β”‚ β”œβ”€β”€ DefaultAPIResponse/ +β”‚ β”‚ β”‚ β”œβ”€β”€ DraggableTab/ +β”‚ β”‚ β”‚ β”œβ”€β”€ FilterPanel/ +β”‚ β”‚ β”‚ β”œβ”€β”€ GithubUsers/ +β”‚ β”‚ β”‚ β”œβ”€β”€ PanelHeader/ +β”‚ β”‚ β”‚ β”œβ”€β”€ SideBarHeader/ +β”‚ β”‚ β”‚ β”œβ”€β”€ UserCommandInputProps/ +β”‚ β”‚ β”‚ └── Weather/ +β”‚ β”‚ β”œβ”€β”€ organisms/ # Complex components +β”‚ β”‚ β”‚ β”œβ”€β”€ ApiPanel/ +β”‚ β”‚ β”‚ β”œβ”€β”€ APIPanelContent/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ApiPanelHeader/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ApiPanelWrapper/ +β”‚ β”‚ β”‚ β”œβ”€β”€ AvailableAPIs/ +β”‚ β”‚ β”‚ β”œβ”€β”€ ChatMessages/ +β”‚ β”‚ β”‚ └── ChatPanel/ +β”‚ β”‚ β”œβ”€β”€ pages/ # Page components +β”‚ β”‚ β”‚ └── Home/ +β”‚ β”‚ └── template/ # Layout templates +β”‚ β”‚ β”œβ”€β”€ ApiPanels.tsx +β”‚ β”‚ β”œβ”€β”€ Chat.tsx +β”‚ β”‚ β”œβ”€β”€ Header.tsx +β”‚ β”‚ β”œβ”€β”€ ResponsesPanel.tsx +β”‚ β”‚ └── SideBar.tsx +β”‚ β”œβ”€β”€ core/ # Business logic +β”‚ β”‚ β”œβ”€β”€ api/ # API integrations +β”‚ β”‚ β”‚ β”œβ”€β”€ bored.api.ts +β”‚ β”‚ β”‚ β”œβ”€β”€ cat-fact.api.ts +β”‚ β”‚ β”‚ β”œβ”€β”€ chuck-norris.api.ts +β”‚ β”‚ β”‚ β”œβ”€β”€ github-users.api.ts +β”‚ β”‚ β”‚ β”œβ”€β”€ registry.ts +β”‚ β”‚ β”‚ β”œβ”€β”€ utils.ts +β”‚ β”‚ β”‚ └── weather.api.ts +β”‚ β”‚ β”œβ”€β”€ entity/ # Domain entities +β”‚ β”‚ β”‚ β”œβ”€β”€ api-response.ts +β”‚ β”‚ β”‚ β”œβ”€β”€ api.ts +β”‚ β”‚ β”‚ β”œβ”€β”€ chat-messages.ts +β”‚ β”‚ β”‚ └── user-command.ts +β”‚ β”‚ └── use-case/ # Business use cases +β”‚ β”‚ └── api-command.use-case.ts +β”‚ β”œβ”€β”€ hooks/ # Custom React hooks +β”‚ β”‚ β”œβ”€β”€ useApiCommands.ts +β”‚ β”‚ β”œβ”€β”€ useApiPanelsSortOrder.ts +β”‚ β”‚ β”œβ”€β”€ useApiSelectedPanel.ts +β”‚ β”‚ β”œβ”€β”€ useChat.ts +β”‚ β”‚ β”œβ”€β”€ useChatMessage.ts +β”‚ β”‚ β”œβ”€β”€ useCommandInput.ts +β”‚ β”‚ β”œβ”€β”€ useFilters.ts +β”‚ β”‚ └── useSpecialCommand.ts +β”‚ β”œβ”€β”€ store/ # Redux store +β”‚ β”‚ β”œβ”€β”€ feature/ # Redux slices +β”‚ β”‚ β”‚ └── slices/ +β”‚ β”‚ β”‚ β”œβ”€β”€ apisSlice.ts +β”‚ β”‚ β”‚ β”œβ”€β”€ chatSlice.ts +β”‚ β”‚ β”‚ β”œβ”€β”€ filtersSlice.ts +β”‚ β”‚ β”‚ β”œβ”€β”€ responsesSlice.ts +β”‚ β”‚ β”‚ └── uiSlice.ts +β”‚ β”‚ β”œβ”€β”€ hooks.ts # Redux hooks +β”‚ β”‚ β”œβ”€β”€ store.ts # Store configuration +β”‚ β”‚ └── StoreProvider.tsx # Store provider +β”‚ β”œβ”€β”€ utils/ # Utility functions +β”‚ β”‚ β”œβ”€β”€ cn.ts # Class name utility +β”‚ β”‚ β”œβ”€β”€ formatTimestamp.ts +β”‚ β”‚ β”œβ”€β”€ highlight.ts # Text highlighting +β”‚ β”‚ └── index.ts +β”‚ β”œβ”€β”€ App.tsx # Main App component +β”‚ β”œβ”€β”€ main.tsx # Application entry point +β”‚ β”œβ”€β”€ index.css # Global styles +β”‚ └── test-setup.ts # Test configuration +β”œβ”€β”€ .eslintrc.js # ESLint configuration +β”œβ”€β”€ .gitignore # Git ignore rules +β”œβ”€β”€ cypress.config.js # Cypress configuration +β”œβ”€β”€ index.html # HTML template +β”œβ”€β”€ package.json # Dependencies and scripts +β”œβ”€β”€ pnpm-lock.yaml # Lock file +β”œβ”€β”€ pnpm-workspace.yaml # Workspace configuration +β”œβ”€β”€ tsconfig.json # TypeScript configuration +β”œβ”€β”€ tsconfig.app.json # App-specific TS config +β”œβ”€β”€ tsconfig.node.json # Node-specific TS config +β”œβ”€β”€ vite.config.ts # Vite configuration +└── vitest.config.ts # Vitest configuration +``` + +## πŸ”§ Configuration + +### Environment Variables + +No environment variables are required for basic functionality. The application uses public APIs. + +### API Endpoints + +The application integrates with the following public APIs: + +- **Cat Facts**: `https://catfact.ninja/fact` +- **Chuck Norris Jokes**: `https://api.chucknorris.io/jokes/random` +- **Bored API**: `https://www.boredapi.com/api/activity` +- **GitHub Users**: `https://api.github.com/search/users` +- **Weather**: `https://api.open-meteo.com/v1/forecast` + +## πŸš€ Deployment + +### Vercel (Recommended) + +1. Connect your repository to Vercel +2. Vercel will automatically detect the Vite configuration +3. Deploy with default settings + +### Manual Deployment + +```bash +# Build the application +pnpm build + +# The built files will be in the `dist/` directory +# Deploy the contents of `dist/` to your hosting provider +``` + +## 🀝 Contributing + +1. Fork the repository +2. Create a feature branch (`git checkout -b feature/amazing-feature`) +3. Commit your changes (`git commit -m 'Add some amazing feature'`) +4. Push to the branch (`git push origin feature/amazing-feature`) +5. Open a Pull Request + +### Development Guidelines + +- Follow the existing code style and structure +- Write tests for new features +- Update documentation as needed +- Use conventional commit messages + +## πŸ“ License + +This project is licensed under the MIT License - see the LICENSE file for details. + +## πŸ†˜ Support + +If you encounter any issues or have questions: + +1. Check the existing issues in the repository +2. Create a new issue with detailed information +3. Include steps to reproduce the problem + +## πŸ”„ CI/CD Pipeline + +The project includes a comprehensive CI/CD pipeline with the following stages: + +1. **Lint**: Code quality checks +2. **Test**: Unit and integration tests with coverage +3. **Build**: Production build verification +4. **E2E**: End-to-end testing with Cypress -## 🌐 Public APIs to Use +The pipeline runs on every push and pull request to ensure code quality and functionality. -### 1. 🐱 Cat Facts API - -- `GET https://catfact.ninja/fact` -- **Command**: `get cat fact` - -### 2. 🧠 Chuck Norris Jokes API - -- `GET https://api.chucknorris.io/jokes/random` -- `GET https://api.chucknorris.io/jokes/search?query=kick` -- **Commands**: `get chuck joke`, `search chuck kick` - -### 3. 🌍 Bored API - -- `GET https://bored-api.appbrewery.com/random` -- **Command**: `get activity` - -### 4. πŸ” GitHub Users Search API - -- `GET https://api.github.com/search/users?q=john` -- **Command**: `search github john` - -### 5. 🌦️ Weather API (Open-Meteo) - -- `GET https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41¤t_weather=true` -- **Command**: `get weather Berlin` -- _(You can hardcode city-to-coordinates mapping in app)_ - -## πŸ—ƒοΈ Public API for Simulating Chat Message Storage - -### πŸ”Ή DummyJSON β€” https://dummyjson.com - -Supports: `GET`, `POST`, `PUT`, `DELETE` - -- Use `/comments` or `/posts` as chat message entities -- Good for simulating user-generated message storage - -#### Example: - -| Command | API Action | -| -------------------------------- | --------------------- | -| `send message "Hello!"` | `POST /comments` | -| `edit message 42 "Updated text"` | `PUT /comments/42` | -| `delete message 42` | `DELETE /comments/42` | +![CI/CD Pipeline](./ci-cd.png) diff --git a/ci-cd.png b/ci-cd.png new file mode 100644 index 0000000..2b4786d Binary files /dev/null and b/ci-cd.png differ