RESTful backend API for the dabetai diabetes monitoring platform, connecting patients, healthcare professionals, and AI prediction models.
Repository · Report Bug · Research Paper
dabetai is a comprehensive preventive ecosystem for diabetes that predicts complications like retinopathy, nephropathy, neuropathy, and diabetic foot before they become irreversible.
This repository contains the Core API — the central backend service that:
- Handles authentication and authorization with JWT and role-based access (patient, doctor, admin)
- Manages user registration, profiles, and medical data
- Provides CRUD endpoints for patients and healthcare professionals
- Communicates with AI models for predicting diabetic complications
- Exposes auto-generated API documentation via Swagger UI and Scalar
| Component | Repository | Stack |
|---|---|---|
| Mobile App | dabetai-org/mobile-app | React Native 0.79, Expo 53, Tailwind CSS |
| Web Portal | dabetai-org/web-app | Angular 19, Tailwind CSS |
| Core API (this) | dabetai-org/api | NestJS 11, PostgreSQL, Prisma |
| AI Inference API | dabetai-org/ai-api | FastAPI, Python 3.11, MongoDB |
| AI Models | dabetai-org/ai-models | Python, scikit-learn, XGBoost, PyTorch |
| Landing | dabetai-org/landing | Astro, Tailwind CSS |
- JWT Authentication — Registration and login with role-based access (patient, doctor, admin)
- User Management — Full CRUD for patients and healthcare professionals
- Medical Data — Storage for diabetes and comorbidity information
- 2-Step Registration — Basic account + medical profile completion
- Auto-Generated Docs — Swagger UI and Scalar for API testing
- Security — Password hashing, data validation, secure tokens
- Relational Database — PostgreSQL with Prisma ORM
- Statistics — Endpoints for patient and doctor metrics
- Node.js 18+
- PostgreSQL 14+
- npm or yarn
git clone https://github.com/dabetai-org/api.git
cd api
npm installCreate a .env file:
DATABASE_URL="postgresql://user:password@localhost:5432/dabetai_db"
JWT_SECRET="your_secure_jwt_secret"
NODE_ENV="development"Run migrations:
npx prisma migrate dev
npx prisma generateStart the development server:
npm run start:devAPI available at http://localhost:3000
- Swagger UI:
http://localhost:3000/api/docs - Scalar UI:
http://localhost:3000/api/scalar
┌─────────────────────────────────────────┐
│ Core API (NestJS) │
│ ┌──────────┐ ┌──────────┐ ┌────────────────┐ │
│ │ Auth │ │ Users │ │ Medical │ │
│ │ Module │ │ Module │ │ Data Module │ │
│ └────┤─────┘ └────┤─────┘ └──────┤──────────┘ │
│ │ │ │ │
│ ┌────├────────────├──────────────────├───────────┐ │
│ │ Prisma ORM Layer │ │
│ └──────────────────────────┘ │
└──────────────────├─────────────────────────┘
│
┌──────├──────┐
│ PostgreSQL │
└─────────────┘
Please read CONTRIBUTING.md for branch naming, commit conventions, and PR workflow.
This project is licensed under the GNU General Public License v3.0 — see the LICENSE file for details.
Authors:
- Cardenas Cabal Fermín
- Ortiz Pérez Alejandro — alex03ortizperez@gmail.com
- Serrano Puertos Jorge Christian — christian.serrano.puertos@gmail.com
Advisors:
- Guarneros Nolasco Luis Rolando
- Cruz Ramos Nancy Aracely
Academic Support:
- Universidad Tecnológica del Centro de Veracruz