# Project Directory Structure for 'messaging app'

This document outlines the standard directory structure for the 'messaging app' project, adhering to the io8Directory Structure Principles. This structure is designed to organize project files, separate codebases, manage agent outputs, and streamline deployment within a base project environment.

**Project Root: `./` (Current Directory after cloning the base project)**

The project root (`./`) serves as the base for all project files and directories. When the base project is cloned, this directory becomes the working directory. The existing `.sureai/` folder from the cloned project is recognized and integrated into this structure.

## Core Directories and Files:

```
./
├── .io8project/                               # io8 Project Metadata and State Management
│   ├── .state.json                            # Persistent task state for agents
│   └── project_metadata.json                  # Project-specific metadata
├── .sureai/                                   # Agent Outputs, Documents, and Uploads (already existing from cloned project)
│   ├── uploads/                               # Directory for uploaded documents and images (e.g., for requirement builder agent)
│   ├── .directory_structure_messaging_app_messaging_app_20251010_040350.md # This document, detailing the structure
│   ├── .bmad_agent_messaging_app_20251010_040350.md          # Hidden outputs from BMAD agent for this project
│   ├── .analyst_agent_messaging_app_20251010_040350.md       # Hidden outputs from Analyst agent for this project
│   ├── .architect_agent_messaging_app_20251010_040350.md     # Hidden outputs from Architect agent for this project
│   ├── .pm_agent_messaging_app_20251010_040350.md            # Hidden outputs from PM agent for this project
│   ├── .sm_agent_messaging_app_20251010_040350.md            # Hidden outputs from Scrum Master agent for this project
│   ├── .developer_agent_messaging_app_20251010_040350.md     # Hidden outputs from Developer agent for this project
│   ├── .devops_agent_messaging_app_20251010_040350.md        # Hidden outputs from DevOps agent for this project
│   ├── .bmad_*.md                             # General hidden BMAD agent outputs (e.g., older runs)
│   ├── .analyst_*.md                          # General hidden Analyst agent outputs
│   ├── .architect_*.md                        # General hidden Architect agent outputs
│   ├── .developer_*.md                        # General hidden Developer agent outputs
│   ├── .devops_*.md                           # General hidden DevOps agent outputs
│   ├── .pm_*.md                               # General hidden PM agent outputs
│   ├── analysis_document.md                   # Visible document for analysis details (created by Analyst agent)
│   ├── requirements_document.md               # Visible document for project requirements (created by Analyst agent)
│   ├── architecture_document.md               # Visible document for architecture design (created by Architect agent)
│   ├── tech_stack_document.md                 # Visible document for technology stack (created by Architect agent)
│   ├── prd_document.md                        # Visible document for Product Requirements Document (created by PM agent)
│   ├── project_plan.md                        # Visible document for project plan (created by PM agent)
│   ├── tasks_list.md                          # Visible document for project tasks (created by SM agent, updated by Developer)
│   └── sprint_plan.md                         # Visible document for sprint plans (created by SM agent)
├── backend/                                   # Contains all backend code and related files for the messaging app.
│   └── # e.g., src/, app/, config/, tests/ for backend services
├── frontend/                                  # Contains all frontend code and related assets for the messaging app.
│   └── # e.g., src/, public/, components/, pages/ for web/mobile UI
├── deployment_config.yml                      # Root-level configuration for deployment settings (to be created by DevOps agent)
├── Dockerfile.backend                         # Dockerfile specific to building the backend service (to be created by DevOps agent)
├── Dockerfile.frontend                        # Dockerfile specific to building the frontend service (to be created by DevOps agent)
└── docker-compose.yml                         # Docker Compose file for multi-container application setup (to be created by DevOps agent)
```

## Directory Details:

### `.io8project/`
This hidden directory (`.io8project/`) holds internal project metadata and state information crucial for the io8 agents. It is created at the root level alongside the cloned project's content.
-   `.state.json`: Manages the current state and progress of tasks within the workflow.
-   `project_metadata.json`: Stores general project information, configuration, and settings.

### `.sureai/`
This hidden directory (`.sureai/`) acts as the central hub for all agent-generated documentation, outputs, and uploaded assets. It is expected to already exist within the cloned base project.
-   `uploads/`: A dedicated subdirectory for assets uploaded by users or other agents, such as diagrams, mockups, or reference documents that inform requirements.
-   **Hidden Agent Output Files (`.bmad_*.md`, `.analyst_*.md`, etc.)**: These files, prefixed with a dot, contain intermediate outputs, logs, or detailed workings from individual agents. They are not intended for direct user consumption but serve as internal records. This includes this directory structure document itself.
-   **Visible Documents (`analysis_document.md`, `requirements_document.md`, etc.)**: These Markdown files contain structured documentation generated by specific agents (e.g., Analyst, Architect, PM, SM). They are intended for human readability and collaboration. These will be appended by their respective agents as the project progresses.

### `backend/`
This directory is designated for all server-side logic and components of the messaging application. It will contain:
-   API endpoints for sending/receiving messages.
-   User authentication and authorization services.
-   Database interaction logic for storing messages, user data, etc.
-   Real-time communication services (e.g., WebSockets for live chat).
This directory will be created and populated by the Developer agent if not already present in the base project.

### `frontend/`
This directory is for the client-side code and assets of the messaging application, which will provide the user interface. It will contain:
-   User interface components for chat rooms, message lists, input fields.
-   Logic for displaying messages, user presence, notifications.
-   Client-side routing and state management.
-   Integration with backend APIs for real-time updates.
This directory will be created and populated by the Developer agent if not already present in the base project.

### Root Level Configuration Files:
These files are placed at the project root for easy access and management of the overall application environment. They will be created by the DevOps agent.
-   `deployment_config.yml`: High-level configuration for deployment environments (e.g., staging, production).
-   `Dockerfile.backend`: Defines how to build the backend Docker image.
-   `Dockerfile.frontend`: Defines how to build the frontend Docker image.
-   `docker-compose.yml`: Orchestrates the multi-container messaging application, defining services like the backend, frontend, database, and potentially other services like Nginx or a message broker.

This structured approach ensures clarity, maintainability, and efficient collaboration throughout the development lifecycle of the 'messaging app'.