An AI-powered therapist backend system developed using Laravel, MySQL, Firebase, and external AI models via API integration. This backend provides a secure and scalable system for therapist-patient interaction, sentiment analysis, OCR verification, and session PDF generation.
-
🧠 AI Integration:
Communicates with external Python AI services (Flask APIs) for:- Sentiment Analysis of messages
- OCR (ID card text recognition)
- PDF report generation after chat sessions
-
🔐 Doctor Registration & Verification:
- Uploads ID card image
- Extracts and verifies national ID via OCR
- Ensures no duplicates in the database
-
💬 Real-Time Chat (via Firebase):
- Secure messaging between doctor and patient
- Includes support for file sharing and voice notes
-
📄 PDF Reports:
- After a chat session, the Laravel backend sends data to an AI model to generate a PDF
- Stored securely on the server and downloadable by patients
-
🗄️ Database:
- Built with MySQL for storing users, sessions, logs, and medical data
- Token-based authentication for security
| Technology | Purpose |
|---|---|
| Laravel 10 | RESTful API Backend |
| PHP 8+ | Core Logic |
| MySQL | Relational Database |
| Firebase | Real-Time Chat & Voice |
| Railway | API Hosting & Deployment |
| Flask (Python) | AI Services (OCR, NLP, PDF) |
| Postman | API Testing & Documentation |
| Git/GitHub | Version Control & Code Hosting |
# Clone the project
git clone https://github.com/your-username/Therapist-AI-App-APIs.git
# Navigate to the project directory
cd Therapist-AI-App-APIs
# Install dependencies
composer install
# Copy and edit environment settings
cp .env.example .env
# Generate app key
php artisan key:generate
# Set up the database
php artisan migrate
# Start the server
php artisan servegraph LR
User --> Laravel_Backend
Laravel_Backend --> Firebase_Chat
Laravel_Backend --> MySQL_Database
Laravel_Backend --> Python_AI[Flask AI API (OCR/NLP/PDF)]
Python_AI --> Laravel_Backend
Laravel_Backend --> PDF_Storage
├── app/
│ ├── Http/
│ ├── Models/
│ ├── Services/ (AI APIs)
├── database/
│ ├── migrations/
├── public/
├── routes/
│ ├── api.php
├── .env
├── composer.json
├── README.md
POST /api/register-doctor→ Uploads ID + extracts text via OCRPOST /api/start-session→ Starts chat, stores metadataGET /api/get-report/{session_id}→ Returns generated PDFPOST /api/send-message→ Handles Firebase chat message
This project is part of a university graduation requirement. For academic use only.
- Nermeen – Backend Developer
- Abdelrhman - Kotlin Developer
- Menna - AI Developer
- AbdAllah - Kotlin Developer
- Alaa - AI Developer