Skip to content

asdspal/caresync

Repository files navigation

CareSync

CareSync is a comprehensive healthcare management platform built as a monorepo containing a Python/FastAPI backend, AI agents, React web frontend, and React Native mobile app.

Prerequisites

  • Docker and Docker Compose
  • Git
  • Node.js (v18 or higher)
  • Python (v3.9 or higher)
  • npm or yarn

Local Development Setup

Using Docker Compose

  1. Clone the repository:
git clone <repository-url>
cd caresync-mono
  1. Start the local development services:
cd docker
docker-compose up -d

This will start PostgreSQL and Redis containers for local development.

Backend Services Setup

  1. Navigate to the backend API directory:
cd apps/backend-api
  1. Install Python dependencies:
pip install poetry
poetry install
  1. Run the backend service:
poetry run uvicorn main:app --reload

Frontend Web Setup

  1. Navigate to the frontend web directory:
cd apps/frontend-web
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev

Frontend Mobile Setup

  1. Navigate to the frontend mobile directory:
cd apps/frontend-mobile
  1. Install dependencies:
npm install
  1. Start the development server:
npx react-native start

Linting and Formatting

Python

For Python projects, we use Ruff for linting and Black for formatting:

# Lint
ruff check .

# Format
black .

JavaScript/TypeScript

For frontend projects, we use ESLint and Prettier:

# Lint
npm run lint

# Format
npm run format

Contribution Guidelines

  1. Create a feature branch from main
  2. Follow the linting and formatting rules
  3. Write meaningful commit messages
  4. Submit a pull request with a clear description
  5. Ensure all tests pass before merging

Project Structure

caresync-mono/
├── .github/
│   └── workflows/ (for CI/CD later)
├── apps/
│   ├── backend-api/     # FastAPI application
│   ├── ai-agents/       # Python FastAPI microservices for AI agents
│   ├── frontend-web/    # React application
│   └── frontend-mobile/ # React Native application
├── libs/               # (Optional) For shared code like types, utilities
├── infra/              # Infrastructure as Code (e.g., Terraform, AWS CDK)
└── docker/             # Dockerfiles and docker-compose for local dev

## Infrastructure Setup
The infrastructure is provisioned using Terraform and includes:
- VPC with public and private subnets across multiple AZs
- EKS cluster for container orchestration
- RDS PostgreSQL for primary database
- ElastiCache Redis for caching
- S3 buckets for document storage and logging
- Cognito for authentication
- SES for email notifications
- Secrets Manager for secure credential management
- ECR repositories for Docker images
- CI/CD pipeline with GitHub Actions

### Prerequisites
- AWS CLI configured with appropriate permissions
- Terraform >= 1.0
- Docker
- kubectl

### Setting Up Infrastructure

1. **Configure AWS credentials:**
```bash
aws configure
  1. Initialize Terraform:
cd infra/terraform/staging
terraform init
  1. Set up remote state (optional but recommended): Create an S3 bucket and DynamoDB table for Terraform state locking, then update backend.tf.

  2. Review and apply the infrastructure:

terraform plan -var="aws_account_id=YOUR_ACCOUNT_ID" -var="environment=staging"
terraform apply -var="aws_account_id=YOUR_ACCOUNT_ID" -var="environment=staging"
  1. Set up GitHub Actions secrets: After running Terraform, set the following secrets in your GitHub repository:
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • ECR_REPOSITORY_BACKEND (from Terraform output)
  • ECR_REPOSITORY_AUDITOR (from Terraform output)
  • ECR_REPOSITORY_ORCHESTRATOR (from Terraform output)
  • ECR_REPOSITORY_FRONTEND_WEB (from Terraform output)
  • ECR_REPOSITORY_FRONTEND_MOBILE (from Terraform output)

Deployment

The CI/CD pipeline is configured in .github/workflows/ci.yml and includes:

  • Code linting and formatting checks
  • Unit tests
  • Docker image building and pushing to ECR
  • Deployment to EKS cluster

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published