Skip to content

hirok121/HepatoCAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

85 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

HepatoCAI

๐Ÿ”ฌ AI-Powered Hepatitis C Detection & Information Hub

Advanced HCV stage detection powered by artificial intelligence

Django React Python Node.js MUI License

Features โ€ข Quick Start โ€ข Architecture โ€ข Contributing โ€ข License


๐Ÿ“‹ Table of Contents

๐ŸŽฏ About

HepatoCAI is a comprehensive web-based platform designed to provide accessible and informative resources related to Hepatitis C (HCV). The platform leverages artificial intelligence to offer educational content, AI-assisted information, and showcases the potential of AI-powered diagnostic tools.

Target Audience

  • Individuals seeking general information about Hepatitis C
  • Patients or those at risk looking for resources and understanding
  • Healthcare professionals interested in AI applications in HCV diagnostics
  • Researchers exploring AI-driven healthcare solutions

โœจ Features

๐Ÿค– AI-Powered Assistant (HcvInfoBot)

  • Interactive AI assistant powered by Google's Gemini API
  • Provides educational information about Hepatitis C
  • Real-time Q&A with safety disclaimers
  • Multilingual support capabilities

๐Ÿ”ฌ Diagnostic Tool Concept

  • Conceptual AI diagnostic tool for HCV stage detection
  • Blood sample parameter analysis framework
  • Clinical decision support interface
  • Future ML model integration ready

๐ŸŽจ Dynamic Visual Experience

  • AI-generated illustrations using Google's Imagen API
  • Modern, responsive Material-UI design
  • Professional healthcare-focused aesthetics
  • Interactive animations and transitions

๐Ÿ“š Information Hub

  • Comprehensive HCV educational resources
  • Blog system for articles and research updates
  • Patient stories and expert opinions
  • Up-to-date medical information

๐Ÿ” Security & Compliance

  • JWT-based authentication
  • Secure API endpoints
  • Medical data protection measures
  • GDPR compliance ready

๐Ÿ— Architecture

HepatoCAI/
โ”œโ”€โ”€ frontend/          # React + Vite application
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/    # Reusable UI components
โ”‚   โ”‚   โ”œโ”€โ”€ pages/         # Application pages
โ”‚   โ”‚   โ”œโ”€โ”€ services/      # API integration
โ”‚   โ”‚   โ””โ”€โ”€ hooks/         # Custom React hooks
โ”‚   โ””โ”€โ”€ public/            # Static assets
โ”œโ”€โ”€ backend/           # Django REST API
โ”‚   โ”œโ”€โ”€ aiassistant/       # AI assistant module
โ”‚   โ”œโ”€โ”€ diagnosis/         # Diagnostic tools
โ”‚   โ”œโ”€โ”€ users/             # User management
โ”‚   โ”œโ”€โ”€ utils/             # Shared utilities
โ”‚   โ””โ”€โ”€ tests/             # Test modules
โ””โ”€โ”€ docs/              # Project documentation

Technology Stack

Frontend:

  • React.js 18+ with Vite
  • Material-UI (MUI) for component library
  • TanStack Query for state management
  • Axios for API communication
  • TypeScript support

Backend:

  • Django 5.2+ with Django REST Framework
  • JWT authentication
  • Google AI APIs (Gemini & Imagen)
  • PostgreSQL/SQLite database
  • Comprehensive logging system

AI Integration:

  • Google Gemini API for text generation
  • Google Imagen API for image generation
  • Custom AI model integration framework

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Python 3.11+
  • Git

1. Clone the Repository

git clone https://github.com/hirok121/HepatoCAI.git
cd HepatoCAI

2. Backend Setup

cd backend
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

3. Frontend Setup

cd frontend
npm install
npm run dev

Visit http://localhost:5173 to see the application running.

๐Ÿ”ง Troubleshooting

Common Issues

Backend Issues:

  • Database errors: Run python manage.py migrate to apply migrations
  • Missing API keys: Ensure GOOGLE_API_KEY is set in backend/.env
  • CORS errors: Add your frontend URL to CORS_ALLOWED_ORIGINS

