Skip to the content.
AgentCare Logo
πŸ“š AgentCare Documentation

AgentCare Project Structure Guide

Overview

This document outlines the complete organizational structure of the AgentCare multi-agent healthcare scheduling platform.

πŸ“ Root Directory Structure

agentcare/
β”œβ”€β”€ πŸ“± frontend/              # React + TypeScript + Vite frontend
β”œβ”€β”€ πŸ”§ backend/               # Node.js + Express + TypeScript API
β”œβ”€β”€ πŸ—„οΈ database/              # PostgreSQL schemas and migrations
β”œβ”€β”€ πŸ—οΈ infrastructure/        # Docker, Kubernetes, CI/CD configurations
β”œβ”€β”€ πŸ“š docs/                  # Complete project documentation
β”œβ”€β”€ πŸ§ͺ tests/                 # Integration and E2E tests
β”œβ”€β”€ πŸ“œ scripts/               # Automation and utility scripts
β”œβ”€β”€ πŸ”’ ssl/                   # SSL certificates and security configs
β”œβ”€β”€ πŸ“Š coverage/              # Test coverage reports
β”œβ”€β”€ πŸ“ logs/                  # Application logs
└── βš™οΈ Configuration Files    # Package.json, Docker, CI/CD configs

🎯 Frontend Structure (frontend/)

frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/           # React components
β”‚   β”‚   β”œβ”€β”€ UI/              # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ Layout/          # Layout components
β”‚   β”‚   └── Features/        # Feature-specific components
β”‚   β”œβ”€β”€ pages/               # Page components
β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”œβ”€β”€ store/               # State management (Zustand)
β”‚   β”œβ”€β”€ theme/               # Material-UI themes
β”‚   β”œβ”€β”€ utils/               # Utility functions
β”‚   └── types/               # TypeScript type definitions
β”œβ”€β”€ public/                  # Static assets
β”‚   β”œβ”€β”€ assets/              # Images, icons, etc.
β”‚   β”œβ”€β”€ 404.html             # GitHub Pages SPA routing
β”‚   └── CNAME                # Custom domain config
β”œβ”€β”€ tests/                   # Frontend unit tests
β”œβ”€β”€ dist/                    # Build output
β”œβ”€β”€ Dockerfile               # Standalone frontend container
β”œβ”€β”€ nginx.conf               # Nginx configuration
└── package.json             # Frontend dependencies

πŸ”§ Backend Structure (backend/)

backend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ agents/              # AI agents (Supervisor, Booking, FAQ, etc.)
β”‚   β”œβ”€β”€ controllers/         # Express route controllers
β”‚   β”œβ”€β”€ middleware/          # Express middleware
β”‚   β”œβ”€β”€ models/              # Data models and schemas
β”‚   β”œβ”€β”€ routes/              # API route definitions
β”‚   β”œβ”€β”€ services/            # Business logic services
β”‚   β”œβ”€β”€ tools/               # Agent tools and utilities
β”‚   β”œβ”€β”€ patterns/            # Enterprise patterns (Circuit Breaker, etc.)
β”‚   β”œβ”€β”€ process/             # Process management (12-Factor)
β”‚   β”œβ”€β”€ config/              # Configuration management
β”‚   β”œβ”€β”€ logging/             # Logging utilities
β”‚   β”œβ”€β”€ utils/               # Utility functions
β”‚   └── types/               # TypeScript type definitions
β”œβ”€β”€ tests/                   # Backend unit tests
β”œβ”€β”€ dist/                    # Compiled TypeScript output
β”œβ”€β”€ logs/                    # Backend-specific logs
β”œβ”€β”€ Dockerfile               # Standalone backend container
└── package.json             # Backend dependencies

πŸ—„οΈ Database Structure (database/)

database/
β”œβ”€β”€ schemas/                 # SQL schema definitions
β”œβ”€β”€ migrations/              # Database migration scripts
β”œβ”€β”€ seeds/                   # Sample data and demo data
β”œβ”€β”€ backups/                 # Database backup scripts
└── README.md                # Database setup instructions

πŸ—οΈ Infrastructure Structure (infrastructure/)

