AugenAI is an AI-powered medical imaging analysis platform built with modern web technologies. This monorepo contains both the web application and the AI prediction service.
This project uses [Turborepo] to manage a monorepo with the following applications:
apps/web: Next.js web application with TypeScript, Drizzle ORM, and Supabaseapps/ai_service: FastAPI-based AI prediction service for medical image analysis
Before you begin, ensure you have the following installed:
- Node.js >=18
- pnpm >=9.0.0
- Python >=3.10, <3.15
- uv (Python package manager)
- Docker (optional, for containerized deployment)
- Supabase
Unlike most repositories, this repo includes a submodule for each model and these include large files that store the model weights. To handle these files, Git LFS is used and must be installed before the cloning.
Once it is installed, proceed with the following steps. First clone the repository using the url provided by GitHub
git clone <repository-url>
cd augenaiThen initialize the submodules with
git submodule update --init --recursiveNow all the models have been downloaded. We proceed to install the dependencies.
Install all dependencies for both apps:
pnpm installThis will:
- Install Node.js dependencies for the web app
- Install Python dependencies for the AI service (runs
uv syncautomatically)
Create a .env file in apps/web/ with the following variables:
# Supabase Configuration
SUPABASE_DB_URL=postgresql://postgres.xxx:[email protected]:6543/postgres
SUPABASE_MASTER_API_KEY=sb_secret_your_master_api_key
SUPABASE_JWT_JWK='{"x": "...", "y": "...", "alg": "ES256", "crv": "P-256", "ext": true, "kid": "...", "kty": "EC", "key_ops": ["verify"]}'
# Supabase Public Keys
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=sb_publishable_your_key
# AI Service
AI_PREDICTION_SERVICE_URL=http://localhost:8000/api/v1
AI_PREDICTION_SERVICE_SECRET_KEY=your_secret_key_here
# Email Service (Resend)
RESEND_API_KEY=re_your_resend_api_key
RESEND_FROM_EMAIL=[email protected]
# Environment
ENVIRONMENT=developmentCreate a .env file in apps/ai_service/ with:
# API Configuration
AI_PREDICTION_SERVICE_SECRET_KEY=your_secret_key_hereNote: Make sure the AI_PREDICTION_SERVICE_SECRET_KEY matches in both .env files.
Initialize database structure (tables only):
cd apps/web
pnpm migrate # Creates tables and schema
cd ../..Initialize database with essential data:
cd apps/web
pnpm migrate:seed # Creates tables + loads required data
cd ../..CAUTION: migrate:seed will delete existing data before loading new data. Use with caution in production.
From the root of the monorepo:
pnpm devThis will start:
- Web App: http://localhost:3000
- AI Service: http://localhost:8000
Run tests for all apps:
pnpm testThis project uses:
- Drizzle ORM for type-safe database queries
- PostgreSQL(Supabase) as the database
- Supabase for authentication and storage
cd apps/web
# Generate a new migration
pnpm generate -- <migration_name>
# Apply migrations (structure only)
pnpm migrate
# Apply migrations + load essential data
pnpm migrate:seedStart the entire stack with Docker Compose:
pnpm docker:build
pnpm docker:runaugenai/
βββ apps/
β βββ web/ # Next.js web application
β β βββ app/ # Next.js app directory
β β βββ components/ # React components
β β βββ server/ # Server-side code
β β β βββ db/ # Database schemas and migrations
β β β βββ services/ # Business logic
β β β βββ zod-schemas/ # Validation schemas
β β βββ tests/ # Test files
β β βββ types/ # TypeScript type definitions
β β
β βββ ai_service/ # FastAPI AI service for medical image analysis
β βββ src/
β β βββ ai_service/
β β βββ main.py # FastAPI app entry point with CORS & logging
β β βββ config.py # Environment configuration
β β βββ logging_config.py # Structured logging setup
β β βββ routers/ # API route handlers
β β β βββ health.py # Health check endpoints
β β β βββ predictions.py # ML prediction endpoints
β β β βββ api.py # Main API router
β β βββ services/ # Business logic layer
β β β βββ model/ # Model management services
β β β βββ prediction/ # Prediction services
β β β βββ service.py # Prediction orchestration
β β β βββ model_pool.py # Model pooling & caching
β β β βββ factories/ # Model factories
β β βββ models/ # Pydantic schemas
β β β βββ schemas.py # Request/response models
β β βββ auth/ # Authentication middleware
β βββ tests/ # Pytest test suite
β β βββ routers/ # Router tests
β β βββ prediction/ # Prediction service tests
β β βββ model/ # Model service tests
β β βββ dr_sample/ # Sample medical images for testing
β βββ weights/ # Pre-trained model weights
β βββ pyproject.toml # Python dependencies (uv)
β βββ Dockerfile # Container configuration
β
βββ package.json # Root package.json
βββ turbo.json # Turborepo configuration
βββ README.md # This file
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Database ORM: Drizzle ORM
- Database: PostgreSQL (via Supabase)
- Authentication: Supabase Auth
- Storage: Supabase Storage
- UI: Radix UI, Tailwind CSS
- Testing: Vitest
- Linting: ESLint
- Type Checking: TypeScript
- Framework: FastAPI
- Language: Python 3.13
- Package Manager: uv
- Linting/Formatting: Ruff
- Create a new branch from
main - Make your changes
- Run tests and type-checking
- Submit a pull request
Before committing, ensure:
# Type-check passes
pnpm check-types
# Linting passes
pnpm lint
# Tests pass
pnpm test
# Code is formatted
pnpm formatMIT License
Made with β€οΈ by Team Tikismikis π―β¨π
For issues and support, please create an issue on GitHub.