Workflow Docs
Project Workflow & Architecture
A detailed breakdown of how this application is built and operates.
Project Overview
This is a Next.js application designed as an intelligent organizational assistant. It leverages Generative AI (via Google's Gemini model and Genkit) to help with complex business processes like variation resolution and decision making. The application is built with a modern, component-based architecture and uses server-side actions to handle business logic securely.
Technology Stack
- Framework: Next.js (with App Router)
- Language: TypeScript
- AI Integration: Genkit with Google's Gemini Pro model
- UI Components: ShadCN UI
- Styling: Tailwind CSS
- State Management: React Hooks & Server Actions
Key Directories
- `src/app`: Contains all pages and routes.
- `src/ai/flows`: Genkit flows defining the AI logic.
- `src/app/actions.ts`: Server-side logic connecting UI to AI flows.
- `src/components`: Reusable React components.
- `src/lib`: Utility functions.
AI Integration (Genkit)
The core AI logic is managed by Genkit. Flows are defined in `src/ai/flows`. Each flow defines an input schema (using Zod), an output schema, and a prompt template that instructs the Gemini model on how to process the inputs to generate the desired output.
Core Features Breakdown
Company Settings
This page (`/company-settings`) allows users to input their company's mission, vision, goals, and plans. This data is stored in memory (in a real app, a database) and is passed as context to the AI for more tailored responses. The logic is handled in `handleSaveCompanySettings` in `actions.ts`.
AI Variation Solver & Log
Users describe an organizational variation on the `/variation-solver` page. The form data is sent to the `handleResolveVariation` server action, which invokes the `resolveVariationFlow` Genkit flow. The AI's recommendation is returned and displayed. Each submission is also saved to an in-memory log, which can be viewed on the `/variation-log` page.
Decision Optimizer
Found at `/decision-optimizer`, this tool helps users make complex decisions. It takes a required decision, relevant data, and weighted parameters, sending them to the `optimizeDecisionFlow`. The AI returns a suggested decision, the rationale, and A/B testing ideas if requested.
Meeting Recorder & Log
The `/meeting-recorder` page allows users to save meeting notes. They can either type notes manually or record audio in English or Arabic. The audio is transcribed by an AI flow. Then, another AI flow summarizes the notes, extracting action items and key decisions. All recorded meetings are viewable in the `/meeting-log`.
Auto Communicator
This page (`/auto-communicator`) generates communication drafts. It takes a requirement, target team, and medium. It can also accept an optional file upload, which is converted to a data URI and included in the prompt for the AI to use as context via the `generateCommunicationFlow`.
Smart Tasker
The `/smart-tasker` page is a mock task management system with pre-populated, in-memory data for tasks and team members. It demonstrates UI concepts for creating, editing, and assigning tasks, including a mock "AI suggestion" feature for assigning team members based on skills. All data is client-side for this feature.