infrastructure/
β”œβ”€β”€ docker/                  # Docker configurations
β”‚   β”œβ”€β”€ Dockerfile           # Multi-stage monorepo build
β”‚   β”œβ”€β”€ Dockerfile.backend   # Backend-specific container
β”‚   β”œβ”€β”€ Dockerfile.frontend  # Frontend-specific container
β”‚   β”œβ”€β”€ docker-compose.yml   # Development stack
β”‚   β”œβ”€β”€ docker-compose.prod.yml # Production stack
β”‚   └── nginx.conf           # Nginx configuration
β”œβ”€β”€ kubernetes/              # K8s deployment manifests
β”œβ”€β”€ helm/                    # Helm charts
β”œβ”€β”€ ci-cd/                   # CI/CD pipeline configurations
β”œβ”€β”€ 12factor/                # 12-Factor app compliance
β”œβ”€β”€ observability/           # Monitoring and logging
β”œβ”€β”€ process-management/      # PM2 and process configs
└── README.md                # Infrastructure guide

πŸ“š Documentation Structure (docs/)

docs/
β”œβ”€β”€ architecture/            # Architecture guides and diagrams
β”‚   β”œβ”€β”€ ARCHITECTURE_GUIDE.md
β”‚   β”œβ”€β”€ MULTI_TENANCY_GUIDE.md
β”‚   β”œβ”€β”€ TWELVE_FACTOR_GUIDE.md
β”‚   └── diagrams/            # Architecture diagrams
β”œβ”€β”€ setup/                   # Setup and installation guides
β”‚   β”œβ”€β”€ DOCKER_SETUP.md
β”‚   β”œβ”€β”€ DOCKER_MIGRATION_SUMMARY.md
β”‚   └── QUICK_START.md
β”œβ”€β”€ guides/                  # User and developer guides
β”œβ”€β”€ api/                     # API documentation
β”œβ”€β”€ testing/                 # Testing documentation
β”œβ”€β”€ operations/              # Operations and deployment
β”œβ”€β”€ assets/                  # Documentation images and files
β”œβ”€β”€ _config.yml              # GitHub Pages configuration
└── index.md                 # Documentation homepage

πŸ§ͺ Testing Structure (tests/)

tests/
β”œβ”€β”€ unit/                    # Unit tests
β”œβ”€β”€ integration/             # Integration tests
β”œβ”€β”€ contract/                # Contract tests
β”œβ”€β”€ e2e/                     # End-to-end tests
β”œβ”€β”€ performance/             # Performance tests
β”œβ”€β”€ fixtures/                # Test data and fixtures
└── utils/                   # Testing utilities

βš™οΈ Configuration Files

File Purpose
package.json Root workspace configuration
tsconfig.json Global TypeScript configuration
jest.config.js Jest testing configuration
playwright.config.ts Playwright E2E test configuration
sonar-project.properties SonarCloud configuration
.github/workflows/ GitHub Actions CI/CD
docker-compose.yml Development environment
env.example Environment variable template
.gitignore Git ignore patterns
.eslintrc.js ESLint configuration
.cursorrules Cursor AI IDE rules

πŸ”„ Build and Deployment Flow

graph TD A[Source Code] --> B[Build Process] B --> C[Testing Pipeline] C --> D[Docker Images] D --> E[Container Registry] E --> F[Deployment] B --> B1[Frontend Build] B --> B2[Backend Build] C --> C1[Unit Tests] C --> C2[Integration Tests] C --> C3[E2E Tests] F --> F1[Development] F --> F2[Staging] F --> F3[Production]

πŸ“± Frontend Architecture

graph TB A[React App] --> B[Router] B --> C[Pages] C --> D[Components] D --> E[Hooks] E --> F[Store] F --> G[API Layer] G --> H[Backend API]

πŸ”§ Backend Architecture

graph TB A[Express Server] --> B[Routes] B --> C[Controllers] C --> D[Services] D --> E[Agents] E --> F[Tools] F --> G[Database] D --> H[External APIs]

πŸš€ Key Features by Directory

Frontend Features

Backend Features

Infrastructure Features

πŸ“‹ Development Guidelines

File Naming Conventions

Directory Organization Rules

  1. Group related files together
  2. Keep components close to where they’re used
  3. Separate concerns (UI, business logic, data)
  4. Use index files for clean imports
  5. Maintain flat hierarchy when possible

Documentation Standards

πŸ”„ Migration and Updates

When adding new features or refactoring:

  1. Follow the established directory structure
  2. Update relevant documentation
  3. Add appropriate tests
  4. Update CI/CD pipelines if needed
  5. Consider impact on deployment

This structure supports scalability, maintainability, and clear separation of concerns while enabling efficient development workflows.