Frontend Issues:

  • API connection failed: Check VITE_API_BASE_URL in frontend/.env.local
  • Build failures: Clear node_modules and reinstall: rm -rf node_modules && npm install
  • Port conflicts: Change port in vite.config.js or use npm run dev -- --port 3000

Development Tips:

  • Backend logs are in backend/logs/
  • Use python manage.py shell for Django debugging
  • Check browser console for frontend errors
  • API documentation available at http://localhost:8000/api/docs/swagger/

๐Ÿ“ฆ Installation

For detailed installation instructions, see:

๐ŸŽฎ Usage

AI Assistant

// Example AI assistant usage
const response = await fetch("/aiassistant/chats/{chat_id}/messages/", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    message: "What are the symptoms of Hepatitis C?",
  }),
});

Diagnostic Tool

# Example diagnostic API usage
curl -X POST http://localhost:8000/diagnosis/analyze-hcv/ \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "alt": 45,
    "ast": 38,
    "bilirubin": 1.2,
    "albumin": 4.0
  }'

๐Ÿ“š Documentation

๐Ÿ“– Complete Documentation Hub - Your one-stop guide to all HepatoCAI documentation

๐Ÿš€ Quick Links

Get Started Learn More Deploy
๐Ÿ“‹ Installation ๐Ÿ“– User Guide ๐Ÿš€ Deployment
โ“ FAQ ๐Ÿ—๏ธ Architecture ๐Ÿงช Testing
๐Ÿ”Œ API Docs ๐Ÿค Contributing ๐Ÿ”’ Security

๐Ÿ“‹ Project Information

Document Description
๐Ÿค Contributing Developer contribution guidelines
๐Ÿ”’ Security Security policy and vulnerability reporting
๐Ÿ“ Changelog Version history and release notes

๐Ÿ”— Quick Access

  • API Documentation:
    • Swagger UI: http://localhost:8000/api/docs/swagger/
    • ReDoc: http://localhost:8000/api/docs/redoc/
    • Schema: http://localhost:8000/api/schema/

Key API Endpoints

Endpoint Method Description
/aiassistant/chats/ GET/POST List/create AI chat sessions
/aiassistant/chats/{chat_id}/messages/ POST Send message to AI assistant
/diagnosis/analyze-hcv/ POST HCV diagnostic analysis
/users/profile/ GET/PUT User profile management
/accounts/token/ POST User authentication
/accounts/token/refresh/ POST Token refresh

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Standards

  • Follow PEP 8 for Python code
  • Use ESLint configuration for JavaScript/React
  • Write comprehensive tests
  • Document all public APIs

๐Ÿงช Testing

Backend Tests

cd backend
python manage.py test

Frontend Tests

cd frontend
npm run test

Integration Tests

# Run full test suite
npm run test:integration

๐Ÿš€ Deployment

Production Deployment

The application is configured for deployment on Render for both frontend and backend:

  • Backend: Django REST API as Render Web Service
  • Frontend: React application as Render Static Site
  • Database: PostgreSQL managed database on Render

Live Demo

Deployment Configuration

Both services use render.yaml configuration files:

  • backend/render.yaml - Backend web service configuration
  • frontend/render.yaml - Frontend static site configuration

For detailed deployment instructions, see DEPLOYMENT.md.

Environment Variables

Both frontend and backend require environment configuration:

Backend (.env):

cp backend/.env.example backend/.env
# Edit backend/.env with your API keys and database settings

Frontend (.env.local):

cp frontend/.env.example frontend/.env.local
# Edit frontend/.env.local with your API URLs and configuration

Key environment variables:

  • GOOGLE_API_KEY - Required for AI features
  • SECRET_KEY - Django secret key
  • VITE_API_BASE_URL - Backend API URL for frontend

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

โš ๏ธ Disclaimer

Important Medical Disclaimer:

This application provides general information about Hepatitis C for educational purposes only. It is not intended to be a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition.

The AI diagnostic tool is conceptual and should not be used for actual medical diagnosis. Any implementation would require proper medical validation, regulatory approval, and compliance with healthcare standards.


Made with โค๏ธ for better healthcare through AI

ยฉ 2025 HepatoCAI. All rights reserved.