Sistema de diagnóstico de esclerosis lateral amiotrófica (ALS) usando machine learning. Aplicación full-stack con FastAPI (backend) y React (frontend) desplegada en Google Cloud Platform. link del modelo de I: https://colab.research.google.com/drive/1pRcxXXU9VT2l58xZX_hjYOquT3A6IgQm?usp=sharing
┌─────────────────────────────────────────────────────────────┐
│ Frontend (React + TypeScript) │
│ Cloud Run: als-frontend-*.run.app │
└─────────────────────────────────────────────────────────────┘
↕
┌─────────────────────────────────────────────────────────────┐
│ Backend (FastAPI + Python) │
│ Cloud Run: als-backend-*.run.app │
└─────────────────────────────────────────────────────────────┘
↕
┌─────────────────────────────────────────────────────────────┐
│ Cloud SQL (PostgreSQL) │
│ als-detection-505902:us-central1 │
└─────────────────────────────────────────────────────────────┘
- Python 3.12+
- Node.js 18+
- Docker Desktop
gcloudCLI
1. Backend:
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python -m uvicorn src.main:app --reload2. Frontend:
cd frontend
npm install
npm run dev3. Accede:
http://localhost:3000
Backend API: http://localhost:8000
API Docs: http://localhost:8000/api/v1/docs
Backend (.env):
DATABASE_URL=postgresql+psycopg2://usuario:contraseña@/basedatos?host=/cloudsql/proyecto:region:instancia
SECRET_KEY=tu_clave_secreta_jwt
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
Backend:
gcloud builds submit ./backend --tag gcr.io/proyecto/backend:latest
gcloud run deploy backend --image gcr.io/proyecto/backend:latest \
--port 8080 --region us-central1 --allow-unauthenticatedFrontend:
gcloud builds submit ./frontend --tag gcr.io/proyecto/frontend:latest
gcloud run deploy frontend --image gcr.io/proyecto/frontend:latest \
--port 80 --region us-central1 --allow-unauthenticated- Navega a "Pacientes"
- Ingresa cédula, nombre, edad
- Click en "Crear Paciente"
- Selecciona un paciente existente
- Opción A: Ingresa biomarcadores manualmente
- Opción B: Carga un JSON con los valores
- Click en "Ejecutar Análisis Diagnóstico"
{
"1699": 113.0,
"20919": 137.0,
"15778": 118.0,
"2007": 92.0,
"34258": 11582.0
}Las claves deben ser los IDs de los biomarcadores del modelo.
POST /api/v1/auth/login → Login usuario
POST /api/v1/auth/logout → Logout
POST /api/v1/auth/register → Registrar nuevo usuario
GET /api/v1/patients/ → Listar pacientes
POST /api/v1/patients/ → Crear paciente
GET /api/v1/patients/{id} → Obtener paciente
POST /api/v1/analyses/ → Ejecutar análisis
GET /api/v1/analyses/history → Historial de análisis
GET /api/v1/analyses/biomarkers → Biomarcadores requeridos
GET /api/config → Configuración del API
ALS_detection/
├── backend/
│ ├── src/
│ │ ├── api/v1/
│ │ │ ├── endpoints/
│ │ ├── core/
│ │ ├── curd/
│ │ ├── ml_models/
│ │ ├── services/
│ │ ├── models/
│ │ ├── schemas/
│ │ ├── database.py
│ │ ├── config.py
│ │ └── main.py
│ ├── requirements.txt
│ └── Dockerfile
│
├── frontend/
│ ├── src/
│ │ ├── assets/
│ │ ├── services/
│ │ ├── components/
│ │ │ ├── auth/
│ │ │ ├── layout/
│ │ │ ├── ui/
│ │ ├── pages/
│ │ ├── types/
│ │ └── App.tsx
│ ├── package.json
│ └── Dockerfile
│
└── docker-compose.yml
- ✅ Autenticación JWT
- ✅ CORS restringido al frontend
- ✅ Contraseñas hasheadas con bcrypt
- ✅ Variables de entorno para secrets
- ✅ HTTPS en producción (GCP)
# Backend tests
cd backend
pytest tests/
# Frontend tests
cd frontend
npm testMIT License - Ver LICENSE para detalles
- Leonardo Amaris
Estado: ✅ Producción
Última actualización: Agosto 2026
URLs de Producción: